Submitting Script

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
JimmyD
Forum Newbie
Posts: 2
Joined: Thu Jan 27, 2005 9:10 am
Location: Texas

Submitting Script

Post by JimmyD »

Hi i have no Php experience and was wondering if there was a script where a person could submit some information on a form, and it would show up on another page.

Thanks in advance,
Jimmy
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

here's the basic idea

Code: Select all

<?php

if(!empty($_POST))
&#123;
  $postVars = 'Info posted:<br /><pre>'.htmlentities(var_export($_POST,true),ENT_QUTOES).'</pre>';
&#125;
else
&#123;
  $postVars = '';
&#125;

echo <<<STOP
<html>
<head>
<title>your title here</title>
<body>&#123;$postVars&#125;
<form name="Example" action="&#123;$_SERVER&#1111;'SCRIPT_NAME']&#125;" method="post">
Username: <input type="text" name="username" value="Enter your user name here" onfocus="this.value=''" /><br />
Password: <input type="password" name="password" value=" /><br />
Checkboxes: <input type="checkbox" name="checks&#1111;]" value="checkbox1" /> Checkbox 1<br />
<input type="checkbox" name="checks&#1111;]" value="checkbox2" /> Checkbox 2<br />
<input type="checkbox" name="checks&#1111;]" value="checkbox3" /> Checkbox 3<br />
Radios: <input type="radio" name="radios" value="radio1" /> Radio 1<br />
<input type="radio" name="radios" value="radio2" /> Radio 2<br />
<input type="radio" name="radios" value="radio3" /> Radio 3<br />
...<br />
</form></body>
</html>
STOP;
?>
JimmyD
Forum Newbie
Posts: 2
Joined: Thu Jan 27, 2005 9:10 am
Location: Texas

Post by JimmyD »

thanks, but how do i use it. What i'm trying to do is let people submit their phone numbers and i want it to show up in another page.

-Jimmy
Post Reply