I have problem with WampServer
Posted by: peor (---.A158.cust.bahnhof.se)
Date: June 30, 2008 03:55PM

I use WampServer.
When I using WampServer php "Your Projects" with these files script:

<?php // file1.php
session_start();
$name = "Per";
session_register("name"winking smiley;
?>

<a href="file2.php">File2</a>

<?php // file2.php
session_start();
echo $name;
?>

When I click File2 don't show my name Per and why it's so.
I'm using Windows XP Home and IE 7.0

Options: ReplyQuote
Re: I have problem with WampServer
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: June 30, 2008 04:57PM

u need a name and a value.. not just a name

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: I have problem with WampServer
Posted by: peor (---.A158.cust.bahnhof.se)
Date: June 30, 2008 05:15PM

okay I don't understand what you mean but can you give me example how I should make that.
I'm beginner within PHP.

Options: ReplyQuote
Re: I have problem with WampServer
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: June 30, 2008 05:34PM

page 1


<?php
session_start();

$_SESSION['name']='PER';

?>



page 2


<?php
session_start();
echo $_SESSION['name'];
?>

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: I have problem with WampServer
Posted by: peor (---.A158.cust.bahnhof.se)
Date: July 01, 2008 04:17PM

The code you showed me works now and thank you very much for the help.
Can you help me solve this code:
------------------------------------------------------------------------
//file1_form.php
<?php
$a = 10;
?>
<form action=file2_form.php method=post>
<input type="hidden" name="a" value=<?php echo $a ?>>
<br>
<input type="submit" value="File 2">
</form>

// file2_form.php
<?php
echo "\$a contains $a";
?>
<br>
<a href="file1_form.php">Back</a>
------------------------------------------------------------------------
//file_1.php
<html>
<body>
<?php
$a = 10;
?>
<a href="file_2.php">Fil 2</a>
</body>
</html>

//file_2.php
<html>
<body>
<?php
echo "\$a innehÄller $a";
?>
<br><a href="file_1.php">Back</a>
</body>
</html>
------------------------------------------------------------------------
These code don't works for me.

Options: ReplyQuote
Re: I have problem with WampServer
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: July 01, 2008 04:33PM

whats the code supposed to do? ur not passing the $a onto the nextpage

ud need
a href="file_2.php?a=10">



and in the other file


$a = $_POST['a'];


to collect it

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: I have problem with WampServer
Posted by: peor (---.A158.cust.bahnhof.se)
Date: July 01, 2008 09:22PM

Thank you very much for quick response.

Options: ReplyQuote


Sorry, only registered users may post in this forum.