Form help with php

General discussions related to php

Moderators: macek, egami, gesf

Post Reply
TheIceman5
New php-forum User
New php-forum User
Posts: 28
Joined: Tue Jan 21, 2003 9:31 pm
Contact:

Post by TheIceman5 » Thu Jan 30, 2003 1:07 am

change it to this, and change page.php to the name of your script. this should work.

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>

<body>

<?php

if($_POST["action"]=="update"){
echo "here";
$db = mysql_connect("localhost", "root");
mysql_select_db("phonelist",$db);
$result = mysql_query("SELECT * FROM main WHERE NAME = '".$_POST["namefield"]."'",$db);
//numfield = mysql_result($result,0,"EXTENSION");
}

?>
<p>&</p>
<form name="form1" action="page.php" method=post>
<p>Last Name <input type="text" name="namefield" size="20"><input type="submit" value="Submit" name="click">
<p>Extension <input type="text" name="numfield" size="17">
<input type="hidden" name="action" value="update"></p>
</form>

</body>

</html>

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Post by Redcircle » Fri Jan 31, 2003 1:25 am

from HueJorgan's example there were no <form> tags.

TheIceman5
New php-forum User
New php-forum User
Posts: 28
Joined: Tue Jan 21, 2003 9:31 pm
Contact:

Post by TheIceman5 » Fri Jan 31, 2003 1:55 am

Redcircle wrote:from HueJorgan's example there were no <form> tags.


meaning??

well im my example there is no 'go' function.

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Post by Redcircle » Fri Jan 31, 2003 2:00 am

no <form> tag meaning your browser does not know how to encode the information you are submitting. If you use Iceman's example it should work granted you output the query result out to the browser.

Post Reply

Who is online

Users browsing this forum: Baidu [Spider], MSNbot Media and 1 guest