Jump to content

$_Get with continues pages.


mmarif4u

Recommended Posts

Hi guys.

I have page from where i get the package number and send it to the url.

My url now look like this.

"http://localhost/home/user.php?package=1006"

 

Now in this user.php page the user fill the form , after this he submit the form.

So it go to next page then fill another form there and go to next(last) page.

So what i want is how i set the url to sent and get information rom page.

 

In user.php coding if user fill form he rediected to next page.

I use header fro that.

But how to modify that header to go next page while the info is sn\ent through url

.

header("location:forms/form1.php");

 

I want to do it like this:

header("location:user.php?$_GET['package']&$_GET['pack']");

 

but i am stuck with this.

How could i do this.

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/45686-_get-with-continues-pages/
Share on other sites

Thanks MadTachei for reply.

I try that but now page says it skip the 2nd page and directly go to next page.

 

URl now like this:

"http://localhost/home/forms/childform1.php?1006&"

 

I think it should be:

"http://localhost/home/user.php?package=1006&pack=1002"

OR

"http://localhost/home/forms/form1.php?package=1006&pack=1002"

 

if i want to do it like this then it means that i will code in one page not multiple

pages...

"http://localhost/home/user.php?package=1006&pack=1002"

 

Now i have three different pages which is called by eachother.

 

Ok Let me be more clear:

This is my 1st page:

 

subscribe.php

<?php
session_start();
$package=array('1001','1006','1007');
$package[0]="images/subscribe now.gif";
$package[1]="images/subscribe now.gif";
$package[2]="images/subscribe now.gif";
$_SESSION['1001']=$package[0];
$_SESSION['1006']=$package[1];
$_SESSION['1007']=$package[2];

echo "<table align=\"center\" >";
echo "<tr>";
echo "<td align=\"center\" ><img src=\"images/logo1.jpg\"></img></td>";

echo "</tr>";
echo "<tr>";
echo "<td align=\"center\" ><img src=\"images/home.gif\"></img></td>"; 

echo "</tr>";
echo "</table>";
echo "<table width=\"73.8%\">";
echo "<tr>";
echo "<td width=\"44.5%\"> </td>";
echo "<td align=\"left\" width=\"9.8%\"><a href=\"user.php?package=1001\"><img src=\"{$_SESSION['1001']}\" border=\"0\"></img></a></td>";
echo "<td align=\"left\" width=\"9.8%\"><a href=\"user.php?package=1006\"><img src=\"{$_SESSION['1006']}\" border=\"0\"></img></a></td>"; 
echo "<td align=\"left\" width=\"9.8%\"><a href=\"user.php?package=1007\"><img src=\"{$_SESSION['1007']}\" border=\"0\"></img></a></td>";
echo "</tr>";
echo "</table>";

?>
<html><head><title>Subscribe Now</title></head>
<body >
</body>
</html>

 

this is my 2nd page.

 

user.php

<?php 
ob_start();
session_start();
include("include/db.php");
include("include/common.php");
//include("function.php");
//$ppackage="1002";
//$_SESSION['1002']=$ppackage;
$_GET['package'];
$_SESSION[$_GET['package']];
if($_GET['package'] == 1006){$package='1006';
}
if($_GET['package'] == 1001){$package='1001';
}
if($_GET['package'] == 1007){$package='1007';
}//{echo"$package";}

if (!isset($_POST['submitok'])):
    
    ?>
<!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="styles/style.css" type="text/css">
<Script>
function doubleConfirm()
{
  if (!confirm('R u sure to post the form.')) return false;
  if (!confirm('Please check again the form for errors.')) return false;
  return true;
}
</script>
   <title> New User Registration Form </title>
  <meta http-equiv="Content-Type"
    content="text/html; charset=iso-8859-1>
    
</head>


<body bgcolor="#4572da"><center>
<?php include ("forms/subsform.php")?>
</body>
</html>

    <?php 
   
else:
    
    $dbcnx = dbConnect('db');
     $name=mysql_real_escape_string($_POST['nmanme']);
     $custic=mysql_real_escape_string($_POST['nmic']);
?>
    <?php 
   header("location:user.php?package=".$_GET['package']."&cpackage=".$_GET['1002']);
exit;

endif;

?>

 

This is the 3rd page.

 

childform.php

<?php
ob_start();
session_start();
$_GET['package'];
$_GET['pack'];
$_SESSION[$_GET['pack']];

include('form1.php');?>

 

So how can i set the urls now...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.