Closed Thread Icon

Topic awaiting preservation: Forms in php (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12704" title="Pages that link to Topic awaiting preservation: Forms in php (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Forms in php <span class="small">(Page 1 of 1)</span>\

 
Trigger
Paranoid (IV) Inmate

From:
Insane since: Jun 2002

posted posted 04-28-2003 22:05

<BLOCKQUOTE><FONT face="Verdana, Arial">quote:</font><HR><?
// Declare Vaiavles
$email = "trig@the-bronze.net";
$subject = "Research Form - 01";
$recepient = "Striker";
// Finsh Declare


function good()
{
mail("$email", "$subject", "$message" , "From: $sender\r\n");
}
//sets the mail function as a good(); function with the relivant info
?>

<form action="<?=$php_self?>" method="post">
<tr>
<td>Name</td>
<td><input type="text" name="name" value="Name"></td>
</tr>
<tr>
<td>>Email</td>
<td><input type="text" name="email" value="Email">
</tr>
<td><textarea value="Your computer skills are?" name="skill"></textarea></td>
<tr>
<td><textarea value="What do you want to learn" name="learn"></textarea></td>
</tr>
</table>
</form>
<?
if($_POST['name'] == ''

Trigger
Paranoid (IV) Inmate

From:
Insane since: Jun 2002

posted posted 04-28-2003 22:17

Before anyone points out, I've just realised I've forgont to check if the form has been subbmitted or not, which may cause an error, but with the check in, it still gives me the same error on that particular bit of code

[This message has been edited by Trigger (edited 04-28-2003).]

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 04-28-2003 22:33

I've run into this problem with double quoted strings using array variables, try this

$message = "Hey $recepient the following informaiton has been sent \n\n Name - ".$_POST['name']."\n\r Email - ".$_POST['email']."\n\r Skills - ".$_POST['skill']."\n\r ".$_POST['learn']."\n\r";

you shouldn't be unescaping the single quotes in there either since it's a double quoted string.


Also the good function shouldn't work, or often won't, you need to either set the variable scope on them before using them( function good() { global $email, $subject, $message ...) or pass them to the function.




.:[ Never resist a perfect moment ]:.

« BackwardsOnwards »

Show Forum Drop Down Menu