Page 1 of 1

help forms to php

Posted: Wed Mar 10, 2004 2:46 am
by gamer
iam trying to get information can you help me

my filess

index.html

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<title>ReGiStEr</title>
</head>

<body bgcolor=#090503>
<table>

<tr>
       <td><font face="arial" color="#ffffff" size="-4">nIcK<br><hr>Em@iL<br><HR>RePeAt<br><HR>PaSsWoRd><br><hr>ReApEaT<br><hr><br>
	   </font></td>
       <td><form action="/add.php">
<center>
<input name="username" type="text" value="" height="200"><br>
<input name="email" type="text" value=""><br>
<input name="repem" type="text" value=""><br>
<input name="pw" type="password" value=""><br>
<input name="pwrep" type="password" value=""><br>
<br>
<input type="submit">
</center></td>
</tr>
</table>


</form>
</body>
</html>
add.php

Code: Select all

<?php
print(username);
echo(username);
print(email);
echo(email)
print(repem);
echo(repem)
print(pw);
echo(pw)
print(pwrep);
print("info about php");
phpinfo()
?>
no errors but don't see anything just white screen

:? :?

Posted: Wed Mar 10, 2004 3:08 am
by malcolmboston
on index.html
in your form attributes

Code: Select all

form method="post"
doesnt really matter because i believe it defaults to that but still........

on add.php

use

Code: Select all

print $_POST['email'];
print $_POST['pw'];
// etc etc
hope this helps

Posted: Thu Mar 11, 2004 10:40 am
by gamer
dit that but it still prints nothing i installed apache and php
other php files work but that one not
i tested it with

Code: Select all

<?php
phpinfo()
?>
it works
but when i then erase the phpinfo
and put

Code: Select all

<?php
print("hello anyone");
?>
it doesn't work!!
whats up whats the problem

Posted: Thu Mar 11, 2004 10:48 am
by Shujaa
try

Code: Select all

echo "hello anyone";
instead.

Re: help forms to php

Posted: Thu Mar 11, 2004 11:02 am
by TheBentinel.com
gamer wrote:no errors but don't see anything just white screen
It might be helpful for your debugging if you throw some html into your add.php file. At least you'd see that markup and text, so you'd have proof that your file is executing and being returned to your browser. Something like:

Code: Select all

<html>
<h1>Test - before PHP code</h1>
<?php
  print ("just testing");
?>
<h1>Test - after PHP code</h1>
</html>
If you don't at least get the "before" message, then your problem is likely not related to the PHP code itself.

Posted: Thu Mar 11, 2004 11:55 am
by andre_c
It looks to me like you have some parse errors since you are not putting the semi colon after everyline. Make sure to put semicolons after every line. And it always helps if you turn error reporting on: error_reporting('E_ALL');