Page 1 of 1

odds and ends

Posted: Sat Apr 26, 2003 4:17 pm
by wallabee
it seems that my program only has two more problems. with the problems, it functions fine, but if i were to eliminate the two problems, i'm considering myself done, and only if i were to eliminate the two problems.

FIRST:
how do you check to see if checkboxes have been checked from a form that's been submitted. say the name of the checkbox is

Code: Select all

<INPUT TYPE=checkbox NAME="checkAdmissions">
, what would be the syntax to make sure it's been checked from the form that takes in the submission? my assumption would be

Code: Select all

if ($_POST['checkAdmissions'] == true)
Is this the correct syntax, and I'm just doing something quirky that's making it not work?

SECOND:
My script writes text to a text file using fwrite. After submitting the text and I check the text file, it seems that all of the apostrophe's have been escaped with a \. When I used fopen to pull the text back into PHP, all the apostrophe's have still been escaped. What's the way around this? I think I remember seeing a command which eliminates all the escape characters. Anyone?


Thanks for all of your help over the past few days guys.

Posted: Sat Apr 26, 2003 4:25 pm
by McGruff
IF (isset($_POST['checkAdmissions']))

and

stripslashes()

Sounds like you maybe don't have the php manual? Recommend you download the version with user comments from php.net.

Posted: Sat Apr 26, 2003 4:43 pm
by wallabee
the aim of the script is to edit text files which a macromedia flash file relies on for some of it's text. that said, stripslashes() seems to only work on incoming strings, which is great if you're looking for stripped slashes in your PHP script, but not so great if you're trying to access the text file with another language/program after it's been written.

that said, is there even a logical way to keep PHP from placing \ before all apostrophes? or am i going to have to find a way in flash to keep them from printing out.

Posted: Sat Apr 26, 2003 6:50 pm
by patrikG
Sounds like you maybe don't have the php manual? Recommend you download the version with user comments from php.net.
You can download the annotated version of the manual? Would love to have that one (only using the standard version atm). Just had a look at php.net and couldn't find a link to that the commented one. Care to post a link?

Posted: Sat Apr 26, 2003 11:05 pm
by McGruff
http://weblabor.hu/php-doc-chm/

Can't remember exactly where I got it but I think that's the one - let me know if not. I could even email it to you if the file isn't too big.

The user notes are very informative so it's worth taking the trouble to track it down.

Posted: Sun Apr 27, 2003 4:46 am
by patrikG
Thanks a lot, mate! Just downloaded it. :)

Posted: Sun Apr 27, 2003 5:07 am
by m3mn0n
was lookin' for that too, thanks. =)