php help?

  • thomas_sum
  • Beginner
  • Beginner
  • No Avatar
  • Joined: Aug 20, 2003
  • Posts: 44
  • Status: Offline

Post February 23rd, 2004, 7:23 am

i have created a form which the user can enter either username or userID and clicking on the search button it will display out the result. the problem i have is that how will be the php script going to be like to display out my querry. i really need someone to help :(

below is wat my form looks
Code: [ Select ]
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="get" action="view_record.php">
 <b>Search of Student data </b>
 <p>Student Name
  <input type="text" name="username">
 </p>
 <p>Student ID
  <input type="text" name="userid">
 </p>
 <p>
  <input type="submit" name="Submit" value="Search">
 </p>
</form>
</body>
</html>
  1. <html>
  2. <head>
  3. <title>Untitled Document</title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. </head>
  6. <body bgcolor="#FFFFFF" text="#000000">
  7. <form name="form1" method="get" action="view_record.php">
  8.  <b>Search of Student data </b>
  9.  <p>Student Name
  10.   <input type="text" name="username">
  11.  </p>
  12.  <p>Student ID
  13.   <input type="text" name="userid">
  14.  </p>
  15.  <p>
  16.   <input type="submit" name="Submit" value="Search">
  17.  </p>
  18. </form>
  19. </body>
  20. </html>
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post February 23rd, 2004, 7:23 am

  • _Leo_
  • Proficient
  • Proficient
  • User avatar
  • Joined: Feb 17, 2004
  • Posts: 279
  • Loc: Buenos Aires, Argentina
  • Status: Offline

Post February 23rd, 2004, 8:09 am

Where is your data stored?
How much have of your PHP script is done so far?

If your PHP script is empty, you need to read about PHP scripting. How does the from fields reach a script (read this)

If your data is stored in a MySQL databate, you have a PHP reference for accessing MySQL here.
  • Axe
  • Genius
  • Genius
  • User avatar
  • Joined: Jan 07, 2004
  • Posts: 5744
  • Loc: Sub-level 28
  • Status: Offline

Post February 23rd, 2004, 10:15 am

Well, first I'd probably change the form method to post...

then use $_POST['variable'] to display it...

For example, if your input box is...

<input type="text" name="userid">

...use...

echo $_POST['userid'];

...to display it.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: Kurthead+1, Zealous and 101 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.