php-general Digest 22 Dec 2003 08:54:25 -0000 Issue 2487

Topics (messages 173112 through 173138):

Re: [posibleOT] Forcing entering te site thru index.php
        173112 by: Andreas Magnusson
        173114 by: Eugene Lee

HTTP headers, IE and downloading
        173113 by: Andreas Magnusson
        173135 by: Andreas Korthaus

Magic Quotes
        173115 by: stiano.optonline.net
        173116 by: stiano.optonline.net
        173117 by: stiano.optonline.net
        173118 by: stiano.optonline.net
        173119 by: Andreas Magnusson
        173120 by: John W. Holmes

newbie question about header()
        173121 by: Scott Taylor
        173122 by: Website Managers.net
        173123 by: John W. Holmes
        173126 by: Justin French

Close on exit
        173124 by: David Leon

Fetch Information Via a link
        173125 by: Eric Holmstrom
        173130 by: Jasper Bryant-Greene

Why won't this form post session variables?
        173127 by: Dave G
        173128 by: Martin Towell

Re: Why won't this form post session variables? [SOLVED]
        173129 by: Dave G

Passing or not passing SID in links etc
        173131 by: Gerard Samuel
        173132 by: Jasper Bryant-Greene
        173133 by: Gerard Samuel
        173136 by: Gerard Samuel

serialize and unserialize
        173134 by: webmaster.multiwebmastertools.com

Https
        173137 by: Homer

New member
        173138 by: Kovy

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
> > There are several ways to do this.  The most obvious is with cookies.
> > Set up your index.php to initially create a cookie that authorizes a
> > user to look in the site.  On the rest of your PHP pages, check that
> > this authorization cookie exists.  If not, redirect to index.php.
> Thanks for the response.
> No, this way don't do it: once the cookie is set up in the client's
browser, there is no way for me to prevent the client to type the url
pointing to another page, and the cookie will be valid on that page.
> What i'm trying to do is to force the client to travel pages in the
> order expected, forbidding him/her to access a page out of sequence,
> wich take him to an error message (because, for example, for abscense of
> POST data or something).
> So i'm stuck.
> Thenak you.

You can use the Referer header found in $_SERVER['HTTP_REFERER'] to check
from which page the user comes from.

/Andreas

--- End Message ---
--- Begin Message ---
On Mon, Dec 22, 2003 at 01:09:37AM +0100, Andreas Magnusson wrote:
: 
: You can use the Referer header found in $_SERVER['HTTP_REFERER'] to check
: from which page the user comes from.

Unfortunately, HTTP_REFERER is not guaranteed to exist.  In fact,
several Windoze firewall software actively block this information
from being sent to the web server.

--- End Message ---
--- Begin Message ---
I'm writing a script to view/download an email-attachment. If the file
happens to be an MS Word document and the browser IE (only tried with 6.0),
then the download fails.
If I choose to download (Content-Disposition: attachment;
filename="whatever.doc") then only a part of the file (2/3) is saved to
disk. Of course viewing the file doesn't work either. It doesn't seem to
matter what I set the Content-Type to since IE seems to ignore that anyway,
however I've tried application/msword, application/octet-stream and some
others. I've tried all the things said in the comments to the
header-function in the online-docs at php.net.
I know my Content-Length header is correct and the whole procedure works
great with Netscape 7.0 and if the attachment is a zip-file or a jpeg-image
it also works in both IE and Netscape.

Let's just say I'm stumped and I have googled for a solution for a long time
and would be very happy if someone had one...

Thanks in advance
/Andreas

--- End Message ---
--- Begin Message ---
Hi!

Andreas Magnusson wrote:
> I'm writing a script to view/download an email-attachment. If the file
> happens to be an MS Word document and the browser IE (only tried with
> 6.0), then the download fails.
> If I choose to download (Content-Disposition: attachment;
> filename="whatever.doc") then only a part of the file (2/3) is saved
> to disk. Of course viewing the file doesn't work either. It doesn't
> seem to matter what I set the Content-Type to since IE seems to
> ignore that anyway, however I've tried application/msword,
> application/octet-stream and some others. I've tried all the things
> said in the comments to the header-function in the online-docs at
> php.net.
> I know my Content-Length header is correct and the whole procedure
> works great with Netscape 7.0 and if the attachment is a zip-file or
> a jpeg-image it also works in both IE and Netscape.

Have a look at: http://pear.php.net/package/HTTP_Download

And the first comment of:
http://www.php.net/manual/en/function.session-cache-limiter.php

Perhaps you should not use ouput-compression, and look at the headers
generated by PHP

What headers are sent? Do you use sessions?

you can see this using Mozilla + Live Headers, Ethereal,
http://schroepl.net/cgi-bin/http_trace.pl ...


Regards,
Andreas

--- End Message ---
--- Begin Message ---
I've continued plowing my way thru the 2nd edition
of PHP and MySQL Web Development by Welling and
Thomson. I've made it to chapter 24, where I've just
read that for this chapter's project I "will need to
have switched on magic quotes" or use addslashes()
and stripslashes().

So I checked via phpinfo() and found
magic_quotes_gpc "On", but magic_quotes_runtime and
magic_quotes_sybase both "Off".

Now I'm guessing that magic_quotes_runtime is the
one I need to have on, but is that so? I'm also
guessing that aside from using addslashes() and
stripslashes(), I could prob'ly turn on magic_quotes
in php_ini.

But perhaps because of how I've heard turning
register_globals on via php.ini is a security
hazard, I'm leery of messing with php.ini at all.

Can anyone advise, please?

Thank you.

Steve Tiano 

--- End Message ---
--- Begin Message ---
I've continued plowing my way thru the 2nd edition
of PHP and MySQL Web Development by Welling and
Thomson. I've made it to chapter 24, where I've just
read that for this chapter's project I "will need to
have switched on magic quotes" or use addslashes()
and stripslashes().

So I checked via phpinfo() and found
magic_quotes_gpc "On", but magic_quotes_runtime and
magic_quotes_sybase both "Off".

Now I'm guessing that magic_quotes_runtime is the
one I need to have on, but is that so? I'm also
guessing that aside from using addslashes() and
stripslashes(), I could prob'ly turn on magic_quotes
in php_ini.

But perhaps because of how I've heard turning
register_globals on via php.ini is a security
hazard, I'm leery of messing with php.ini at all.

Can anyone advise, please?

Thank you.

Steve Tiano

--- End Message ---
--- Begin Message ---
Hi. This is the qmail-send program at pb1.pair.com.
I'm afraid I wasn't able to deliver your message to
the following addresses.
This is a permanent error; I've given up. Sorry it
didn't work out.

<[EMAIL PROTECTED]>:
This message is looping: it already has my
Delivered-To line. (#5.4.6)

--- Below this line is a copy of the message.

Return-Path: <[EMAIL PROTECTED]>
Received: (qmail 36829 invoked from network); 22 Dec
2003 01:11:34 -0000
Received: from unknown (HELO dswu83.btconnect.com)
(193.113.154.14)
  by pb1.pair.com with SMTP; 22 Dec 2003 01:11:34 -0000
Received: from gateway.btopenworld.com (actually
host 185.136.40.217.in-addr.arpa) by dswu83 with
SMTP-CUST (XT-PP) with ESMTP; Mon, 22 Dec 2003
01:14:14 +0000
Received: from gateway (127.0.0.1) by
gateway.btopenworld.com (Worldmail 1.3.167) for
[EMAIL PROTECTED]; 22 Dec 2003 01:20:25 +0000
Delivery-Date: Mon, 22 Dec 2003 01:03:13 +0000
Received: from pb1.pair.com (actually host
4.131.92.216.in-addr.arpa) by dswu27 with SMTP
(XT-PP); Mon, 22 Dec 2003 01:03:04 +0000
Received: (qmail 19780 invoked by uid 1010); 22 Dec
2003 01:04:24 -0000
Mailing-List: contact
[EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
list-help: <[EMAIL PROTECTED]>
list-unsubscribe:
<[EMAIL PROTECTED]>
list-post: <[EMAIL PROTECTED]>
Delivered-To: mailing list [EMAIL PROTECTED]
Received: (qmail 19767 invoked by uid 1010); 22 Dec
2003 01:04:24 -0000
Delivered-To: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
Date: Sun, 21 Dec 2003 20:04:15 -0500
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Message-id: <[EMAIL PROTECTED]>
MIME-version: 1.0
X-Mailer: iPlanet Messenger Express 5.2 HotFix 1.16
(built May 14 2003)
Content-type: text/plain; charset=us-ascii
Content-language: en
Content-transfer-encoding: 7BIT
Content-disposition: inline
X-Accept-Language: en
Priority: normal
Subject: [PHP] Magic Quotes

I've continued plowing my way thru the 2nd edition
of PHP and MySQL Web Development by Welling and
Thomson. I've made it to chapter 24, where I've just
read that for this chapter's project I "will need to
have switched on magic quotes" or use addslashes()
and stripslashes().

So I checked via phpinfo() and found
magic_quotes_gpc "On", but magic_quotes_runtime and
magic_quotes_sybase both "Off".

Now I'm guessing that magic_quotes_runtime is the
one I need to have on, but is that so? I'm also
guessing that aside from using addslashes() and
stripslashes(), I could prob'ly turn on magic_quotes
in php_ini.

But perhaps because of how I've heard turning
register_globals on via php.ini is a security
hazard, I'm leery of messing with php.ini at all.

Can anyone advise, please?

Thank you.

Steve Tiano

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
I've continued plowing my way thru the 2nd edition
of PHP and MySQL Web Development by Welling and
Thomson. I've made it to chapter 24, where I've just
read that for this chapter's project I "will need to
have switched on magic quotes" or use addslashes()
and stripslashes().

So I checked via phpinfo() and found
magic_quotes_gpc "On", but magic_quotes_runtime and
magic_quotes_sybase both "Off".

Now I'm guessing that magic_quotes_runtime is the
one I need to have on, but is that so? I'm also
guessing that aside from using addslashes() and
stripslashes(), I could prob'ly turn on magic_quotes
in php_ini.

But perhaps because of how I've heard turning
register_globals on via php.ini is a security
hazard, I'm leery of messing with php.ini at all.

Can anyone advise, please?

Thank you.

Steve Tiano

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .

--- End Message ---
--- Begin Message ---
> Now I'm guessing that magic_quotes_runtime is the
> one I need to have on, but is that so? I'm also
> guessing that aside from using addslashes() and
> stripslashes(), I could prob'ly turn on magic_quotes
> in php_ini.
>
> But perhaps because of how I've heard turning
> register_globals on via php.ini is a security
> hazard, I'm leery of messing with php.ini at all.

Magic Quotes is not a security hazard (quite the opposite) so turning it on
shouldn't be dangerous.
I don't suppose the book tells you why you should always use magic-quotes or
addslashes when
dealing with databases? If you do not use form-data in a database-query you
generally won't need
magic-quotes or addslashes(). I guess that's the reason some of those
magic_quotes_xyz are not
enabled in the php.ini.

It's easy enough to check whether you have the magic quotes you need. Write
a simple form-page
that simply displays what was posted, then post something like: "I'll be
back"
If the page displays: \"I\'ll be back\" then you're safe and don't need to
use addslashes().

/Andreas

--- End Message ---
--- Begin Message --- [EMAIL PROTECTED] wrote:

I've continued plowing my way thru the 2nd edition
of PHP and MySQL Web Development by Welling and
Thomson. I've made it to chapter 24, where I've just
read that for this chapter's project I "will need to
have switched on magic quotes" or use addslashes()
and stripslashes().

So I checked via phpinfo() and found
magic_quotes_gpc "On", but magic_quotes_runtime and
magic_quotes_sybase both "Off".

Now I'm guessing that magic_quotes_runtime is the
one I need to have on, but is that so? I'm also
guessing that aside from using addslashes() and
stripslashes(), I could prob'ly turn on magic_quotes
in php_ini.

The book is talking about magic_quotes_gpc, which you say is already on. The "runtime" version applies to data coming _out_ of the database (which is usually kept off) and "sybase" refers to escaping single quotes with another single quote (instead of the normal backslash). If you're using MySQL, you don't need the "sybase" directive on.




--
---John Holmes...

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

php|architect: The Magazine for PHP Professionals – www.phparch.com




--- End Message ---
--- Begin Message ---

I am simply trying to redirect users from one page to another. Yet when I use this code I get the following error:

*Warning*: Cannot add header information - headers already sent by (output started at /usr/local/psa/home/vhosts/miningstocks.com/httpdocs/etc/php/login/admin/test.php:8) in */usr/local/psa/home/vhosts/miningstocks.com/httpdocs/etc/php/login/admin/test.php* on line *9*
*
*


<html>
<head>
</head>

<body>

<?php
header('Location: http://www.slashdot.org/'); /* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
exit;
?>

</body>
</html>



I know the workaround with the meta tag (<meta http-equiv="REFRESH" content="0; URL=http://www.slashdot.org/";>, but I just don't understand what I am doing wrong here. I'm sure someone here knows....

Thank you in advance,

Scott Taylor
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Unless you're using an 'if' statement, the header redirect must be the first line of 
the page, above any HTML markup.

Jim
www.websitemanagers.net

----- Original Message ----- 
From: "Scott Taylor" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 21, 2003 8:04 PM
Subject: [PHP] newbie question about header()


| 
| 
| I am simply trying to redirect users from one page to another.  Yet when 
| I use this code I get the following error:
| 
| *Warning*: Cannot add header information - headers already sent by 
| (output started at 
| /usr/local/psa/home/vhosts/miningstocks.com/httpdocs/etc/php/login/admin/test.php:8) 
| in 
| */usr/local/psa/home/vhosts/miningstocks.com/httpdocs/etc/php/login/admin/test.php* 
| on line *9*
| *
| *
| 
| <html>
| <head>
| </head>
| 
| <body>
| 
| <?php
| header('Location: http://www.slashdot.org/'); /* Redirect browser */
| 
| /* Make sure that code below does not get executed when we redirect. */
| exit;
| ?>
| 
| </body>
| </html>
| 
| 
| 
| I know the workaround with the meta tag (<meta http-equiv="REFRESH" 
| content="0; URL=http://www.slashdot.org/";>, but I just don't understand 
| what I am doing wrong here.  I'm sure someone here knows....
| 
| Thank you in advance,
| 
| Scott Taylor
| [EMAIL PROTECTED]
| 
| -- 
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, visit: http://www.php.net/unsub.php
| 
|

--- End Message ---
--- Begin Message --- Scott Taylor wrote:



I am simply trying to redirect users from one page to another. Yet when I use this code I get the following error:

*Warning*: Cannot add header information - headers already sent by (output started at /usr/local/psa/home/vhosts/miningstocks.com/httpdocs/etc/php/login/admin/test.php:8) in */usr/local/psa/home/vhosts/miningstocks.com/httpdocs/etc/php/login/admin/test.php* on line *9*
*
*


<html>
<head>
</head>

<body>

<?php
header('Location: http://www.slashdot.org/'); /* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
exit;
?>

You can't have any output before trying to use header(). <html>, etc, are considered output. So, the very first line in your file must be <?php and you can use header() before you echo anything within that PHP block.


--
---John Holmes...

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

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message --- On Monday, December 22, 2003, at 01:13 PM, Website Managers.net wrote:

Unless you're using an 'if' statement, the header redirect must be the first line of the page, above any HTML markup.

That's not entirely accurate.


---Quoted from http://php.net/header ---
Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file.
----------------------------------------


header() doesn't need to be 'the first line of the page', but it does need to be placed above/before any output gets sent to the browser.

bad:
<html>
<? header(...); ?>

bad:
<?
echo "foo";
header(...);
?>

good:
<?
include('something.inc');
session_start();
$foo = 'bah';
header(...);
?>

if there's any code following the redirect (which you don't want to execute), I'd also strongly recommend having an exit; after the header():

<?
include('something.inc');
if($foo)
        {
        header(...);
        exit;
        }
// some other stuff that shouldn't get executed after redirect
?>


Justin French

--- End Message ---
--- Begin Message ---
How can I stop php.exe closing after it performs a task? I am using Windows
XP Pro.

--- End Message ---
--- Begin Message ---
Hi there,

I have this.
Table Name = events
Fields = eventname, date, info. Example

-------------------------------
             EVENTS
-------------------------------
eventname |   date    |  info
------------------------------
event1       |   0202  | info here
------------------------------
event2      |   0303  | info here 2

The problem is that the field "info" has alot of text in it. When I print
this out in an array it makes a huge page due to each event having alot of
information. So im trying to make it so it will display the results like
this.

event1    0202    infomation
event2    0303    infomation

I want the word "infomation" to be hyperlinked, so if you click on it, it
will display the information in the "info" field. The problem is I don't
know how to make a hyperlink that grabs the correct infomation for each
event.

Any help at all will be very grateful for.

Thankyou

Eric Holmstrom

--- End Message ---
--- Begin Message --- Hi Eric

What you need to do is make another PHP page, maybe info.php, which will fetch the info field from the DB and display it.

So for example, assuming the eventname field is unique, you could make the info like something like:

<a href="info.php?eventname=<?=urlencode($eventname)?>">information</a>

And then make info.php fetch the info field from the DB, for example if you were using MySQL:

// page header HTML here
<?
$row = mysql_fetch_assoc(mysql_query("SELECT info FROM table WHERE eventname='{$_GET['eventname']}'"));
$info = $row['info'];
print(nl2br($info));
?>
// page footer HTML here


Obviously you will need to change that to suit your site, and you may want to add some security to the $_GET variable being passed to the MySQL server to prevent attacks. Other than that, hope this helps.

Regards

Jasper Bryant-Greene
Cabbage Promotions
http://fatalnetwork.com/
[EMAIL PROTECTED]


Eric Holmstrom wrote:


Hi there,

I have this.
Table Name = events
Fields = eventname, date, info. Example

-------------------------------
             EVENTS
-------------------------------
eventname |   date    |  info
------------------------------
event1       |   0202  | info here
------------------------------
event2      |   0303  | info here 2

The problem is that the field "info" has alot of text in it. When I print
this out in an array it makes a huge page due to each event having alot of
information. So im trying to make it so it will display the results like
this.

event1    0202    infomation
event2    0303    infomation

I want the word "infomation" to be hyperlinked, so if you click on it, it
will display the information in the "info" field. The problem is I don't
know how to make a hyperlink that grabs the correct infomation for each
event.

Any help at all will be very grateful for.

Thankyou

Eric Holmstrom

--- End Message ---
--- Begin Message ---
PHP Gurus,
        I'm really stuck here. I've written the following code, and it
will never execute the if statement. I keep getting the form displayed,
and when I fill the form and hit the submit button, the
HTTP_SESSION_VARS array does not seem to take any of the values set out
in the form.
        Is there an error in this code? I've checked and double checked,
but I can't see why the variables wouldn't post. Any advice much
appreciated.

session_start();
if(isset($HTTP_SESSION_VARS['episodeTitle']) &&
isset($HTTP_SESSION_VARS['episodePP']))
{
$episodePP=addslashes($HTTP_SESSION_VARS['episodePP']);
$episodeTitle=addslashes($HTTP_SESSION_VARS['episodeTitle']);
db_connect();
$insertPPQuery = "INSERT INTO scripts (title, plotpoints) VALUES (" .
$episodeTitle . ", " . $episodePP . ")";
$insertPPResult = mysql_query($insertPPQuery);
unset ($HTTP_SESSION_VARS['$episodeTitle']);
unset ($HTTP_SESSION_VARS['$episodePP']);
echo 'Your episode, "' . $episodeTitle . '", has been saved. Would you
like to <a href="addplotpoint.php">add another episode</a>?';
}
else
{
echo 'Enter in a new episode in plot point form.<br><br>';
echo '<form action="thispage.php" method="post" name="newPP"><br>';
echo 'Title:<br>';
echo '<input type="text" name="episodeTitle" size="75"><br>';
echo 'Text:<br>';
echo '<textarea name="episodePP" rows="10" cols="55"></textarea><br>';
echo '<input type="submit" name="submitButton" value="Upload">';
echo '</form>';
}

-- 
Yoroshiku!
Dave G
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
I haven't used sessions before, but it doesn't look like the variables are
being put into the session.

If they're coming from a form, then they would appear in the $_POST or
$HTTP_POST_VARS variables, not the $HTTP_SESSION_VARS variable.

HTH
Martin

> -----Original Message-----
> From: Dave G [mailto:[EMAIL PROTECTED]
> Sent: Monday, 22 December 2003 4:34 PM
> To: 'PHP General'
> Subject: [PHP] Why won't this form post session variables?
> 
> 
> PHP Gurus,
>       I'm really stuck here. I've written the following code, and it
> will never execute the if statement. I keep getting the form 
> displayed,
> and when I fill the form and hit the submit button, the
> HTTP_SESSION_VARS array does not seem to take any of the 
> values set out
> in the form.
>       Is there an error in this code? I've checked and double checked,
> but I can't see why the variables wouldn't post. Any advice much
> appreciated.
> 
> session_start();
> if(isset($HTTP_SESSION_VARS['episodeTitle']) &&
> isset($HTTP_SESSION_VARS['episodePP']))
> {
> $episodePP=addslashes($HTTP_SESSION_VARS['episodePP']);
> $episodeTitle=addslashes($HTTP_SESSION_VARS['episodeTitle']);
> db_connect();
> $insertPPQuery = "INSERT INTO scripts (title, plotpoints) VALUES (" .
> $episodeTitle . ", " . $episodePP . ")";
> $insertPPResult = mysql_query($insertPPQuery);
> unset ($HTTP_SESSION_VARS['$episodeTitle']);
> unset ($HTTP_SESSION_VARS['$episodePP']);
> echo 'Your episode, "' . $episodeTitle . '", has been saved. Would you
> like to <a href="addplotpoint.php">add another episode</a>?';
> }
> else
> {
> echo 'Enter in a new episode in plot point form.<br><br>';
> echo '<form action="thispage.php" method="post" name="newPP"><br>';
> echo 'Title:<br>';
> echo '<input type="text" name="episodeTitle" size="75"><br>';
> echo 'Text:<br>';
> echo '<textarea name="episodePP" rows="10" cols="55"></textarea><br>';
> echo '<input type="submit" name="submitButton" value="Upload">';
> echo '</form>';
> }
> 
> -- 
> Yoroshiku!
> Dave G
> [EMAIL PROTECTED]
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> __________ Information from NOD32 1.582 (20031218) __________
> 
> This message was checked by NOD32 for Exchange e-mail monitor.
> http://www.nod32.com
> 
> 
> 
> 

--- End Message ---
--- Begin Message ---
Martin,

> If they're coming from a form, then they would appear in the $_POST or
> $HTTP_POST_VARS variables, not the $HTTP_SESSION_VARS variable.

        Aha! Yes, that was it! Thank you for helping get my script to
work and also giving me that much more insight into session and post
variables. And so quickly, too!
        Much appreciated!

-- 
Yoroshiku!
Dave G
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Im currently modifying templates to include the SID constant, for the few set 
of users who are rejecting session cookies.
If I have an url like ->
<a href="http://www.foo.com/";>Go Home</a>

For users who are rejecting cookies the url looks like ->
<a href="http://www.foo.com/?PHPSISSID=1234";>Go Home</a>

For users who are accepting cookies, the url looks like ->
<a href="http://www.foo.com/?";>Go Home</a>

My question is, are there any known problems with just having '?' at the end 
of urls/links?
Yes, I can do an if/else, but for simple things like this in the templates, 
but it makes it look more like code than html, and I rather stay away from 
it.  The simpler the template the better.

Thanks for your advise.

--- End Message ---
--- Begin Message --- No, that will work fine. Just having ? at the end of the URL just means an empty querystring - same as if you had nothing there.

Regards

Jasper Bryant-Greene
Cabbage Promotions
http://fatalnetwork.com/
[EMAIL PROTECTED]


Gerard Samuel wrote:
Im currently modifying templates to include the SID constant, for the few set of users who are rejecting session cookies.
If I have an url like ->
<a href="http://www.foo.com/";>Go Home</a>


For users who are rejecting cookies the url looks like ->
<a href="http://www.foo.com/?PHPSISSID=1234";>Go Home</a>

For users who are accepting cookies, the url looks like ->
<a href="http://www.foo.com/?";>Go Home</a>

My question is, are there any known problems with just having '?' at the end of urls/links?
Yes, I can do an if/else, but for simple things like this in the templates, but it makes it look more like code than html, and I rather stay away from it. The simpler the template the better.


Thanks for your advise.

--- End Message ---
--- Begin Message ---
On Monday 22 December 2003 01:20 am, Gerard Samuel wrote:
> My question is, are there any known problems with just having '?' at the
> end of urls/links?

Don't worry, I think I figured out another way...

--- End Message ---
--- Begin Message ---
On Monday 22 December 2003 02:14 am, Jasper Bryant-Greene wrote:
> No, that will work fine. Just having ? at the end of the URL just means
> an empty querystring - same as if you had nothing there.
>
> Regards
>

Thanks.  My other idea didn't pan out, so Im going back to this idea.
Back to work for me...

--- End Message ---
--- Begin Message ---


Hello all i need a little help with serialize and unserialize

here is my code
<?php
session_start();
if(!isset($_COOKIE['data'])) {                           //Check to see if cookie is 
there.
include("cookie_num.dat");
$y = "$password";
                                  //Assign a special number for each cookie.
$data = array('x' => 'cart', 'y' => $password);
session_register("y");
$var = serialize($data);
//$chksum = md5($data . md5('secret salt here'));
//$var = serialize(array($data,$chksum));
setcookie('data', $var, time() + 3600);




   } else {

$var = unserialize($_COOKIE['data']);
list($data, $chksum) = $var;
if (md5($data . md5('secret salt here')) == $chksum)
{
   // Data is valid
   $data = unserialize($_COOKIE['data']);
list($y, $chksum) = $data;
   $x = $data['x'];
   $y = $data['y'];
session_register("y");
}
//session_register("y");






}

?>

the problem is when i try to pull it back out to use the number that is generated by 
$password it gives me this error
Notice: unserialize(): Error at offset 9 of 118 bytes in c:\program files\apache 
group\apache\htdocs\header.php on line 24

any ideas towards fixin this would be appreciated


           
           
     


--- End Message ---
--- Begin Message ---
Hello!

I have search for info in this group about this topic and found it but can't
get working my program.

These are the steps I have done:
1º Download and install latest php version (4.3.4)
2º Test that it works (IIS)
3º Change php.ini:
    extension_dir = install_dir/extensions/
    uncomment "extension=php_openssl.dll"
4º Copy from dlls folder to win\system32
    libeay32.dll and ssleay32.dll

The code I'm using is:
$sFinalUrl = https://www.alsa.es/compra/com_csimpleidavuelta.asp;

$handle = fopen($sFinalUrl, "r");

$lExpireDate = fgets($handle);

fclose($handle);

And the errors are

Notice: fopen(): Unable to find the wrapper "https" - did you forget to
enable it when you configured PHP? in
C:\Inetpub\PostNuke-0.726\mpValidar.php on line 62

Warning: fopen(https://www.alsa.es/compra/com_comprasimple.htm): failed to
open stream: Invalid argument in C:\Inetpub\PostNuke-0.726\mpValidar.php on
line 62

Warning: fgets(): supplied argument is not a valid stream resource in
C:\Inetpub\PostNuke-0.726\mpValidar.php on line 63

Warning: fclose(): supplied argument is not a valid stream resource in
C:\Inetpub\PostNuke-0.726\mpValidar.php on line 64

What else must I do? What I'm doing wrong?

Thanks!

--- End Message ---
--- Begin Message ---
Hi!

I'm new here. Where found I listarchive?
Otherwise I'm looking for mailing list develope with php (SMTP or...)

Regards,
Janos from HU

--- End Message ---

Reply via email to