syntax error using header and SID

This is a discussion on syntax error using header and SID within the PHP General forums, part of the PHP Programming Forums category; Hi all Can someone tell me what the correct syntax is to pass a Session ID via the header redirect ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-04-2003
Bob pilly
 
Posts: n/a
Default syntax error using header and SID

Hi all

Can someone tell me what the correct syntax is to pass
a Session ID via the header redirect is? Im trying:

header( "Location: page2.php?<?echo strip_tags
(SID)?>" )
but it isnt working for me and all the docs i can find
just deal with tagging it to the end of a hyperlink.

Any help would be greatly appreciated!



__________________________________________________ ______________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk
Reply With Quote
  #2 (permalink)  
Old 09-04-2003
John W. Holmes
 
Posts: n/a
Default Re: [PHP] syntax error using header and SID

bob pilly wrote:
> Hi all
>
> Can someone tell me what the correct syntax is to pass
> a Session ID via the header redirect is? Im trying:
>
> header( "Location: page2.php?<?echo strip_tags
> (SID)?>" )
> but it isnt working for me and all the docs i can find
> just deal with tagging it to the end of a hyperlink.


header("Location: page2.php?" . SID);

You should use a complete URL, btw, including http:// and the domain name.

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
Reply With Quote
  #3 (permalink)  
Old 09-04-2003
Chris Hayes
 
Posts: n/a
Default Re: [PHP] syntax error using header and SID

At 18:33 4-9-03, you wrote:
>Hi all
>
>Can someone tell me what the correct syntax is to pass
>a Session ID via the header redirect is? Im trying:
>
>header( "Location: page2.php?<?echo strip_tags
>(SID)?>" )


You are making a row of mistakes that suggest it is a good idea to read a
bit on PHP syntax and how variables are passed over pages.

For instance, you are calling a php function such as header(), you are
already inside php tags (<?PHP and ?>), or at least you SHOULD be.
Then, you work with SID, is that a CONSTANT ?

A good place to start is the first chapters of the online php manual on
uk.php.net/manual/en and a tutorial on sessions on
http://www.phpfreaks.com/tutorials/41/0.php
Reply With Quote
  #4 (permalink)  
Old 09-04-2003
Tyler Lane
 
Posts: n/a
Default Re: [PHP] syntax error using header and SID

On Thu, 2003-09-04 at 09:33, bob pilly wrote:
> Hi all
>
> Can someone tell me what the correct syntax is to pass
> a Session ID via the header redirect is? Im trying:
>
> header( "Location: page2.php?<?echo strip_tags
> (SID)?>" )


header( "Location: page2.php?". strip_tags( SID ) );

the problem you are having is that you are already inside php tags when
you are using the header function and don't need to make new php tags to
use the echo statement. and for that matter, you don't need to use the
echo statement at all. just append the SID to the end of the location.

> but it isnt working for me and all the docs i can find
> just deal with tagging it to the end of a hyperlink.
>
> Any help would be greatly appreciated!
>
>
>
> __________________________________________________ ______________________
> Want to chat instantly with your online friends? Get the FREE Yahoo!
> Messenger http://mail.messenger.yahoo.co.uk

--
Tyler Lane <tlane@lyrical.net>
Lyrical Communications

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQA/V3ZfnV+u8RFxEIMRAgg5AJ9+a+ApJyKjO/J/bEVuvu+F7ZYH+QCggsa7
cqvl553cQtupVYJTKUIa8Tw=
=kNeu
-----END PGP SIGNATURE-----

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:56 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0