logs archiveIRC Archive / Freenode / #php / 2015 / August / 5 / 1
MarkyC
damarusama: http://3v4l.org/klnVA
damarusama: use DateTime:createFromFormat
monodesigns
Is it possible to use a variable as a conjunction in an if statement? Like if($a == $b ($andor) $c == $d)
benkai
hi, for php.ini, if you modify the configuration, lets say upload_max_filesize to a different value.. do you have to restart the server for the new configuration to take effect?
_biff
hi
using sessions is the best way to prevent form hacking?
sessions for validate posts
Literphor
benkai: Im pretty sure you do
monodesigns: I dont believe you can but you can easily test that out
monodesigns
Literphor: yeah, I'm creating a test now.
benkai
Literphor: I guess there is no command to reload the configuration for the system to acknowledge the change.
Literphor
_biff: Sessions are used to have persistent data across multiple requests. It doesnt offer validation or prevent hacking, those are things you still have to do yourself
_biff
literpoor and what is the best way eg. to manipulate hidden fields
if session isnt good enough
Literphor
         

Literphor
_biff: Well&if its client side I would use Javascript to manipulate the hidden field. In PHP, you shoud only care about the data being provided by the hidden field on the form submission.
You validate the data in PHP, not the hidden field
_biff
Literphor thats whyt im asking
but what iif somebody manipulate hiddenf ields
wrong datas would be saved
so what is the best way to prevent this
i would think sessions would be a good way
on validating post, hidden fields data would be compared with the sessions data (preveiosly saved into this the hidden datas)
Literphor
_biff: You can use sessions to keep track of that data. If you already have that data in your session, then why make any hidden fields with it?
damarusama
I have a unix timestamp that I would like to date(DATE_ATOM, mktime(
_biff
because im using az mvc framwork
which would use a security component
damarusama
my unix timestamps comes from
$ical->iCalDateToUnixTimestamp($event['DTEND'])
_biff
but its too complicated
so i would simplifiy this
damarusama
damarusama
I have a unix timestamp that I would like to date(DATE_ATOM, mktime($ical->iCalDateToUnixTimestamp($event['DTEND']))
_biff: how would you simplyfi it?
_biff
sorry:)
so Literphor
:)
i mixed the lines
kirfu
Anyone ever do any work with Oracle Opera PMS?
Literphor
_biff: I dont know anything about az mvc framework, I wouldnt be able to help you much there& but if you already have the data in your sessions, its seems unnecssary and redudant to make hidden fields out of them
_biff: Its probably dangerous, anything thats sensitive enough to be stored in a session shouldnt be rendered in the browser
*session probably shouldn't
_biff
Literphor this mvc works so that hidden fields data will be saved into db...but its not interresting now...im jsut asking what is the best way to prevent hidden fields...
why sessions isnt good for this...or not used for this
i believe it , but i want to know only the reasons
Literphor
_biff: Theres no way to prevent anything client side. Anyone can post whatever data they want to the links you expose publically. Thats why you have to do all the security and validation server side. You cant rely on anythin thats provided by the client
_biff: You assume that your client is always malicious
_biff
Literphor SESSIONs used on serverside isnt?:)
so thats why im asking the sessions...
or sessions stored on serverside...so serverside validation needed offcourse
Literphor
_biff: Yes&but if you already have the data stored in your session theres no reason to make a hidden field with it, just so it can make a round trip
_biff
-f
Literphor thats is not interresting now
this mvc works this way
thats all
i want to prevent this hiddenf ields
dont make it complex:)
im just asking
Literphor
_biff: Ok&then you dont want hidden fields then dont make them
Its really not complicated at all
_biff
except this:)
so there are hiddenf ields:)
that is the starting point
Literphor
_biff: Then use a framework that makes sense to you :)
_biff
(and what if i would use hiddenf ieklds without mvc...thats the same thing)
         

Literphor
_biff: Something that doesnt do things you have no idea why :)
_biff
Literphor....ehhh:)
why do you make it complex:)
its a simlpi question
*simple
Literphor
_biff: Ive given you answer, choose one :)
greyness
How would i get the FIRST half of a string like this "SOMETHINGHERE_CONTEXT=something", i want SOMETHINGHERE
strpos? i think is the function
Sammitch
substr and strpos
something like `substr($string, strpos('_', $string))`
or rather `substr($string, 0, strpos('_', $string))`
and I've also got the arguments to strpos() backwards for good measure
Alphos
!+strtok
php-bot
string strtok([string str,] string token) - Tokenize a string - http://php.net/strtok
Sammitch
Alphos: that way lies madness
Alphos
Sammitch i don't think so
alternatively, there's explode with FAD
monodesigns
Well, apparently I can't do what I wanted without using eval(), so time to rethink.
Sammitch
monodesigns: the most sane thing anyone has ever said.
_biff
so Literphor?
monodesigns
Sammitch: lol
Alphos
monodesigns what are you trying to do ?
Literphor
_biff: Ive told you what I can, maybe someone smarter than I can teach you how to use your framework
monodesigns
Alphos: basically I'm creating a system where people can auto send emails based on different criteria. One of the fields is and/or if they want the criteria to be based on multiple things.
Alphos: so, I was trying to set a variable based on the and/or value and use it in an if statement.
Alphos
based on the and/or value ?
monodesigns
Alphos: OK, the user can choose a lead status and a subject as criteria. They can also choose to send the email when both of these are a set value or whether either one is. So, I have a a field that will be either "and" or "or". So, I was trying to set a variable like if($andor == 'or') {$val = '||';} and use that within an if statement.
sorabji
what's the problem _biff ?
monodesigns
Alphos: if it helps, http://pastebin.com/sC8BGsbY
damarusama
in a foreach loop - is there a way to detec the last loop with a if whitin that loop ?
monodesigns
damarusama: you'll have to use an incrementer.
damarusama
:(
sorabji
damarusama: fwiw, the loop variables will be set to the values of the last iteration
datahumanity
i was using MIRC. I was trying to hide the join / quit messages. I went to tools > options > show join / parts and unselected it but.... it didnt work
did anyone have idea?
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 next »