473,320 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

reciving post data from form

tolkienarda
316 100+
hi all i am sending data from an html form to an update page but since this is still my first script i don't know this step. i've read some stuff on php.net and echoecho but still can't figure how to get my post data being sent
my form sends:
two textareas
one text input
and two selects

i know i need the $_POST command but how do i get my variables from the new page

thanks for any help
here is the form if you need it
Expand|Select|Wrap|Line Numbers
  1. <form action="update.php" method="post">
  2.     <select>
  3. <?    
  4.     $i=1;
  5.         while ($i<=$row)
  6.         {
  7.             $row2=mysql_fetch_row($result);
  8.             echo '<option value="', $row2[1], '">', $row2[2], '</option>';//outputs the unique login name
  9.             $i++;
  10.         }
  11. ?>
  12.     </select>
  13.  
  14.     <select>
  15. <?
  16.  
  17.         $j=1;
  18.  
  19.         while ($j<=$classrow)
  20.         {
  21.             $row3=mysql_fetch_row($classlst);
  22.             echo '<option value="', $row3[1], '">', $row3[1], '</option>';
  23.             $j++;
  24.         }
  25.  
  26. ?>
  27.     </select>
  28.     <input type="text" maxlength="5" name="grade" id="grade" value="grade">
  29.     <br />
  30.     <textarea name="assignments" rows="15" cols="67" id="assignments">assignments</textarea>
  31.     <br />
  32.     <textarea name="comments" rows="15" cols="67" id="comments">comments</textarea>
  33. <input type="submit">
  34. </form>
  35.  
Jan 17 '07 #1
2 1472
ronverdonk
4,258 Expert 4TB
First: if you want to send the selects to the receiving form, it will do so but you'll have to give the selects a unique name (name="xxx"), because that name will be an entry in the $_POST array. So in your receiving form you get the submitted values e.g.:[php]<?php
if (isset($_POST['grade']))
$grade = "";
$assignments = "";
$comments = "";
$selbox1 = "";
$selbox2 = "";
if (isset($_POST['grade']))
$grade = strip_tags($_POST['grade']);
if (isset($_POST['assigments']))
$assignments = strip_tags($_POST['assignments']);
if (isset($_POST['comments']))
$comments = strip_tags($_POST['comments']);
if (isset($_POST['selbox1']))
$selbox1 = strip_tags($_POST['selbox1']);
if (isset($_POST['selbox2']))
$selbox2 = strip_tags($_POST['selbox2']);

// now your variables are filled with the POST values
// so you can process them now.
[/php]
Ronald :cool:
Jan 17 '07 #2
tolkienarda
316 100+
thanks
eric
Jan 17 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Erik Johnson | last post by:
I am trying to work with a program that is trying make an HTTP POST of text data without any named form parameter. (I don't know - is that a normal thing to do?) I need to write a CGI program that...
15
by: Thomas Scheiderich | last post by:
I am trying to understand Session variables and ran into a question on how they work with data that is passed. I have an HTM file that calls an ASP file and sends the name either by GET or POST....
0
by: Adi Doron | last post by:
Dear Sir,Madam: How can i open multicast channel for: a) Sending Only b) Reciving Only Best Regards to all =================== Adi
2
by: Matt | last post by:
When we submit the form data to another page, we usually do the following: <form action="display.aspx" method="post"> will submit the form data and open display.asp in the current browser ...
1
by: Manuel | last post by:
I have to log into a website and retrieve some information. The problem is that the post isn't "normal". I'm used to passing post values in the form of: Variable1=Value1&Variable2=Value2 etc. I...
2
by: MDANH2002 | last post by:
Hi From VB.NET I want to simulate the POST request of the following HTML form <html> <title>HTTP Post Testing</title> <body> <form action=http://www.example.com/postdata ...
1
by: dannyk | last post by:
hi, I need a solution for displaying and reciving a video stream in a c# application. how can I do it? what should i do?
0
by: abhishekForgotten | last post by:
Looking for some guidance on whether SMPP v3.4 will support greek messages or not ? If not how i can recive/send greek message via smpp v3.4, without decreasing length of msg (160) , I know if i...
1
by: starter08 | last post by:
Hi, I have a C++ routine(client-side) which uploads an xml file to a web server by making a socket connection and sending all the post request through that socket. On the server side I have a cgi...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.