Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 25th, 2004, 09:34 AM
Authorized User
 
Join Date: Jan 2004
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Ashleek007
Default header location+querystring

header('Location: item.php?='.$itemID);

i want to be able to redirect to a page called item.php and carry with me the value stored in the variable $itemID.

above is what ive tried and it doesnt work!

any ideas?
CHEERS
ASH

__________________
My new web design domain
www.askmultimedia.co.uk
 
Old May 25th, 2004, 09:35 AM
Authorized User
 
Join Date: Jan 2004
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Ashleek007
Default

no worries ive done it

just got rid of the '=' sign!
DUMASS!
 ASH

 
Old May 25th, 2004, 10:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Er, yes. But wouldn't you actually need:

 item.php?=some_get_string_variable_name='.$itemID

(i.e. a variable name _and_ an equals sign, if you're ever going to retrieve the value from the $_GET array)?

In fact, to avoid needless concatenation, you could do:

header("Location: item.php?=some_get_string_variable_name=$itemID");
 
Old May 25th, 2004, 10:17 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Uh, Dan, isn't that an unnecessary equals sign?

Shouldn't this:
header("Location: item.php?=some_get_string_variable_name=$itemID");

Be this:
header("Location: item.php?some_get_string_variable_name=$itemID");

Or am I missing something (again)?

Snib

<><
 
Old May 26th, 2004, 03:37 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, it was unecessary. I don't know where it came from. What I was trying to say, was exactly that second version you posted up. I was trying to say that you need something to assign to, if you're to retrieve the value again from $_GET. Too many equals signs spoil the querystring, however :P.
 
Old February 13th, 2006, 07:33 AM
Registered User
 
Join Date: Feb 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to changusee2k
Default

Hi all,
   I have a small problem on this topic. I'm opening a welcome.php page and it invokes a page called login.php . Once i give the username and password, it has to be reverted back to the welcome.php page. In the login.php, it checks the username and password validation and once it is submitted it has to call the welcome.php page. The code is given here.
<?php
Header("Cache-control: private") ;
Header("Location: ./welcome.php") ;
?>
But unfortunately, It doesn't load the welcome.php page. could someone please advice me as to how to solve this problem.

chandru





Similar Threads
Thread Thread Starter Forum Replies Last Post
using querystring melkin Classic ASP Basics 7 April 1st, 2008 09:07 AM
header("location:./in.php"); [email protected] PHP How-To 0 November 25th, 2006 08:27 AM
Querystring or not? myself Classic ASP Basics 4 July 4th, 2006 09:01 AM
Q. How do I redirect users? (Location Header) richard.york PHP FAQs 0 April 3rd, 2004 07:40 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.