[PHP] Re [PHP] Secure File Upload
Hi, Not sure if this would work in limiting the file size of an upload or not, but I noticed a line in my php.ini file which seems to limit the size of any data sent by a POST, of course this would be a serverwide setting I guess. the line is; post_max_size = 8M; I'm assuming this would be set to less and would restrict uploads, however there must be a better way of doing it since this seems a bit brutal. __Steve PhillipsMrICQ#: 37350686 Current ICQ status: + More ways to contact me __
[PHP] Problems reading a URL
Hi, I'm working on a script to read in the results from a search engine and find out a website's position in the results. I've run into some problems trying to read the results in from google, it seems no matter how I try to open the page in php it still won't read the results. I've tried using different functions to read the page, but all with no luck, it seems that php thinks the page doesn't exist. If anyone has any experience of a similar problem reading a file, or has any idea's on how to get it to read (maybe I missed something obvious), please let me know, Here's some examples of what I've tried so far, example 1 $fp = @fopen("http://www.google.com/search?q=$keywords&num=10&hl=en&start=1&sa=N","r";); if ($fp) { print"The file exists!"; $contents = fread ($fp,"10"); echo $contents; } else { print"The file does not exist"; } example 2 $contents = @join ('', file ('http://www.google.com/search?q=$keywords&num=10&hl=en&start=1&sa=N')); if(isset($contents)){ echo $contents; } else{ echo "The file does not exist"; } I've avoided using functions like readfile, and fpassthru since they dump the file to output imediately, and I want to get the page as a string I can search. Hope somone has some idea's on this, Thanks, Steve.
[PHP] Problems reading a URL
Thanks everyone, Snoopy looks just like what I need to use, if only I'd known about this sooner, I could have saved myself alot of time :) Steve.
Re: [PHP] help please - strange session behaviour on IIS with php4.1.2
Hi, It sounds like you are experiencing a similar problem to one I had. It seems there are some problems with setting cookies when using IIS, and as I understand it one of the ways that sessions work is by storing the data in a cookie on the clients machine. On the page at www.php.net it suggests appending the session id to the url, go here to look at that http://www.php.net/manual/en/ref.session.php, An example of this would be; " Hello visitor, you have seen this page times.; ( can be used if short tag is enabled) # is necessary to preserve the session id # in the case that the user has disabled cookies ?> To continue, click here" on the notes at the bottom someone said this, sounds like a similar problem, "[EMAIL PROTECTED] 01-Apr-2002 04:30 Using PHP 4.1.2 on IIS 5.0, Win2k, haven't migrated app yet to Linux (later!) Managed to eventually get the sessions to work as follows. In the php.ini, session.auto_start = 1 Then without a session_start(); $xvar = "something" ; Use session_register("xvar"); then u CAN retrieve from a later page using the new way: $var = $_SESSION["xvar"] ; also without session_start(); even doing a var_dump($_SESSION); seems to work at least some of the time! The odd thing is that storing vars using the new way: $_SESSION["xvar"] = "something"; will save only for the CURRENT page, this gets lost when moving on to the next page! best regards Mike" Hope this helps with your problem, Steve. - Original Message - From: "Wolfram Kriesing" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, April 02, 2002 10:44 AM Subject: [PHP] help please - strange session behaviour on IIS with php4.1.2 > i've written a simple script, which tests the session behaviour on the IIS, > since it didnt seem to work > the following script should increase the session-var $testVar and display it > but it always stays at the same value > can someone explain that? is that a bug? > > also if i would increase $_SESSION['testVar'] it doesnt work. > > i have been looking at the server and the session-file is also updated, but > not with the new values, only the timestamp is updated, it seems > > session_start(); > // make the session variable globally available > // we have register_globals = Off > $testVar = &$_SESSION['testVar']; > > // init testVar to 1 or increase it > if( !isset($testVar) ) > { > print 'set testVar to 1'; > $testVar = 1; > } > else > { > print 'increase'; > $testVar++; > } > > // i can put session_register before > // or after the 'if' it always happens the same > session_register('testVar'); > > print $testVar; > > > the environment: > - IIS-Server5.0, WIN2k > - PHP4.1.2 > - session.auto_start = 0 > - register_globals = Off > > i am using the recommended-php.ini, that's why register_globals is off > > thanks for help > -- > Wolfram > > ... translating template engine > http://sf.net/projects/simpletpl > > ... authentication system > http://sf.net/projects/auth > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
[PHP] Yet Another Mysql Problem
Hi again, I've run into a nice bug using phpmyadmin to import data into a mysql database, and was hoping someone had some experience with doing this. I was wondering if there is any common errors which could be occurring due to characters with in the data? I'm fairly certain that this is the case as I can import about 5 lines of the database in mysql through phpmyadmin, and these don't have many odd characters in them, but anymore and it turns around and gives me an error, any ideas? Steve.
[PHP] Yet Another Mysql Problem
lol, ok (sorry I've been staring at a text file looking for bugs for 3 hours) this is the type of error msg phpmyadmin is giving me; Warning: Only 0 bytes were written, expected to write 32516 in - on line 82 sometimes it says line 74, or 130 as well I was kinda hoping someone might know of some common things which might trip up mysql or php in a string, since this is my best guess as to the reason for the error. Steve.
[PHP] Retrieving email headers in php
Hi, I'm working on a little script for autoresponding to email messages, and was wondering if anyone knew of an example of retrieving email headers or any documentation on this sort of thing php. Any help would be appreciated, Steve.