getting variables to the function page...?

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
glennn3
Forum Commoner
Posts: 63
Joined: Sat Sep 20, 2003 8:43 pm

getting variables to the function page...?

Post by glennn3 »

i'm having a hard time getting these two variables passed to the formprocess.php page for the mail(); funtion:

Code: Select all

<td width="555" valign="middle"><form action="formprocess.php" method="post">
        <input type="hidden" name="function" value="subscribe"> 
        <table width="532" border="0" cellpadding="0" cellspacing="1">
          <tr>
            <td width="530">
              <br>
              <table width="457" border="0" cellpadding="0" cellspacing="1">
                <tr>
                  <td align="center" class="Georgia146"></td>
                </tr>
              </table>
              <br>
              <table width="533" border="0" cellpadding="0" cellspacing="1">
                <!--DWLayoutTable-->
                <tr>
                  <td width="82" height="22" align="right"><font color="#990000">First Name</font></td>
                  <td colspan="2"><input type="text" name="name" size="40"></td>
                </tr>
                <tr>
                  <td height="22" align="right"><font color="#990000">email</font </td>
                  <td colspan="2"><input name="email" type="text" id="email" size="40"></td>


like so:

Code: Select all

$name=$_POST["name"];
	$email=$_POST["email"];
	$narrative=$_POST["narrative"];
	$nn=$_POST["nn"];
	$ws=$_POST["ws"];
	$fields=array($name,$lastname,$street1,$city,$state,$zip,$country,$username,$password,$email);
	$fieldsverbose=array('name','lastname','street1','city','state','zip','country','username','password','email');
	$error="The following required fields were left blank:<br>";
	
	 mail($email, $subject,$content, "From: Narrative Magazine");
	
	
	if(mysql_query($query))
		setcookie('username', $username, time()+(1800), '/', '', 0);
		print("<script language=\"javascript\">
				top.location=\"105/login.php\";
				</script>");
can someone tell me what i'm doing wrong?

Thanks much,
g
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

"name" and "email" aren't transmitting correctly?

Can they even be echoed directly onto the page?

I don't really see an error in there :?
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

i dont see really whats going on. maybe posting a lil more code might help but if not try echoing out $_POST['email'] and $_POST['name'] at the beginning of the new file and see if they are processing correctly?

EDIT: i obviously dont type fast enough :P
Post Reply