00:00
00:00

PHP FORM QUESTION 2001-04-03 21:18:59


I have a question about submitting forms in PHP-

I made a script that has a form, and it lets me write reviews and "Stuff" for my site

then it makes a new file (from a template) and writes what i write in the correct areas.

and it indexes a little link to a .txt file

anyway, the problem is the form

it doesnt let u use HTML (it doesnt work...) and it ignores spaces.

so like when i hit enter on the bbs, it makes a space, when i do it in mine, it ignores it.

and before every "" or '' it makes a as if it were script that i made, but i didnt do that....

how can i fix this???? please tell me!

Response to PHP FORM QUESTION 2001-04-04 04:37:49


At 4/3/01 09:18 PM, Robert_Smith wrote: I have a question about submitting forms in PHP-

I made a script that has a form, and it lets me write reviews and "Stuff" for my site

then it makes a new file (from a template) and writes what i write in the correct areas.

and it indexes a little link to a .txt file

anyway, the problem is the form

it doesnt let u use HTML (it doesnt work...) and it ignores spaces.

so like when i hit enter on the bbs, it makes a space, when i do it in mine, it ignores it.

and before every "" or '' it makes a as if it were script that i made, but i didnt do that....

how can i fix this???? please tell me!

Not quite sure I understand what you mean but I'll give it a go. I think you mean that when you press enter in your form field to put a line break in, the text in your text file has no breaks.

To put breaks in you need the PHP function nl2br(). If your form has an input field called 'text' for example, to convert returns into HTML line breaks you would include a line like:

$text = nl2br($text);

in your PHP script. It took me a while to learn that one but it's pretty simple when you know how.

Your problem with speech marks is similar, just use the stripslashes() function eg:

$text = stripslashes($text);

Hope that helps.

Response to PHP FORM QUESTION 2001-04-06 02:59:17


Response to PHP FORM QUESTION 2001-04-06 04:39:44


At 4/6/01 02:59 AM, SafetyCrew wrote: Here's my php problem:

http://www.severedheads.net/php/index.php

Looking good fella :)

Response to PHP FORM QUESTION 2001-04-06 05:13:48


At 4/6/01 04:39 AM, aladinsane wrote:
At 4/6/01 02:59 AM, SafetyCrew wrote: Here's my php problem:

http://www.severedheads.net/php/index.php
Looking good fella :)

Fatal error: Unable to open /usr/local/zeus/site/php3/index.php in Unknown on line 0

is not my idea of "good"