# Passing value to other page

**URL:** <https://forum.kirupa.com/t/passing-value-to-other-page/216590>\
**Category:** Uncategorized\
**Created:** [February 18, 2007, 5:05pm UTC](https://forum.kirupa.com/t/passing-value-to-other-page/216590 "2007-02-18T17:05:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flagbarton](https://avatars.discourse-cdn.com/v4/letter/f/3ec8ea/32.png) [@flagbarton](https://forum.kirupa.com/u/flagbarton)\
**Post date:** [February 18, 2007, 5:05pm UTC](https://forum.kirupa.com/t/passing-value-to-other-page/216590/1 "2007-02-18T17:05:40Z")

</div>

is there another way of passing a variables in another page  
because if im using session it’ll not work because im using session\_register

> 

\<?  
session\_start ();  
$txtuser = $\_POST[‘txtlogin’];  
$txtpass = $\_POST[‘txtuserpass’];

```
mysql_connect ("localhost", "root", "") or die ("could not connect to database");
mysql_select_db ("productdb") or die ("Database does not exist");

```

if ($\_POST[‘submit’]) {

```
$query="SELECT * FROM user where username='$txtuser' and password='$txtpass'";
$result=mysql_query($query);
$ctr=mysql_num_rows($result);

if($ctr&gt;0)
    {
        session_register("txtlogin");
        session_register("txtuserpass");    
        header('Location: page2.php'); exit;
        
    }
else
    {
         
    }
        ob_end_flush();
    }

```

?\>

what i want is to get the value of $txtuser so i can easily execute query and for the other page can u give some suggestion about it? thnx a lot
