English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Can I do this

$number = 1;
page.php?num=$number

is any thing like this available in php

Thanks

2007-03-25 07:03:58 · 7 answers · asked by bigjoe11a 2 in Computers & Internet Programming & Design

Thanks Braiam, it just that it doesn't seem to work. what I have is a number

page.php?gr=1&photo=2

I need them like this

page.php?gr=$greetnum&photo=$photonum

and then get the Vars back so I can use them is an other page

2007-03-25 09:10:50 · update #1

Jeff, I'm not using Forms. I have to pass 2 numbers from page one to page 5.

2007-03-25 10:24:40 · update #2

UPDATED!

Colin J. sorry thats not. it was all most right. let me try and explain better.

on my first page I have an option to select a image
when the user clicks the image it passes this
page2.php?greeting=1
then when page 3 loads it show that image form page 2. then they have another option to pick a photo or jpg. when the user clicks the photo or image. it sends this on the url
page3.php?photo=1&greeting=$greetnum

I need to change the $greetnum so that the image will load on page 4 and then have both of them I wanted to load on page 5 and page 6 and so.

2007-03-25 14:52:20 · update #3

7 answers

yeah. But when you want to retrieve the variables then you have to use $_GET[' ']. You can find out how to use it here: http://www.w3schools.com/php/php_get.asp

2007-03-25 07:13:06 · answer #1 · answered by Speedy Surfer 1 · 0 0

If you wanna pass strings, you must make the string url-friendly. Use urlencode and after that use urldecode.

$string = "hello world!";
$url_friendly_string = urlencode($string);
$url = "page.php?myString=$url_friendly_string"


If you want to recover the variable in the page requested, to this

$string = urldecode($_GET['myString']);

2007-03-25 08:35:01 · answer #2 · answered by Braiam 2 · 0 0

exchange your very own residing house page configuration report register_globals = Off to register_globals = On now you do no longer exchange your present application. however the very own residing house page 6.0 those valuable properties are bumped off. so whenever you have time, you may exchange your code into new version

2016-10-20 10:24:38 · answer #3 · answered by ? 4 · 0 0

put the variable into a hidden field in your forms, it will pass from page to page.

2007-03-25 08:52:00 · answer #4 · answered by Jeffrey F 6 · 0 0

$i = 0;
if(is_numeric($_GET['num'])) {
echo $_GET['num'];
$i = $_GET['num'];
}
?>

Next Page

I hope you can use my source code, I think this is what you are trying to do.

2007-03-25 13:45:20 · answer #5 · answered by Anonymous · 0 0

yes u can.

2007-03-27 02:30:03 · answer #6 · answered by Atif Majid 3 · 0 0

sure

2007-03-25 07:09:30 · answer #7 · answered by David B 4 · 0 0

fedest.com, questions and answers