php help?

  • thomas_sum
  • Beginner
  • Beginner
  • thomas_sum
  • Posts: 44

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • _Leo_
  • Proficient
  • Proficient
  • User avatar
  • Posts: 279
  • Loc: Buenos Aires, Argentina

Post 3+ Months Ago

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
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

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: No registered users and 141 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.