Azarian Posted April 4, 2008 Share Posted April 4, 2008 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? Quote Link to comment Share on other sites More sharing options...
Helmet Posted April 4, 2008 Share Posted April 4, 2008 Are you doing this all on the same page instead of redirecting them to the next form using header()? Quote Link to comment Share on other sites More sharing options...
Azarian Posted April 4, 2008 Author Share Posted April 4, 2008 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'; ?> Quote Link to comment Share on other sites More sharing options...
gm04030276 Posted April 4, 2008 Share Posted April 4, 2008 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.