Jump to content

Need to pass a warable along with a link.


Azarian

Recommended Posts

Ok here is the situation.  I have a script where I get a users email address than I test it to make sure it is in my DB.  Basically a poorman's login.  If the email address exists they are allowed to make comments or whatever.  After I get the email address i do what i need to do than I need to kick the user to the next form in line and pass the email address with it.

 

This is how I am trying to do it but I dunno how to pass the $email_address variable with it.  This works in bringing up the next form just with out passing the email address.  So than users have to reenter there email addresses again.

include 'http://www.dom.com/lanparty?page=RSVPUserInfo';

 

If I use this way it all works perfectly except it basically opens in a new page and is no longer part of the parental page that controls it all.  so when you continue from this point in the script it breaks.

include 'rsvp_forms.php';
functionname($email_address);

 

Any suggestions?

 

 

Link to comment
Share on other sites

Are you doing this all on the same page instead of redirecting them to the next form using header()?

 

I don't know what header() is.  Well if you look at the whole site overall it is basically 1 page because everything is include into the main php file.  Instead of my links linking to direct php files they link to functions instead.  Hope my explanation makes sense.

 

Here is the main file the index.php

<?php include 'header.php'; ?>
<?php include 'gameinfo_display.php'; ?>
<?php include 'laninfo_display.php'; ?>
<?php include 'rsvp_forms.php'; ?>

<?php
if ( $_GET['page'] == "LanInfo" ) {
laninfo_display();
}
elseif ( $_GET['page'] == "Games" ) {
gameiso_display();
}
elseif ( $_GET['page'] == "Appz" ) {
appz_display();
}
elseif ( $_GET['page'] == "CD-Keys" ) {
cdkeys_display();
}
elseif ( $_GET['page'] == "KeyGen" ) {
keygen_display();
}
elseif ( $_GET['page'] == "Patch" ) {
patch_display();
}
elseif ( $_GET['page'] == "Cracks" ) {
cracks_display();
}
elseif ( $_GET['page'] == "ConfirmRSVP" ) {
rsvp_email_form_display();
}
elseif ( $_GET['page'] == "RSVPUserInfo" ) {
rsvp_userinfo_form_display($email_address);
}
elseif ( $_GET['page'] == "Drivers" ) {
driver_display();
} else {
include("main.php"); 
}
?>

<?php include 'footer.php'; ?>

Link to comment
Share on other sites

sort of a bad way to do it, all on one page because then the server has to read your whole site worth of files EVERY time the page is loaded, unless they are cached/in memory/whatever...

suggestion if you want to keep it on one page, use a switch statement to include the file you need aswell as run the function so your only including the necessary files!!

as to passing variables, whatever way you make up the url to go to the next page, html link in form? just make it as a php variable first so

<?PHP $link = "normal_address?var1=???&email=".$email_address;

<form action="<?php echo $link; ?>" method="post">...

then it will be accessible via the $_POST['email'] variable in php.

 

...or you could try using php sessions! wonderful things! :D

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.