php-general Digest 4 Jan 2002 12:25:49 -0000 Issue 1091
Topics (messages 79407 through 79450):
Re: User-friendly URI's
79407 by: Philip Hallstrom
79408 by: Jason Murray
79409 by: Mike Eheler
79410 by: Mike Eheler
79411 by: Philip Hallstrom
79413 by: Philip Hallstrom
79419 by: Jonathan David Edwin Wright
79423 by: Opec Kemp
79426 by: php3.developersdesk.com
Re: An idea for a PHP tool
79412 by: Mike Eheler
79421 by: David Minor
Problem with Printer-friendly script
79414 by: ski-info
79422 by: Miles Thompson
79431 by: Torrent
79432 by: Torrent
Re: how can I add a variable to this sample
79415 by: Tom Beidler
File Upload Question - Previewing .jpgs
79416 by: Anthony Ritter
79420 by: Bogdan Stancescu
Re: More on images...
79417 by: Matthew Walker
Re: Session troubles
79418 by: Sean LeBlanc
Re: Regular Expression
79424 by: [-^-!-%-
Re: Extract a string from a string
79425 by: qartis
session question (4.1.1)
79427 by: Jon Niola
79429 by: David
Re: file uploading => dumping into ram?
79428 by: David
draw image graph with uptime command
79430 by: Daniel Masur
' and " in sql query
79433 by: Daniel Harik
special chars in SQL string
79434 by: Daniel Harik
79435 by: Richard Black
Problem with function declaration in include files
79436 by: Bobby
Re: application variable
79437 by: Tim Ward
Re: File opening, writting and location
79438 by: Tim Ward
"; PHPSESSID" in onfocus field
79439 by: gkin
REMOTE_ADDR in requied files
79440 by: Jan Muzik
79441 by: Intruder
Checking for characters in string
79442 by: Richard Black
79443 by: Intruder
Sending variables between PHP pages
79444 by: Berlina
79445 by: Intruder
79446 by: Intruder
79447 by: Berlina
Problems with uploading even small files
79448 by: Screwy
A compress function?
79449 by: Gaylen Fraley
>From 4.1 to 4.04pl1
79450 by: Julio Nobrega Trabalhando
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 ---
True, but if I remember right, the hit will end up in your error_log not
in your access_log.
-philip
On Fri, 4 Jan 2002, Jason Murray wrote:
> > A 404 ErrorDoc would still reply with a 404 code, which could mess up
> > some search engines.
>
> Not true, try this: www.inww.com/ifdbnifoudbvfd
>
> This is actually produced by "ErrorDocument 404 /404.php3" in our Apache
> configuration, and 404.php3 is a PHP script that sends the neccessary stuff
> to be seen as a 404 to a web browser (thats basically a <TITLE> tag of "404
> Not Found").
>
> You could just as easily subvert 404.php3 to do redirects or include
> other stuff to produce the neccessary pages without sending the 404 bits
> (and we do, we recently moved all our PDF files into a database and use
> 404.php3 to silently redirect to the database-drawn version of the file).
>
> > I was thinking of the .htaccess solution, but I'm not sure if that's
> > possible to force only certain files or perhaps all files in just a
> > certain directory to all be application/x-httpd-php?
>
> I believe you can force a single file. I haven't done it, I'm sure
> someone else around here can. :)
>
> Jason
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--- End Message ---
--- Begin Message ---
> True, but if I remember right, the hit will end up in your
> error_log not in your access_log.
Ah. Bugger.
But since this would require messing with your Apache config
you could adjust that anyway surely?
J
--- End Message ---
--- Begin Message ---
I don't want to mess with the whole site, just a file or 10, or one
directory, etc.
Mike
Jason Murray wrote:
>>True, but if I remember right, the hit will end up in your
>>error_log not in your access_log.
>>
>
> Ah. Bugger.
>
> But since this would require messing with your Apache config
> you could adjust that anyway surely?
>
> J
>
--- End Message ---
--- Begin Message ---
That's the whole point of this thread.. that's what I want to avoid. I
want to have a URI that is easier to remember, and less ugly, and also
provides a sense of security (even if it is only a faint sense) through
obscurity.
Mike
Philip Hallstrom wrote:
> Why not just make the script name "news.php" and not worry about it?
>
> On Thu, 3 Jan 2002, Mike Eheler wrote:
>
>
>>A 404 ErrorDoc would still reply with a 404 code, which could mess up
>>some search engines.
>>
>>I was thinking of the .htaccess solution, but I'm not sure if that's
>>possible to force only certain files or perhaps all files in just a
>>certain directory to all be application/x-httpd-php?
>>
>>I guess that would be the best solution. :)
>>
>>Or would it? What if I have an images/ subfolder.. I certainly wouldn't
>>want all my images being thrown through PHP. That could cause some
>>ugliness. So I guess it would have to be un-doable. Is it?
>>
>>Mike
>>
>>Jason Murray wrote:
>>
>>
>>>>"news" would actually be a PHP script, of course. I know how
>>>>to handle /2002/01/02/keyword as parameters, my question is on
>>>>making "news" be interpreted through PHP.
>>>>
>>>>
>>>Off the top of my head...
>>>
>>>You could either use a .htaccess to force Apache to recognise
>>>"news" as a PHP script, or you could use a Custom 404 page to
>>>figure out what the heck the original URL was trying to get at
>>>and silently substitute in the resulting page.
>>>
>>>A Custom 404 might be easier, but would have a bit more supporting
>>>infrastructure at the code end for a big site.
>>>
>>>Apologies if this is incorrect, I just may not be thinking
>>>too clearly today :)
>>>
>>>Jason
>>>
>>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>>
>>
>
--- End Message ---
--- Begin Message ---
I don't know... not that I know of, but maybe. The one time I did it I
wasn't really interested in the apache logs (the logging all happened in
the db).
I think your best bet is to use news.php, or configure apache to force
"news" to be interpreted by PHP, or use mod_rewrite to rewrite the urls to
some other form.
-philip
On Fri, 4 Jan 2002, Jason Murray wrote:
> > True, but if I remember right, the hit will end up in your
> > error_log not in your access_log.
>
> Ah. Bugger.
>
> But since this would require messing with your Apache config
> you could adjust that anyway surely?
>
> J
>
--- End Message ---
--- Begin Message ---
You could always name the file "news.mike" and then tell apache that .mike
is a PHP extension :)
-philip
On Thu, 3 Jan 2002, Mike Eheler wrote:
> That's the whole point of this thread.. that's what I want to avoid. I
> want to have a URI that is easier to remember, and less ugly, and also
> provides a sense of security (even if it is only a faint sense) through
> obscurity.
>
> Mike
>
> Philip Hallstrom wrote:
>
> > Why not just make the script name "news.php" and not worry about it?
> >
> > On Thu, 3 Jan 2002, Mike Eheler wrote:
> >
> >
> >>A 404 ErrorDoc would still reply with a 404 code, which could mess up
> >>some search engines.
> >>
> >>I was thinking of the .htaccess solution, but I'm not sure if that's
> >>possible to force only certain files or perhaps all files in just a
> >>certain directory to all be application/x-httpd-php?
> >>
> >>I guess that would be the best solution. :)
> >>
> >>Or would it? What if I have an images/ subfolder.. I certainly wouldn't
> >>want all my images being thrown through PHP. That could cause some
> >>ugliness. So I guess it would have to be un-doable. Is it?
> >>
> >>Mike
> >>
> >>Jason Murray wrote:
> >>
> >>
> >>>>"news" would actually be a PHP script, of course. I know how
> >>>>to handle /2002/01/02/keyword as parameters, my question is on
> >>>>making "news" be interpreted through PHP.
> >>>>
> >>>>
> >>>Off the top of my head...
> >>>
> >>>You could either use a .htaccess to force Apache to recognise
> >>>"news" as a PHP script, or you could use a Custom 404 page to
> >>>figure out what the heck the original URL was trying to get at
> >>>and silently substitute in the resulting page.
> >>>
> >>>A Custom 404 might be easier, but would have a bit more supporting
> >>>infrastructure at the code end for a big site.
> >>>
> >>>Apologies if this is incorrect, I just may not be thinking
> >>>too clearly today :)
> >>>
> >>>Jason
> >>>
> >>>
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--- End Message ---
--- Begin Message ---
It's actually alot easier that you think!
for the news file, just create a file called 'news' (minus ' of course! ;)
in your http root, then create (or append) a .htaccess with the following
lines:
<Files news>
ForceType application/x-httpd-php
</Files>
That tells Apache to parse news via PHP. As what you've passed (ie
/2002/01/02/keyword) is not a query string, you won't find it in
$_SERVER{'QUERY_STRING'}. Instead, its put into $_SERVER{'PATH_INFO'}. It's
then up to you to do what you want with it! :)
Works for me! :)
Hope that helps! :)
At 16:00 03.01.2002 -0800, Mike Eheler wrote:
>http://www.somesite.com/news/2002/01/02/keyword
>
>I've seen some sites do this with other scripting languages (maybe even
>PHP.. I just don't know).. I like the look of this *way* better. Anyone
>have any insight as to how I can make that work with an Apache 1.3.xx +
>PHP 4.1.x setup?
>
>"news" would actually be a PHP script, of course. I know how to handle
>/2002/01/02/keyword as parameters, my question is on making "news" be
>interpreted through PHP.
>
>Mike
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
// Jonathan Wright
// [EMAIL PROTECTED]
// GCS d- s: a-- C++(+) US> P+++ L+> E> W+++ !N w !O M- V- PS+@ PE+
// Y PGP t+ !5 X R- tv(-) b(+) DI++++> D+(++) G h-- r-- z--(++)
--- End Message ---
--- Begin Message ---
You will need to use the following techniques:
* In Apache you will need to enable mod_rewrite module
http://httpd.apache.org/docs/mod/mod_rewrite.html
this allows you to "remap" URI to any script, in your case you'd probably
want and request to "/news" to be mapped to for example /news.php etc.
* In your script you will need to parse the URI via the "REQUEST_URI" server
variable.
Basically what you're doing in your apache is saying: "Pass all requests to
the URI to this instead" note that this will not affect the URL display in
your browser.
This is similar technique to making search engines index your site. I've
written replies to this subject a while back check it out here:
(Note that apparently my code in this post has some problem so..)
http://aspn.activestate.com/ASPN/Mail/Message/php-Users/373430
OR a better example here:
Building Dynamic Pages With Search Engines in Mind
http://www.phpbuilder.com/columns/tim19990117.php3
Revisited: Build Dynamic Pages With Search Engines in Mind
http://www.phpbuilder.com/columns/tim20000526.php3
HTH
> -----Original Message-----
> From: Mike Eheler [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 4 January 2002 10:01 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] User-friendly URI's
>
>
> http://www.somesite.com/news/2002/01/02/keyword
>
> I've seen some sites do this with other scripting languages (maybe even
> PHP.. I just don't know).. I like the look of this *way* better. Anyone
> have any insight as to how I can make that work with an Apache 1.3.xx +
> PHP 4.1.x setup?
>
> "news" would actually be a PHP script, of course. I know how to handle
> /2002/01/02/keyword as parameters, my question is on making "news" be
> interpreted through PHP.
--- End Message ---
--- Begin Message ---
Addressed to: Mike Eheler <[EMAIL PROTECTED]>
[EMAIL PROTECTED]
** Reply to note from Mike Eheler <[EMAIL PROTECTED]> Thu, 03 Jan 2002 16:26:53
-0800
>
> That's the whole point of this thread.. that's what I want to avoid. I
> want to have a URI that is easier to remember, and less ugly, and also
> provides a sense of security (even if it is only a faint sense) through
> obscurity.
The .htaccess/httpd.conf solution is:
<Location /news>
ForceType application/X-httpd-php
</Location>
Now the file news in your DocumentRoot directory will be executed as a
php program, and anything that appears as directory and file names
after it will appear in $PATH_INFO. (I think that's where it appears
anyway. Check phpinfo() to be sure.)
It works very well.
Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com
--- End Message ---
--- Begin Message ---
Through suggestions of people here is the code I produced for a bookmark:
javascript:void(srch=prompt('Function Name?',''));if(srch)
{self.location.href='http://download.php.net/search.php?pattern=' +srch+
'&show=quickref';};
Of course that should all go on one line. That is a good hack for now,
but I still think it would be great to have the PHP site's search bar
kind of in my browser, and it would launch a new window or whatever
(with the drop-down to select function ref/online manual/etc)
Mike
Jason Murray wrote:
>>Like google has it's toolbar, why not have a PHP Manual toolbar? That
>>would be *great*. Just type in the function name and hit "go" and the
>>manual comes up.
>>
>
> You could probably work a bit of javascript magic in a bookmark to
> do the same thing.
>
> I've seen bookmarks that pop up a javascript input window and then
> use the input in the resulting URL. So, take the manual query via
> javascript input and then append it to the www.php.net url.
>
> At least, I *think* I have :)
>
> J
>
--- End Message ---
--- Begin Message ---
It's also worth noting here that typing a keyword (or maybe it's just
function names?) in place of a directory after www.php.net does the same
thing. ie, 'www.php.net/extract' takes you to the extract page in the
manual.
HTH,
dm
Mike Eheler wrote:
>Through suggestions of people here is the code I produced for a bookmark:
>
>javascript:void(srch=prompt('Function Name?',''));if(srch)
>{self.location.href='http://download.php.net/search.php?pattern=' +srch+
>'&show=quickref';};
>
>Of course that should all go on one line. That is a good hack for now,
>but I still think it would be great to have the PHP site's search bar
>kind of in my browser, and it would launch a new window or whatever
>(with the drop-down to select function ref/online manual/etc)
>
>Mike
>
--- End Message ---
--- Begin Message ---
I am in the process of producing a script which will allow me to produce
printer-friendly versions of my dynamically produced web pages.
For the most part it is working but take a look here...
www.ski-info-online.com/skiResort-print1.php?id=Alpbach
If you click the "Print Review" button it all seems to work fine, except
1) it's slow and...
2) do you see those numbers c3 fd6 and 52 59c (may take a few seconds)?
Where on Earth did they come from? They are not in the html (as you would
also see them on the main review page). They also appear to be the cause of
the
script running slow.
Here is my php code.
PHP:------------------------------------------------------------------------
--------
<?
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modifieed: ". gmdate("D, d M Y H:i:s"). " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Cache-Control: post-check=0,pre-check=0");
header("Cache-Control: max-age=0");
header("Pragma: no-cache");
if ($HTTP_REFERER){
$myURL = $HTTP_REFERER;
} else {
$myURL = "http://www.ski-info-online.com/";
}
$START_CONT="<!-- CONTENT STARTS -->";
$END_CONT = "<!-- CONTENT ENDS -->";
$parsed_url = parse_url($myURL);
$myServer = $parsed_url['host'];
$document = $parsed_url['path'];
$query = $parsed_url['query'];
if($document[strlen($document)-1]=='/'){
$document = "$document/index.php";
$base_url = dirname($document);
}
$fp=fsockopen($myServer,80,&$errno,&$errstr,30);
$request = "GET $document"."?"."$query"." HTTP/1.1\r\n";
$request .= "Host: $myServer\r\n\r\n";
if(!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs($fp,$request);
$content=0;
$in_title=0;
?>
<HTML>
<HEAD>
<BASE HREF="<? echo "http://$myServer$base_url/"; ?>">
<link rel="stylesheet" href="printable.css">
<?
while(!feof($fp)) {
$line=fgets($fp,4096);
if(ereg($START_CONT,$line)) {
$content=1;
}
if(ereg($END_CONT,$line)) $content=0;
if($content==1)echo $line;
}
fclose($fp);
?>
<HR>
<CENTER>
<SMALL>Copyright © <U>Ski-Info-Online.com</U>. All rights
reserved.</SMALL><BR>
<?echo "<A HREF=\"$myURL\"><SMALL><I>$myURL</I></SMALL></A>\n";?>
</CENTER>
</BODY>
</HTML>
<?
}
?>
----------------------------------------------------------------------------
----
Any help greatly appreciated.
Torrent
--- End Message ---
--- Begin Message ---
It's reasonably fast in Internet Explorer, and didn't complete in Netscape 4.7.
The characters I saw were similar to yours, except that I saw fd0 (the
floppy!?) instead of fd6.
Could they be artifacts in the data stream?
Does the initial page,
www.ski-info-online.com/skiResort-print1.php?id=Alpbach fetch data from a
database? from a flat file?
What happens if you fetch the default length of 1k?
Miles Thompson
At 12:30 AM 1/4/2002 +0000, ski-info wrote:
>I am in the process of producing a script which will allow me to produce
>printer-friendly versions of my dynamically produced web pages.
>
>For the most part it is working but take a look here...
>
>www.ski-info-online.com/skiResort-print1.php?id=Alpbach
>
>If you click the "Print Review" button it all seems to work fine, except
>1) it's slow and...
>2) do you see those numbers c3 fd6 and 52 59c (may take a few seconds)?
>
>Where on Earth did they come from? They are not in the html (as you would
>also see them on the main review page). They also appear to be the cause of
>the
>script running slow.
>
>Here is my php code.
>
>PHP:------------------------------------------------------------------------
>--------
>
><?
>header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
>header("Last-Modifieed: ". gmdate("D, d M Y H:i:s"). " GMT");
>header("Cache-Control: no-cache, must-revalidate");
>header("Cache-Control: post-check=0,pre-check=0");
>header("Cache-Control: max-age=0");
>header("Pragma: no-cache");
>
>if ($HTTP_REFERER){
> $myURL = $HTTP_REFERER;
>} else {
> $myURL = "http://www.ski-info-online.com/";
>}
>
>$START_CONT="<!-- CONTENT STARTS -->";
>$END_CONT = "<!-- CONTENT ENDS -->";
>
>$parsed_url = parse_url($myURL);
>$myServer = $parsed_url['host'];
>$document = $parsed_url['path'];
>$query = $parsed_url['query'];
>
>if($document[strlen($document)-1]=='/'){
> $document = "$document/index.php";
> $base_url = dirname($document);
>}
>
>$fp=fsockopen($myServer,80,&$errno,&$errstr,30);
>
>$request = "GET $document"."?"."$query"." HTTP/1.1\r\n";
>$request .= "Host: $myServer\r\n\r\n";
>
>if(!$fp) {
> echo "$errstr ($errno)<br>\n";
>} else {
> fputs($fp,$request);
> $content=0;
> $in_title=0;
>?>
><? while(!feof($fp)) { $line=fgets($fp,4096); if(ereg($START_CONT,$line))
>{ $content=1; } if(ereg($END_CONT,$line)) $content=0; if($content==1)echo
>$line; } fclose($fp); ?>
>
>----------
>Copyright © Ski-Info-Online.com. All rights reserved.
><?echo "$myURL\n";?>
>
><?
>}
>?>
>
>----------------------------------------------------------------------------
>----
>
>
>Any help greatly appreciated.
>
>Torrent
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Oh, btw, the data is extracted from a MySQL database.
How do you see that affecting the problem?
Tx
Torrent
www.ski-info-online.com
-----Original Message-----
From: Miles Thompson [mailto:[EMAIL PROTECTED]]
Sent: 04 January 2002 01:30
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Problem with Printer-friendly script
It's reasonably fast in Internet Explorer, and didn't complete in Netscape
4.7.
The characters I saw were similar to yours, except that I saw fd0 (the
floppy!?) instead of fd6.
Could they be artifacts in the data stream?
Does the initial page,
www.ski-info-online.com/skiResort-print1.php?id=Alpbach fetch data from a
database? from a flat file?
What happens if you fetch the default length of 1k?
Miles Thompson
At 12:30 AM 1/4/2002 +0000, ski-info wrote:
>I am in the process of producing a script which will allow me to produce
>printer-friendly versions of my dynamically produced web pages.
>
>For the most part it is working but take a look here...
>
>www.ski-info-online.com/skiResort-print1.php?id=Alpbach
>
>If you click the "Print Review" button it all seems to work fine, except
>1) it's slow and...
>2) do you see those numbers c3 fd6 and 52 59c (may take a few seconds)?
>
>Where on Earth did they come from? They are not in the html (as you would
>also see them on the main review page). They also appear to be the cause of
>the
>script running slow.
>
>Here is my php code.
>
>PHP:-----------------------------------------------------------------------
-
>--------
>
><?
>header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
>header("Last-Modifieed: ". gmdate("D, d M Y H:i:s"). " GMT");
>header("Cache-Control: no-cache, must-revalidate");
>header("Cache-Control: post-check=0,pre-check=0");
>header("Cache-Control: max-age=0");
>header("Pragma: no-cache");
>
>if ($HTTP_REFERER){
> $myURL = $HTTP_REFERER;
>} else {
> $myURL = "http://www.ski-info-online.com/";
>}
>
>$START_CONT="<!-- CONTENT STARTS -->";
>$END_CONT = "<!-- CONTENT ENDS -->";
>
>$parsed_url = parse_url($myURL);
>$myServer = $parsed_url['host'];
>$document = $parsed_url['path'];
>$query = $parsed_url['query'];
>
>if($document[strlen($document)-1]=='/'){
> $document = "$document/index.php";
> $base_url = dirname($document);
>}
>
>$fp=fsockopen($myServer,80,&$errno,&$errstr,30);
>
>$request = "GET $document"."?"."$query"." HTTP/1.1\r\n";
>$request .= "Host: $myServer\r\n\r\n";
>
>if(!$fp) {
> echo "$errstr ($errno)<br>\n";
>} else {
> fputs($fp,$request);
> $content=0;
> $in_title=0;
>?>
><? while(!feof($fp)) { $line=fgets($fp,4096); if(ereg($START_CONT,$line))
>{ $content=1; } if(ereg($END_CONT,$line)) $content=0; if($content==1)echo
>$line; } fclose($fp); ?>
>
>----------
>Copyright © Ski-Info-Online.com. All rights reserved.
><?echo "$myURL\n";?>
>
><?
>}
>?>
>
>---------------------------------------------------------------------------
-
>----
>
>
>Any help greatly appreciated.
>
>Torrent
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Thanks Miles,
I think you are right regarding them being artifacts in the data stream. I
have been searching the Net for similar problems but there is surprisingly
little around for fsockopen(), even php.net's manul page doesn't have any
notes contributed by any users.
I will certainly try the the default of 1K and see what I get.
Thanks again,
Torrent
www.ski-info-online.com
-----Original Message-----
From: Miles Thompson [mailto:[EMAIL PROTECTED]]
Sent: 04 January 2002 01:30
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Problem with Printer-friendly script
It's reasonably fast in Internet Explorer, and didn't complete in Netscape
4.7.
The characters I saw were similar to yours, except that I saw fd0 (the
floppy!?) instead of fd6.
Could they be artifacts in the data stream?
Does the initial page,
www.ski-info-online.com/skiResort-print1.php?id=Alpbach fetch data from a
database? from a flat file?
What happens if you fetch the default length of 1k?
Miles Thompson
At 12:30 AM 1/4/2002 +0000, ski-info wrote:
>I am in the process of producing a script which will allow me to produce
>printer-friendly versions of my dynamically produced web pages.
>
>For the most part it is working but take a look here...
>
>www.ski-info-online.com/skiResort-print1.php?id=Alpbach
>
>If you click the "Print Review" button it all seems to work fine, except
>1) it's slow and...
>2) do you see those numbers c3 fd6 and 52 59c (may take a few seconds)?
>
>Where on Earth did they come from? They are not in the html (as you would
>also see them on the main review page). They also appear to be the cause of
>the
>script running slow.
>
>Here is my php code.
>
>PHP:-----------------------------------------------------------------------
-
>--------
>
><?
>header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
>header("Last-Modifieed: ". gmdate("D, d M Y H:i:s"). " GMT");
>header("Cache-Control: no-cache, must-revalidate");
>header("Cache-Control: post-check=0,pre-check=0");
>header("Cache-Control: max-age=0");
>header("Pragma: no-cache");
>
>if ($HTTP_REFERER){
> $myURL = $HTTP_REFERER;
>} else {
> $myURL = "http://www.ski-info-online.com/";
>}
>
>$START_CONT="<!-- CONTENT STARTS -->";
>$END_CONT = "<!-- CONTENT ENDS -->";
>
>$parsed_url = parse_url($myURL);
>$myServer = $parsed_url['host'];
>$document = $parsed_url['path'];
>$query = $parsed_url['query'];
>
>if($document[strlen($document)-1]=='/'){
> $document = "$document/index.php";
> $base_url = dirname($document);
>}
>
>$fp=fsockopen($myServer,80,&$errno,&$errstr,30);
>
>$request = "GET $document"."?"."$query"." HTTP/1.1\r\n";
>$request .= "Host: $myServer\r\n\r\n";
>
>if(!$fp) {
> echo "$errstr ($errno)<br>\n";
>} else {
> fputs($fp,$request);
> $content=0;
> $in_title=0;
>?>
><? while(!feof($fp)) { $line=fgets($fp,4096); if(ereg($START_CONT,$line))
>{ $content=1; } if(ereg($END_CONT,$line)) $content=0; if($content==1)echo
>$line; } fclose($fp); ?>
>
>----------
>Copyright © Ski-Info-Online.com. All rights reserved.
><?echo "$myURL\n";?>
>
><?
>}
>?>
>
>---------------------------------------------------------------------------
-
>----
>
>
>Any help greatly appreciated.
>
>Torrent
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
No more callers. We have a winner!
Thanks to all for your input!
> From: "Geo" <[EMAIL PROTECTED]>
> Date: Fri, 4 Jan 2002 02:27:45 +0200
> To: "Tom Beidler" <[EMAIL PROTECTED]>
> Subject: Re: how can I add a variable to this sample
>
> $x[$key.'service_type'];. please tell me if it works.
>
>
> Best regards,
> George Nicolae
> IT Manager
> ___________________
> X-Playin - Professional Web Design
> www.x-playin.f2s.com
>
>
>
> ----- Original Message -----
> From: "Tom Beidler" <[EMAIL PROTECTED]>
> Newsgroups: php.general
> Cc: "php list" <[EMAIL PROTECTED]>
> Sent: Friday, January 04, 2002 2:00 AM
> Subject: Re: how can I add a variable to this sample
>
>
>>
>>
>> So far nothing seems to work which leads me to believe there's something
>> else wrong.
>>
>> Here's what I've tried
>>
>> $service_type_insert = $x['926service_type']; //works fine when I hard
> code
>> a value in and returns proper value
>>
>> $service_type_insert = $x[$$keyservice_type]; //returns empty even though
> I
>> know a value is there
>>
>> $service_type_insert = $x['${key}service_type']; //returns empty even
>> though I know a value is there
>>
>> $service_type_insert = eval($x['$keyservice_type']); //returns empty even
>> though I know a value is there. I added single quotes because without it
>> returned a parse error.
>>
>
--- End Message ---
--- Begin Message ---
To all,
The following is a file upload question using PHP.
I am able to upload a file to my server with the following script. (see
below)
It's in two parts - the first is a html form and the second is the php
script which takes the variable $img1_name.
However, I'd like to check if, in fact, the file was uploaded to the server.
The only way I can check this is to copy and paste the pathname that I
upoloaded in the browser's window like:
c:/Program Files/Apache Group/Apache/htdocs/reservoirphoto.jpg
When I do that the photo does load - however it loads in a paint program I
use like PaintShopPro - not as a file within the browser.
The question is this...in the textbook I'm reading (Julie Meloni - PHP Fast
and Easy - page 174), it says that:
"(I can) use the File / Open Page / menu item in your web browser to
navigate through your filesystem and find the file you uploaded."
The screenshot in the book has the .jpg file photo *within* the browser
screen - not by itself in a paint program.
Can anybody assist me in this?
Thanking all in advance.
Tony Ritter
............................................................................
..........................
file://Script 1 - upload_form.html
<HTML>
<HEAD>
<TITLE>Upload a File</TITLE>
</HEAD>
<BODY>
<H1>Upload a File</H1>
<FORM METHOD="post" ACTION="do_upload.php" ENCTYPE="multipart/form-data">
<p><strong>File to Upload:</strong><br>
<INPUT TYPE="file" NAME="img1" SIZE="30"></p>
<P><INPUT TYPE="submit" NAME="submit" VALUE="Upload File"></p>
</FORM>
</BODY>
</HTML>
...................................
file://Script 2 - do_upload.php
<?
if ($img1_name != "")
{
copy("$img1", "c:/Program Files/Apache Group/Apache/htdocs/$img1_name") or
die("Couldn't copy the file.");
}
else
{
die("No input file specified");
}
?>
<HTML>
<HEAD>
<TITLE>Successful File Upload</TITLE>
</HEAD>
<BODY>
<H1>Success!</H1>
<P>You sent: <? echo "$img1_name"; ?>, a <? echo "$img1_size"; ?>
byte file with a mime type of <? echo "$img1_type"; ?>.</P>
</BODY>
</HTML>
........................
--- End Message ---
--- Begin Message ---
That's a browser/image type issue. If you're trying it with a JPEG image (as the
message title suggests) then it's a browser issue -- your browser doesn't handle
JPEG files due to local settings, and starts up the paint program instead. If
you're trying with some other image type (such as TIFF for instance) then this
is normal behaviour, because browsers don't generally understand other formats
than GIF, JPEG and maybe BMP and PNG, depending on the browser.
Since you seem to be using a JPEG image after all, you should check your
browser's file associations (I don't know what's the browser you're using) and
remove the association with the paint program for JPEG's.
Bogdan
Anthony Ritter wrote:
> To all,
> The following is a file upload question using PHP.
>
> I am able to upload a file to my server with the following script. (see
> below)
>
> It's in two parts - the first is a html form and the second is the php
> script which takes the variable $img1_name.
>
> However, I'd like to check if, in fact, the file was uploaded to the server.
>
> The only way I can check this is to copy and paste the pathname that I
> upoloaded in the browser's window like:
>
> c:/Program Files/Apache Group/Apache/htdocs/reservoirphoto.jpg
>
> When I do that the photo does load - however it loads in a paint program I
> use like PaintShopPro - not as a file within the browser.
>
> The question is this...in the textbook I'm reading (Julie Meloni - PHP Fast
> and Easy - page 174), it says that:
>
> "(I can) use the File / Open Page / menu item in your web browser to
> navigate through your filesystem and find the file you uploaded."
>
> The screenshot in the book has the .jpg file photo *within* the browser
> screen - not by itself in a paint program.
>
> Can anybody assist me in this?
>
> Thanking all in advance.
> Tony Ritter
> ............................................................................
> ..........................
>
> file://Script 1 - upload_form.html
>
> <HTML>
> <HEAD>
> <TITLE>Upload a File</TITLE>
> </HEAD>
> <BODY>
>
> <H1>Upload a File</H1>
>
> <FORM METHOD="post" ACTION="do_upload.php" ENCTYPE="multipart/form-data">
>
> <p><strong>File to Upload:</strong><br>
> <INPUT TYPE="file" NAME="img1" SIZE="30"></p>
>
> <P><INPUT TYPE="submit" NAME="submit" VALUE="Upload File"></p>
>
> </FORM>
>
> </BODY>
> </HTML>
>
> ...................................
> file://Script 2 - do_upload.php
>
> <?
> if ($img1_name != "")
> {
> copy("$img1", "c:/Program Files/Apache Group/Apache/htdocs/$img1_name") or
> die("Couldn't copy the file.");
> }
> else
> {
> die("No input file specified");
> }
> ?>
>
> <HTML>
> <HEAD>
> <TITLE>Successful File Upload</TITLE>
> </HEAD>
> <BODY>
>
> <H1>Success!</H1>
>
> <P>You sent: <? echo "$img1_name"; ?>, a <? echo "$img1_size"; ?>
> byte file with a mime type of <? echo "$img1_type"; ?>.</P>
>
> </BODY>
> </HTML>
> ........................
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I solved it using Javascript to get the referrer of the parent doc, and
pass it as a get request.
Matthew Walker
Ecommerce Project Manager
Mountain Top Herbs
-----Original Message-----
From: Matthew Walker
Sent: Thursday, January 03, 2002 3:46 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] More on images...
Buh. That's the problem. There's no assurance that in will be used from
a PHP script, so I can't do that. Mrrr.
Let me explain what I'm doing, and someone can pipe up if they have a
better idea.
I'm writing a tracking module for a shopping cart system, so that we can
track where people came to our site from, and correlate that information
with whether or not they ordered. Right now, I'm trying to do this with
a php script in an image tag, so that I can set the cookies I need.
However, I need to be able to get the referrer from the page that is
calling the image, and I can't assume it's php. Any advice?
Matthew Walker
Ecommerce Project Manager
Mountain Top Herbs
-----Original Message-----
From: Billy Harvey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 03, 2002 3:25 PM
To: Matthew Walker
Subject: Re: [PHP] More on images...
On Thu, 2002-01-03 at 16:51, Matthew Walker wrote:
> Related to my last question about the cookies in images, is there any
> way to get the referrer from the calling page without passing it as an
> argument to the image generation script?
>
> Matthew Walker
> Ecommerce Project Manager
> Mountain Top Herbs
Matthew, you're going to have to save it as a variable somewhere to be
able to retrieve it. If you have session management then you could just
register the variable and it would exist on the next page.
Billy
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 1/2/2002
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 1/2/2002
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 1/2/2002
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 1/2/2002
--- End Message ---
--- Begin Message ---
On 01-02 16:06, Jaime Bozza wrote:
> Returning false is invalid for the session read function, and has caused
> *MANY* issues with PHP and Sessions. (Check the archives as well as the
> bugs database. I have a couple in there myself)
>
> Change:
> return false;
>
> To:
> return '';
>
> And things should start working as expected.
As near as I can tell, things *are* working, but I'll change it to return
the ''. What an odd thing to require - I guess it's because it is expecting
a string in the "true" case. I've noticed that for the most part, PHP allows
you to do things very easily, is very extensible, and yet, for something so
(relatively) new, it has a lot of well, ugly, "features" like this. I don't
mean to knock the whole project, as it's very cool, and I'm sure very hard
work to maintain - but DB access is pretty weird, and the calls vary across
DBs - I ended up coding a bit of my own thin layer to generically call DB
functions, and not have to worry about mysql_foo, pgsql_foo, etc. It seems
that it would be pretty easy to have that as part of the language.
It's rough edges and strange issues like that that just make me scratch my
head. Every single language I've worked with has them (what I call "isms" -
Java-isms, PowerBuilder-isms, C-isms - I can usually become productive with
the core of a language pretty quickly - usually inside of a week, as any
good programmer can, but the "isms" can be the part that take a few months
to get right - try telling any HR person/hiring manager that, and you won't
get far, though. :) They still want X years of Y, W years of Z, rather than
doing some simple aptitude type of testing, or going on recommendations,
nah, let's just scan resume for keywords and time periods...no wonder they
claimed they couldn't find people before the recession.), but PHP just
seems to have some really weird ones that you think would be easily
remedied.
That being said, doing session type stuff in PHP is still a ton easier and
more intuitive, IMHO, than mod_perl or some Java app servers. Also, since
it's a built-in, it's rare that from project to project it will vary. Even
when there are "best practices" for things like this in a
language/environment, I still seem to inherit code where people go skipping
down the bunny trail doing some weird and buggy stuff because they didn't
know what they were doing - when it's built in, that's less likely to
happen. The db layer I mentioned above would prevent just this sort of
thing - maybe this is already a planned feature?
--
Sean LeBlanc:[EMAIL PROTECTED] Yahoo:seanleblancathome
ICQ:138565743 MSN:seanleblancathome AIM:sleblancathome
Errors using inadequate data are much less than those using no data at all.
-Charles Babbage
(contributed by Chris Johnston)
--- End Message ---
--- Begin Message ---
I apologize for the repeats. As I mentionned before, I've been having
problems with this list. I believe everything is working fine, now.
-john
On Thu, 3 Jan 2002, Jim Lucas [php] wrote:
> I have seen this question reposted for the past week. now why don't you
> just work with the entire thing.
>
> get the "<body ... >"
>
> now once you have that, do this
>
> $str = preg_replace("<body", "", $str)
> $str = preg_replace(">", "", $str)
>
> now your $str var will only have the properties.
>
> Jim
> ----- Original Message -----
> From: "[-^-!-%-" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, January 02, 2002 12:45 PM
> Subject: [PHP] Regular Expression
>
>
> >
> > Hello everyone!
> >
> > I'm trying to get the text inside the <BODY> tag, using regular
> > expression.
> >
> > $area = eregi('(<body)(.*)<">)',$str);
> >
> > Where $str is the string containing
> > <body bgcolor="#999999" tex="#..." ...>
> >
> > When I print $area, the string contains the entire content of $str. I
> > get something like:
> >
> > <body ...>
> > <p>
> > .
> > .
> > .
> > </body>
> > </html>
> >
> >
> >
> > __________John Monfort_________________
> > _+-----------------------------------+_
> > P E P I E D E S I G N S
> > www.pepiedesigns.com
> > "The world is waiting, are you ready?"
> > -+___________________________________+-
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
--- End Message ---
--- Begin Message ---
Thank you very much!
--- End Message ---
--- Begin Message ---
I am trying to implement a user authentication/login system using PHP 4.x's
built in session functions. Upon a successful login, there is a
session_register('uid','uname','status'). On pages that require someone to
be an authenticated user I check against HTTP_SESSION_VARS['uid'] to make
sure it is not null, is greater then 0, and i also check the
HTTP_SESSION_VARS['uname'].
This seemed to be working until I tried to see what would happen if I fed
it a query string. I fed a "secure"
page ?action=edit&uid=3&uname=jon&status=true and my check still failed
me, but then when i went back to the same secure page without the bogus
query string, I was in fact authenticated as the user i forced through.
Is it possible that global vars even if not registered via
session_register() to end up the HTTP_SESSION_VARS array? I was under the
impression that the OLY variables and values that would be in this array
were those that were explicity registered via session_register().
Should i disable register_globals?
--Jon
--- End Message ---
--- Begin Message ---
how did u check? with a if? u should use the session_is_registered function instead,
http://www.php.net/manual/en/function.session-is-registered.php
if(!session_is_registered(\"user\")){
print \"invalid user\";
exit;
}
// your other code here
and yes, turning off register globals is a good idea :)
>I am trying to implement a user authentication/login system >using PHP 4.x\'s
>built in session functions. Upon a successful login, there >is a
>session_register(\'uid\',\'uname\',\'status\'). On pages that >require someone to
>be an authenticated user I check against >HTTP_SESSION_VARS[\'uid\'] to make
>sure it is not null, is greater then 0, and i also check the
>HTTP_SESSION_VARS[\'uname\'].
>This seemed to be working until I tried to see what would >happen if I fed
>it a query string. I fed a \"secure\"
>page ?action=edit&uid=3&uname=jon&status=true and my check >still failed
>me, but then when i went back to the same secure page >without the bogus
>query string, I was in fact authenticated as the user i >forced through.
>
>Is it possible that global vars even if not registered via
>session_register() to end up the HTTP_SESSION_VARS array? I >was under the
>impression that the OLY variables and values that would be >in this array
>were those that were explicity registered via >session_register().
>
>Should i disable register_globals?
>
>--Jon
--- End Message ---
--- Begin Message ---
thanks, i know what u mean, but what if you have to upload bigger files?
is it possible that maybe the next php release will have a option to auto write the
uploading file to disk(if the file being uploaded is bigger than a certain size) while
uploading instead of slurping the entire file into ram.
just a suggestion for improvement. :)
>set your max upload file size smaller then. default is 2mb >max. I find that
>too small, I re-set mine to 5mb. I have 2g of ram on our >server, 5mb isnt a
>worry to me. Id rather that then the slow speed of writing >the file to the
>hd.
>
>--
>
>Chris Lee
>[EMAIL PROTECTED]
>
>
>
>\"David\" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> hi all,
>>
>> I wes doing some file upload stuff with php when i noticed >that as the
>file is being uploaded, the entire file is stored in ram >until it\'s
>finished.
>>
>> obviously, we know the problems associated with this(use >up a lot of ram
>for large files), i\'m just wondering, is this going to be >fixed soon in the
>next release of php?
>>
>> i think those people using php to upload large files will >be very happy if
>>it\'s fixed :)
--- End Message ---
--- Begin Message ---
what i want to do is, parsing the "uptime" command in suse, get the stats
for 1, 5 and 15 minute cpu utilisation, and draw an image.
just like the taskmanager in win windows 2000, xp, and nt.anybody did this
before?
should look like this:
/
| ____________ /
| / \ /
| ___/ \/
| /
|/______________________
uptime: 68days
parsing the uptime command, isnt a problem, but how to coordinate the 3
values in the image.
also i have the ability, to save all values in a mysql db.
anybody can help?
ps, i never worked with images in php before...
--- End Message ---
--- Begin Message ---
Hello
Guys how can escape chars like ' and " so that MySQL doesn't report me
errors all the time, for example when i try to add data like "It's", i
always have errors
Thank You
--
Best regards,
Daniel mailto:[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hello
Guys how can escape chars like ' and " so that MySQL doesn't report me
errors all the time, for example when i try to add data like "It's", i
always have errors
Thank You
--
Best regards,
Daniel
--- End Message ---
--- Begin Message ---
Doesn't putting a backslash in front of the offending character escape it??
Isn't that what the PHP addslashes() function does???
Richy
-----Original Message-----
From: Daniel Harik [SMTP:[EMAIL PROTECTED]]
Sent: 03 January 2002 19:00
To: [EMAIL PROTECTED]
Subject: [PHP] special chars in SQL string
Hello
Guys how can escape chars like ' and " so that MySQL doesn't report me
errors all the time, for example when i try to add data like "It's", i
always have errors
Thank You
--
Best regards,
Daniel
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I have been using the following function declaration syntax for ages with no
problems.
Main php file:
<?php
include "my-inc.php";
...
FuncExample(arg1,arg2);
...
?>
Include file:
<?php
...
FuncExample(arg1,arg2){
<Function Content>
}
...
<?php
I have just finished some work for a client, after full testing on both my
Unix and Win32 test servers I moved the site over to their hosting company
and I get the following problem.
All my functions that are declared in my Inc files are spitting back the
error:
"Fatal error: Call to undefined function:..."
I have spoken with the hosting company, but they have considerable trouble
with 'backside' and 'elbow' recognition.
Are there any PHP.ini settings that affect this type of function
declaration?
Any help would be appreciated.
Bobby
--- End Message ---
--- Begin Message ---
I think what you mean is sessions, but that can't really do what you want.
The best you can do is record on the database when the user last accessed a
page of the site and infer if they are currently logged in or not.
I would be interested to know how ASP does better than this in a response
driven environment. You could force a user to formally log off, but what if
they just close their browser, or their internet connection, or IE just
stops working on their PC (the most likely). This is also a problem with
inferring a current log in from the last hit by that user name.
Tim
www.chessish.com <http://www.chessish.com>
----------
From: Ye Tun [SMTP:[EMAIL PROTECTED]]
Sent: 04 January 2002 02:21
To: [EMAIL PROTECTED]
Subject: application variable
Do we have application variable in PHP as in ASP?
I have a small database running with user name and password kept in
MySQL
database. Once user is login, how can I prevent the same user from
logging in again?
REgards,
Ye
--- End Message ---
--- Begin Message ---
http://www.php.net/manual/en/ref.filesystem.php
<http://www.php.net/manual/en/ref.filesystem.php> everything you need is
here, in particular fgets.
What you'll need is something like ...
If ($fhandle = fopen("filename", "r"))
{ while ($fline = fgets($fhandle) && ++$count < $X)
{ echo($fline);
}
}
this is untested but should work
Tim
www.chessish.com <http://www.chessish.com>
----------
From: RRNews [SMTP:[EMAIL PROTECTED]]
Sent: 03 January 2002 03:20
To: [EMAIL PROTECTED]
Subject: File opening, writting and location
I'm a newbie to PHP and the web.
I've been programming in VB for about 3 years and XBase for about
15.
I would like to place a bunch of text files in a directory and have
a PHP
script pick them up and place the top X lines in a center section of
a page
followed by a MORE link. It would do this for Y number of articles.
The
remainder it would title with the first x characters and place it on
the
right of the screen (like an archive)
I know that I can use a function similar to fopen in XBase to access
the
text files and extract the lines.
In Xbase, I would traverse the directory, extract the lines, place
the X
characters in a string followed by a "More".
If anyone can steer me in the right direction, I would appreciate
it. I
don't get how you place things on the page in a given area. I'm
using
Dreamweaver 4 templates.
Anyone have any suggestions.....
Thanks in advance...
Jerry
--- End Message ---
--- Begin Message ---
I have a website where I use sessions. After a user has logged of, the logon
screen appears again. The username field is filled with the value from a
cookie.
What happens:
For example: username = "Peter"
In the situation that I log of (and the logon page appears), the username
field gets the value from the cookie and the string "; PHPSESSID". ("Peter;
PHPSESSID")
When I close the browser window and open a new browser window the value of
the username is correct ("Peter"). The string "; PHPSESSID" is not in the
cookie. What is the reason that this string (the variable name for session
id as set in my php.ini) appears in this field?
In other words, why is the session_id variable name displayed in a field
that is filled by a cookie. I also tried to end the session, but the only
thing I can find is destroy_session and that only destroys everything that
is within that session, but it does not kill the session itsselfs
How do I solve this problem.
Regards,
Gilbert
--- End Message ---
--- Begin Message ---
When I call function stored in another file, included with require
command, variable $REMOTE_ADDR is empty in this function. How is that
possible?? Thanks for help.
Jan Muzik
--- End Message ---
--- Begin Message ---
>> When I call function stored in another file, included with require
>> command, variable $REMOTE_ADDR is empty in this function. How is that
>> possible?? Thanks for help.
function Funcname() {
global $REMOTE_ADDR;
...funcbody...
}
--- End Message ---
--- Begin Message ---
Hi,
I'm writing a page which will allow user's to register for an online service. They
register a username and password.
I want the password to contain at least one lowercase letter, at least one upper case
letter, and at least one digit. So
passW0rd would be valid, but password would not.
Whats the most compact way to do this? substr? ereg?
Richy
==========================================
Richard Black
Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 435 3504
Email: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
>> Whats the most compact way to do this? substr? ereg?
I think regular expressions is the best way because working with strings
looks like this:
if ($strtolower($pass)!=$pass) && ($strtoupper($pass)!=$pass) {
echo "OK!";
} else {
echo "WRONG!";
}
but using reg expr it's even more shorter
--- End Message ---
--- Begin Message ---
Hi users,
how can I send a connection database variable, from one PHP page to other
PHP page, and maintance the database connection open during both pages?
Thanks
--- End Message ---
--- Begin Message ---
>> how can I send a connection database variable, from one PHP page to other
>> PHP page, and maintance the database connection open during both pages?
I don't think one can do that. There is NO need for that. You can write
header.php file and
include it in the beginning of each PHP page where you need db connection
and footer.php
which you can include at the bottom of each page with XXXXX_close() function
in it.
--- End Message ---
--- Begin Message ---
>> Yes, thanks a lot, but i need to mantain the connection open for manage a
>> transaction, an everytime that I open a new database connection,
>> the system
>> begins a new transaction and I lose the last one.
>> Do you understand, me?
>> Do you know the way for do that?
I think it is imposimble in web applications at all, because there is no
persistent connection between db server
and "web server + PHP" service. You can try for example mysql_pconnect()
function (or it's analog for your db engine)
but still I don't think it is possible ;(((
Only applications can make this for you NOT PHP and Web ;(((
--- End Message ---
--- Begin Message ---
Yes, Im thinking the same...
:-((
Thanks again Intruder
----- Original Message -----
From: "Intruder" <[EMAIL PROTECTED]>
To: "Berlina" <[EMAIL PROTECTED]>; "php-general-list"
<[EMAIL PROTECTED]>; "php-dev-list" <[EMAIL PROTECTED]>;
"php-db-list" <[EMAIL PROTECTED]>
Sent: Friday, January 04, 2002 12:38 PM
Subject: RE: [PHP] Sending variables between PHP pages
> >> Yes, thanks a lot, but i need to mantain the connection open for manage
a
> >> transaction, an everytime that I open a new database connection,
> >> the system
> >> begins a new transaction and I lose the last one.
> >> Do you understand, me?
> >> Do you know the way for do that?
>
> I think it is imposimble in web applications at all, because there is no
> persistent connection between db server
> and "web server + PHP" service. You can try for example mysql_pconnect()
> function (or it's analog for your db engine)
> but still I don't think it is possible ;(((
> Only applications can make this for you NOT PHP and Web ;(((
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
--- End Message ---
--- Begin Message ---
I'm trying to upload files using php to a server on the lan.
Apache/1.3.22, PHP 4.0.6, MySQL 3.23.40
My problem is that file uploads are slow, a <50KB file takes around 5
minutes.
Thats kilobytes. in 5 minutes. Larger files just timeout.
I've set the max file sizes in apache and php configs, although my files are
nowhere near the maximum yet.
does anyone know what i'm doing wrong?
thanks
--- End Message ---
--- Begin Message ---
With all the wonderful String functions in PHP, I haven't been able to find
a str_compress(). Is there such an animal? Let's say I have a string like
this:
$myString = First_word <30 spaces> second_word <10 spaces> etc...
I need to do one of two things. Either compress the multiple spaces to one
and then use explode to break the string on a single space, or can someone
explain another way to break $myString into only those pieces that contain
usable text w/o spaces?
Thanks!
--
Gaylen
[EMAIL PROTECTED]
Home http://www.gaylenandmargie.com/
PHP KISGB v3.02 Guest Book http://www.gaylenandmargie.com/phpwebsite/
--- End Message ---
--- Begin Message ---
Hi everybody,
On my dev machine I have php 4.1. I have now to upload a huge script half
ported to 4.1 from 4.06 on a host where 4.04pl1 runs.
By 'half-ported' I mean almost every file I changed global $form_var or
function($form_var) to $_POST['form_var'].
But it will not work since it's not a var that existed ($_POST, $_SESSION,
etc...) and different scope.
I have a main file where maybe I can do $_POST = $HTTP_POST_VARS. But I
can't scape from the scope problem.
Anyway to make $_POST/$_SESSION/etc global on all functions on all files?
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
--- End Message ---