help forms to php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gamer
Forum Newbie
Posts: 5
Joined: Wed Mar 10, 2004 2:46 am

help forms to php

Post 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

:? :?
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post 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
gamer
Forum Newbie
Posts: 5
Joined: Wed Mar 10, 2004 2:46 am

Post 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
Shujaa
Forum Newbie
Posts: 13
Joined: Tue Jan 27, 2004 12:14 pm

Post by Shujaa »

try

Code: Select all

echo "hello anyone";
instead.
TheBentinel.com
Forum Contributor
Posts: 282
Joined: Wed Mar 10, 2004 1:52 pm
Location: Columbus, Ohio

Re: help forms to php

Post 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.
User avatar
andre_c
Forum Contributor
Posts: 412
Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah

Post 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');
Post Reply