Re: [PHP] sessions and trans-sid problem/question
At 08:02 22.11.2002, Jean-Christian Imbeault said: [snip] Is it because I am putting the SID in the URL? I haven't tested with cookies yet as I want to get my site working without cookies first. Definetely yes. The PHP session is (with the default setup) nuthing more than a hash that's used to construct a file name. So the session ID 0ee410a57762be937d6d277b4ff642c8 will render the filename /tmp/sess_0ee410a57762be937d6d277b4ff642c8 which will subsequently used by PHP as the session storage. Adding a logout feature will help people who are worried about security, because it can kill the cookies on the browser. I agree! The problem I have now is that a user can bookmark a page with the SID in the URL and then come back later and the session is still active ... the session should close when the browser is closed. You cannot really control if the user is logging out or not - I saw a solution once where they had a JavaScript for onUnload where they warned the user that the next time he should log out - I believe the actual action was to use the onUnload handler to redirect the browser to the logout screen. However this wouldn't work if the user has JavaScript switched off. What I usually do (I also have session cookies switched off) is to send the user a session cookie when he logs in. This way I can use cookieless sessions, but when it comes to sensitive areas I can be sure that bookmarking or giving away the SID wouldn't automatically transfer the login session... I have set session.auto_start = 1 so I would think that after closing the browser and going to the bookmarked paged a new session would be started, killing the SID passed in from the URL no? I always recomment NOT using session.auto_start. It effectively disables making objects session-persistent as any class file needed for the objects must be loaded BEFORE objects gets reconstructed. When the browser requests an URL with a SID you have no control if this stems from a link or from a bookmark (maybe you could go and analyze $_SERVER['HTTP_REFERER'], but not all browsers tranmit it. What you can do is to have a timestamp of the last access recorded in your session so you can always check against your own timeout requirements. Personally I believe it's a good thing not to enable automatic session cookies. Relying on a session cookie effectively disables having two browser windows open with the same application but running in different contexts, since both would transmit the same session cookie. -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions and trans-sid problem/question
Justin French wrote: PHP cannot possibly know when a user closes a window... PHP regularly cleans out the garbage of old abandoned sessions, but you cannot expect this instantly... True ... but the browser does. I think I would not have this problem using cookies since the cookie would expire after the browser is closed. The reason I am seeing this problem is that I am passing the SID in the URL and hence PHP does not know that the browser was closed. If you access that URL tomorrow, I doubt the session will STILL be valid... True. I guess I should set the gc to clean up sessions more often than it does now. Maybe 30 minutes ... You should do some reading up in the manual php.ini, making sure what session destroy means, what session.auto_start means, etc. I know what they mean. I got very confused until you pointed a very obvious thing out. It's passing the SID in the URL that is causing the problem and as you pointed out there is no work-around. I'll just have to live with the fact that by passing the SID in the URL the session will be alive until the session gc cleans up. Thanks, Jc PS If I got any of this wrong please let me know. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting info from users comp?
Hello, Ernest E Vogelsinger [EMAIL PROTECTED] wrote: So you're talking about a Trojan, do you? No, not really. I was talking about legitimate programs run by the users themselves. - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions and trans-sid problem/question
At 08:56 22.11.2002, Justin French said: [snip] PHP cannot possibly know when a user closes a window... PHP regularly cleans out the garbage of old abandoned sessions, but you cannot expect this instantly... This is controlled by the session.gc_probability value in your INI file which is set to 1 by default. This means that every 100th access to any PHP script on your server will initiate the session garbage routine which might kill your outdated session file. Increasing this value will make this process more often, setting it to 100 will have PHP run the garbage collector every time a PHP script gets executed (you shouldn't do this - think in concurrency terms...) -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting info from users comp?
At 09:17 22.11.2002, @ Edwin said: [snip] Hello, Ernest E Vogelsinger [EMAIL PROTECTED] wrote: So you're talking about a Trojan, do you? No, not really. I was talking about legitimate programs run by the users themselves. [snip] Of course it is possible for any application running locally to fetch any data about your hardware - e.g. M$ does it with their semi-automatic bug reporting feature (in Win XP). However you'd need hardware and OS specific applications to accomplish this. -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions and trans-sid problem/question
Ernest E Vogelsinger wrote: Definetely yes. After reading Justin's post I realized that. What I usually do (I also have session cookies switched off) is to send the user a session cookie when he logs in. This way I can use cookieless sessions, but when it comes to sensitive areas I can be sure that bookmarking or giving away the SID wouldn't automatically transfer the login session... I don't get what you mean here. Can you explain a bit more? Sounds like what I need but I don't understand. You say you have cookies switched off but send the user a cookie ... a contradiction. I always recomment NOT using session.auto_start. It effectively disables making objects session-persistent I didn't know that but it doesn't matter as I don't do OO in PHP. Being also a Java programmer I can't wrap my brain around how PHP does pseudo-OO. Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] writing to a file
Hello, im running Red Hat 7.2 with PHP 4.0.6. How would i go about writing to a file as the data is being written, not when the file is closed #!/usr/bin/php -q ? $fp=fopen('t', a); if ($fp === false) die(could not open file); for($i=0; $i10; $i++) { $time= date(D, Ymd. G:i:s); $time = $time.\n; $result = fwrite($fp, $time, strlen($time)); if ($result == -1) die(error writing to file); // if ($condition) die; -- in case this happens i would like to have the times outputted to the file 't' sleep(2); } fclose($fp); ? i tried the above, while it is running but 't' comes up as a blank (seen using ls). How would i go about putting the contents in 't' when they are written to the file thx in advance gamin. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How do I initialize a page to do something ONCE
On Friday 22 November 2002 07:26, [EMAIL PROTECTED] wrote: Hello, I have a newbie problem. I have an php page that has many layers of forms to it. Once the user is finished with filling out one form and sending it, another form appears. This is of course done using simple if-else or switch statements. The problem is, how do I initialize a function or any other type of process just ONCE for the entire page. I don't want the function or process to run everytime a new form is displayed. Keep in mind that I'm also using sessions for this. Here is a tiny stripped-down example, of my failed attempt, that might help you analyze my question: session_start(); if(!isset($initialize)) { $start_over = 1; } if ($start_over == 1) { $temp_log = $logged_in; session_unset(); $logged_in = $temp_log; $initialize = 1; session_register(logged_in, initialize); } There is the code/pseudo-code combination of what I have so far. The only problem is that it is not processing the second if block -- if($start_over == 1) -- unless I actually set start_over=1 in the get string. How would I make sure that the page processes everything in that if block only ONCE after the page first loads? Also, if anyone knows a better way of displaying one form after another in on a single php page, I'm open to any ideas. OK, the only reason why the 2nd IF block is not executed is if $initialize is not empty (ie isset($initialize) is TRUE hence $start_over = 1 is never executed). So try: if(!isset($initialize)) { $start_over = 1; } else { var_dump($initialize); // to see what the it contains } -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* My BIOLOGICAL ALARM CLOCK just went off ... It has noiseless DOZE FUNCTION and full kitchen!! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions and trans-sid problem/question
Ernest E Vogelsinger wrote: This is controlled by the session.gc_probability value in your INI file I know I can probably find this in the documentation somewhere but ... how do I set the expire time on a session? Increasing this value will make this process more often, setting it to 100 will have PHP run the garbage collector every time a PHP script gets executed (you shouldn't do this - think in concurrency terms...) Again, why would congruency be affected by the gc? If the session hasn't timed-out then the gc won't clean it up. If it has then it's ok to clean it up. I obviously am missing something has what you say seems to make sense but I can see it just yet :) Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting info from users comp?
Ernest E Vogelsinger [EMAIL PROTECTED] wrote: Of course it is possible for any application running locally to fetch any data about your hardware - e.g. M$ does it with their semi-automatic bug reporting feature (in Win XP). However you'd need hardware and OS specific applications to accomplish this. True, I agree. That's why if you have read my earlier post(s) on this thread you'll see that what I'm trying to say is very similar to your conclusion :) - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions and trans-sid problem/question
On Friday 22 November 2002 16:28, Jean-Christian Imbeault wrote: Ernest E Vogelsinger wrote: This is controlled by the session.gc_probability value in your INI file I know I can probably find this in the documentation somewhere but ... how do I set the expire time on a session? Increasing this value will make this process more often, setting it to 100 will have PHP run the garbage collector every time a PHP script gets executed (you shouldn't do this - think in concurrency terms...) Again, why would congruency be affected by the gc? If the session hasn't timed-out then the gc won't clean it up. If it has then it's ok to clean it up. I obviously am missing something has what you say seems to make sense but I can see it just yet :) If you set it 100, then _every_ request in which sessions are used, PHP has to go through all the session files (by default stored in /tmp) and check whether they have expired. If you have a busy server you could have thousands of session files. Checking thousands of files at each request is very time consuming. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Traffic jam on the Information Superhighway. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] writing to a file
On Friday 22 November 2002 16:34, gamin wrote: Hello, im running Red Hat 7.2 with PHP 4.0.6. How would i go about writing to a file as the data is being written, not when the file is closed #!/usr/bin/php -q ? $fp=fopen('t', a); if ($fp === false) die(could not open file); for($i=0; $i10; $i++) { $time= date(D, Ymd. G:i:s); $time = $time.\n; $result = fwrite($fp, $time, strlen($time)); if ($result == -1) die(error writing to file); // if ($condition) die; -- in case this happens i would like to have the times outputted to the file 't' sleep(2); } fclose($fp); ? i tried the above, while it is running but 't' comes up as a blank (seen using ls). How would i go about putting the contents in 't' when they are written to the file I think you should try fclose() the file before you die! -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Mieux vaut tard que jamais! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions and trans-sid problem/question
Jason Wong wrote: If you set it 100, then _every_ request in which sessions are used, PHP has to go through all the session files (by default stored in /tmp) and check whether they have expired. If you have a busy server you could have thousands of session files. Checking thousands of files at each request is very time consuming. *That* I understand and agree with. What I was more interested in was the concurrency aspect. Why setting gc to 100 might cause problems with concurrency. Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Ip address as 32bit int?
Is it easy enough to change a formated IP addy (eg 192.168.0.1) to the 32bit unsigned int that computers use? the reason I ask is because it is alot more efficient space wise in a db to be storing a 32bit number rather that a char or varchar field. Or am I going to run into trouble because all ints are signed in PHP? -- JJ Harrison [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FAQ a good idea?
I think this group should have a regularly posted faq that outlines common problems such as register globals. I would be glad to help write it etc if anyone else would like an input. I wrote this in response to the millions of register global questions and the message with the subject Be Nice to Newbies. Reply on list if you think it would be a good idea and we can use this thread to discuss it... -- JJ Harrison [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions and trans-sid problem/question
At 09:28 22.11.2002, Jean-Christian Imbeault said: [snip] This is controlled by the session.gc_probability value in your INI file I know I can probably find this in the documentation somewhere but ... how do I set the expire time on a session? The session.gc_probability value is an overall value that you cannot escape as to my knowledge. If you want a finer granularity you need to run this from within your application. For example, when a iser accesses your script, record the current timestamp in session storage. On the next access, compare the current timestamp with the recorded one and act accordingly. Increasing this value will make this process more often, setting it to 100 will have PHP run the garbage collector every time a PHP script gets executed (you shouldn't do this - think in concurrency terms...) Again, why would congruency be affected by the gc? If the session hasn't timed-out then the gc won't clean it up. If it has then it's ok to clean it up. I obviously am missing something has what you say seems to make sense but I can see it just yet :) If it hasn't timed out it won't be touched, that's clear - but _if_ it has timed out it's not guaranteed that the gc has already removed the session file. Note that there is no expiry check when the session storage is accessed by session_start(); only the gc process itself checks if it should remove the session file. In another message, Jean-Christian Imbeault said: [snip] *That* I understand and agree with. What I was more interested in was the concurrency aspect. Why setting gc to 100 might cause problems with concurrency. Setting this to 100 means that _any_ script access will start the gc. Which means that even on a moderately busy server a multitude of gc's will check the session files, possibly interfering with each other as one gc removes a file that's being checked by another gc. Might be painless (I haven't looked at the implementation); but I'd avoid this as far as I could :) -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions and trans-sid problem/question
At 09:25 22.11.2002, Jean-Christian Imbeault said: [snip] What I usually do (I also have session cookies switched off) is to send the user a session cookie when he logs in. This way I can use cookieless sessions, but when it comes to sensitive areas I can be sure that bookmarking or giving away the SID wouldn't automatically transfer the login session... I don't get what you mean here. Can you explain a bit more? Sounds like what I need but I don't understand. You say you have cookies switched off but send the user a cookie ... a contradiction. My php.ini has session.use_cookies set to 0, so no (automatic) session cookies get transmitted. Thie however doesn't stop me from programmatically sending a cookie to the client... So that's what I do, basically: I might be using a session for a lot of stuff that's not related to user login; but when a user logs in this happens: a) Create a unique cookie name and remember it: $cookie_name = md5(date('YmdHis')); $_SESSION['cookie_name'] = $cookie_name; b) Create a random value for the cookie: $cookie_token = rand(); $_SESSION['cookie_token'] = $cookie_token; c) Transmit this cookie to the client (lifetime=session): setcookie($cookie_name, $cookie_token); From now on, the login-check tests for the random session cookie to match the token: if ($_COOKIE[$_SESSION['cookie_name']] == $_SESSION['cookie_token']) { // valid cookie found, so generate a new value $_SESSION['cookie_token'] = rand(); setcookie($_SESSION['cookie_name'], $_SESSION['cookie_token']); } else { // no cookie set, or token doesn't match - take the appropriate action } This helps me to allow multiple sessions at the same client computer, since every session has its own unique cookie. Giving away a link containing a SID wouldn't harm security since you cannot pass or bookmark session cookies. I always recomment NOT using session.auto_start. It effectively disables making objects session-persistent I didn't know that but it doesn't matter as I don't do OO in PHP. Being also a Java programmer I can't wrap my brain around how PHP does pseudo-OO. It's not pseudo-OO - it's some kind of back-to-the-roots OO :) You _do_ have (single) inheritance, you _do_ have class abstraction, you _do_ have polymorphism (although you need to go a lot by hand), but you _don't_ have protected and private storage. You can always put an object into session storage, like this: class A { function A() {} } session_start(); if (!is_object($a)) $a = new A(); $_SESSION['a'] = $a; This will give you the same object of class A anytime you access the page with the same session. Note however that the session handler needs the class definition to be able to reconstruct the saved object - only the class name, and the instance data, gets stored in session data. -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions and trans-sid problem/question
At 09:28 22.11.2002, Jean-Christian Imbeault said: [snip] This is controlled by the session.gc_probability value in your INI file I know I can probably find this in the documentation somewhere but ... Forgot to add this (sorry): http://www.php.net/manual/en/ref.session.php -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions and trans-sid problem/question
On Friday 22 November 2002 16:44, Jean-Christian Imbeault wrote: Jason Wong wrote: If you set it 100, then _every_ request in which sessions are used, PHP has to go through all the session files (by default stored in /tmp) and check whether they have expired. If you have a busy server you could have thousands of session files. Checking thousands of files at each request is very time consuming. *That* I understand and agree with. What I was more interested in was the concurrency aspect. Why setting gc to 100 might cause problems with concurrency. Well if you have a few requests per second, then each of those requests will want to check through your thousands of session files meaning you will have tens of thousands of disk accesses? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Never raise your hand to your children -- it leaves your midsection unprotected. -- Robert Orben */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Version of Outlook????
Does Any one of a web based version of Microsoft Outlook/MSN Hotmail address book and scheduler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FAQ a good idea?
on 22/11/02 8:14 PM, Noodle Snacks ([EMAIL PROTECTED]) wrote: I think this group should have a regularly posted faq that outlines common problems such as register globals. This has been discussed many times too :) Last plan was to have it auto-posted to the subscriber when they sign up, plus possibly a monthly or weekly reminder... the weekly reminder is really easy (it just requires someone to write the FAQ and set up a cron or something), but the one when ppl sign-up really needs the PHP-team in on it... really, it's their list, so it should be in their hands. Justin French http://Indent.com.au Web Developent Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] page cannot be displayed after a post of form with over 80 post elements
hi guys, i am facing the above problem. i couldn't explain whats causing this behavior. however, those data does get posted to the server. only thing is that the result page is not showing up but the above error page. i have tested with 60+ post elements, but no error of such occur. any idea what could be the cause? platform: win2k, sp3 iis5 php on cgi i have been wondering if it is iis5 that is giving the problem. thanks, lance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] checkboxes
Hello; I want to do that: I have two checkboxes: if first one is checked assign the value as a; if first one is checked assign the value as s; if both of them checked assign th value as as and insert the result db; the html code: ... tr tdinput type=checkbox name=val value=a / AAA/td /tr tr tdinput type=checkbox name=val value=s / SSS/td /tr ... and the PHP code: $eval=''; if(isset($val)){ if(isset($val[0]) isset($val[1])) $eval=as; if(isset($val[0]) !isset($val[1])) $eval=a; if(!isset($val[0]) isset($val[1])) $eval=s; $sql=insert into maillist (ID, postmeth) values ('$id_no','$eval'); $result=mysql_query($sql); if(!$result) echo(ERROR); } I can't understand what is wrong; Thanks everybody -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: checkboxes
hi, your missing some brackets []! this should work better: tdinput type=checkbox name=val[] value=a / AAA/td tdinput type=checkbox name=val[] value=s / SSS/td regards, Bastian Hello; I want to do that: I have two checkboxes: if first one is checked assign the value as a; if first one is checked assign the value as s; if both of them checked assign th value as as and insert the result db; the html code: ... tr tdinput type=checkbox name=val value=a / AAA/td /tr tr tdinput type=checkbox name=val value=s / SSS/td /tr ... and the PHP code: $eval=''; if(isset($val)){ if(isset($val[0]) isset($val[1])) $eval=as; if(isset($val[0]) !isset($val[1])) $eval=a; if(!isset($val[0]) isset($val[1])) $eval=s; $sql=insert into maillist (ID, postmeth) values ('$id_no','$eval'); $result=mysql_query($sql); if(!$result) echo(ERROR); } I can't understand what is wrong; Thanks everybody -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: ScanMail Message: To Sender, sensitive content found and action taken.
John Homes is the name of a rather well endowed porn star : and I'm not making this up :-D -- Richard Allsebrook Applications and Web Development John W. Holmes [EMAIL PROTECTED] wrote in message 003901c291c9$056b0930$7c02a8c0@coconut">news:003901c291c9$056b0930$7c02a8c0@coconut... This trend-smend content filter is friggin stupid. Someone should write another one. Where is the dirty word in this: Is there a way to convert a date 20/11/2002 to a Float number in PHP, since the date starts in 30/12/1899, just like the delphi treats the dates Yeah, of course. To convert 20/11/2002 into a float, just do echo (float)20/11/2002; and you get 20!! Or you can use strtotime() to convert it to a Unix timestamp (integer, number of seconds since Jan 1, 1970). ---John Holmes... ??? Or is John Holmes dirty?? Heh.. ---John Holmes. -Original Message- From: System Attendant [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 21, 2002 8:40 PM To: 'John W. Holmes' Subject: ScanMail Message: To Sender, sensitive content found and action taken. Trend SMEX Content Filter has detected sensitive content. Place = 'Rodrigo Corrêa'; 'PHP List 1'; 'PHP List'; ; ; [EMAIL PROTECTED] Sender = John W. Holmes Subject = [PHP] RE: [PHP-DB] Help with Date Delivery Time = November 22, 2002 (Friday) 09:39:38 Policy = Dirty Words Action on this mail = Delete message Warning message from administrator: Sender, Content filter has detected a sensitive e-mail. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] checkboxes
At 12:16 22.11.2002, empty spoke out and said: [snip] ... tr tdinput type=checkbox name=val value=a / AAA/td /tr tr tdinput type=checkbox name=val value=s / SSS/td /tr ... and the PHP code: $eval=''; if(isset($val)){ if(isset($val[0]) isset($val[1])) $eval=as; if(isset($val[0]) !isset($val[1])) $eval=a; if(!isset($val[0]) isset($val[1])) $eval=s; $sql=insert into maillist (ID, postmeth) values ('$id_no','$eval'); $result=mysql_query($sql); if(!$result) echo(ERROR); } [snip] Hi, 1) like Bastian already pointed out, you need to name your checkboxes val[] in order to have PHP recognize them being an array. 2) You cannot use isset($val[0]) and isset($val[1]). If any checkbox is clicked, $val[0] will always be set. If only one is clicked (regardless which one) index 0 will be set and index 1 unset. Instead, you should if(is_array($val)){ if (in_array('a', $val) in_array('s', $val)) $eval='as'; elseif (in_array('a', $val))$eval='a'; elseif (in_array('s', $val))$eval='s'; However this would give you the very same result, but much more elegant: $eval = join('', $val); And it will automatically handle all further additions when $val[] might have more possible values except 'a' and 's'. -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
[PHP] getting image names from a directoryindex of files
hi i have fopen a directory of files and got the directoryindex as follows img src=/icons/image2.gif alt=[IMG] / a href=IMG_0005.jpgIMG_0005.jpg/a19-Nov-2002 18:18 180K img src=/icons/image2.gif alt=[IMG] / a href=IMG_0009.jpgIMG_0009.jpg/a19-Nov-2002 18:18 248K img src=/icons/image2.gif alt=[IMG] / a href=IMG_0010.jpgIMG_0010.jpg/a19-Nov-2002 18:18 373K img src=/icons/image2.gif alt=[IMG] / a href=IMG_0011.jpgIMG_0011.jpg/a19-Nov-2002 18:18 236K img src=/icons/image2.gif alt=[IMG] / a href=IMG_0012.jpgIMG_0012.jpg/a19-Nov-2002 18:18 30img src=/icons/image2.gif alt=[IMG] / a href=IMG_0014.jpgIMG_0014.jpg/a19-Nov-2002 18:18 323K img src=/icons/image2.gif alt=[IMG] / a href=IMG_0017.jpgIMG_0017.jpg/a19-Nov-2002 18:18 283K img src=/icons/image2.gif alt=[IMG] / a href=IMG_0018.jpgIMG_0018.jpg/a19-Nov-2002 18:18 243K img src=/icons/image2.gif alt=[IMG] / a href=IMG_0019.jpgIMG_0019.jpg/a19-Nov-2002 18:18 253K img src=/icons/image2.gif alt=[IMG] / a href=IMG_0020.jpgIMG_0020.jpg/a19-Nov-2002 18:18 206K img src=/icons/image2.gif alt=[IMG] / a href=IMG_0021.jpgIMG_0021.jpg/a19-Nov-2002 18:18 320K img src=/icons/image2.gif alt=[IMG] / a href=IMG_0022.jpgIMG_0022.jpg/a19-Nov-2002 18:18 348K img src=/icons/image2.gif alt=[IMG] / a href=IMG_0023.jpgIMG_0023.jpg/a19-Nov-2002 18:18 298K i would like to just get the image filenames out of the href tag using regex any suggestions ? i'm pretty terrible with regex is there a good online tutorial on the subject ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Ip address as 32bit int?
In MySQL (and others?) you can use these two functions: INET_NTOA(expr) INET_ATON(expr) Regards Joakim - Original Message - From: Noodle Snacks [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 22, 2002 10:13 AM Subject: [PHP] Ip address as 32bit int? Is it easy enough to change a formated IP addy (eg 192.168.0.1) to the 32bit unsigned int that computers use? the reason I ask is because it is alot more efficient space wise in a db to be storing a 32bit number rather that a char or varchar field. Or am I going to run into trouble because all ints are signed in PHP? -- JJ Harrison [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Simple RegExp Problem...
Hello, Ok, I know this is easy for most of you, and believe me I've been searching and trying to learn all about regular expressions, but I can't seem figure out how to allow addition of spaces between characters. $text = Here is some text; Here, I want to be able to match the alpha characters as well as the spaces in between each word. So far I have: preg_match(/^[a-zA-Z]+$/, $text); But that only matches a single word without spaces. I would like to try to stay away from ereg and use preg_match instead because I heard preg_match is faster. ereg() has a way to match spaces by specifying [[:space:]], but I didn't get that solution to work either. How do I match $text to return true? - Nilaab -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Version of Outlook????
What does outlook have to do with PHP? No, there is nothing official has been made. There are some similar apps though, very good ones actually. -- Maxim Maletsky [EMAIL PROTECTED] Craig [EMAIL PROTECTED] wrote... : Does Any one of a web based version of Microsoft Outlook/MSN Hotmail address book and scheduler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FAQ a good idea?
there is a bunch of info everywhere on the web. One should have better means to find these, but at the end, that is what others do here - answer questions :) I don't think this will ever happen -- Maxim Maletsky [EMAIL PROTECTED] Noodle Snacks [EMAIL PROTECTED] wrote... : I think this group should have a regularly posted faq that outlines common problems such as register globals. I would be glad to help write it etc if anyone else would like an input. I wrote this in response to the millions of register global questions and the message with the subject Be Nice to Newbies. Reply on list if you think it would be a good idea and we can use this thread to discuss it... -- JJ Harrison [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Ip address as 32bit int?
From: Noodle Snacks [mailto:[EMAIL PROTECTED]] the reason I ask is because it is alot more efficient space wise in a db to be storing a 32bit number rather that a char or varchar field. While it is more efficient space-wise (4 bytes vs. 12 bytes), the price of the additional disk storage needed for storing them is trivial (unless you have a billions). Make sure you consider the addtional costs of maintenance, too, when you store data in a non-human format. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How do I initialize a page to do something ONCE
The variable $initialize contains int(1), so it does set itself within the last if statement. I'm just not sure why it's not unsetting all the sessions when the page loads. - Nilaab -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: Friday, November 22, 2002 2:36 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] How do I initialize a page to do something ONCE On Friday 22 November 2002 07:26, [EMAIL PROTECTED] wrote: Hello, I have a newbie problem. I have an php page that has many layers of forms to it. Once the user is finished with filling out one form and sending it, another form appears. This is of course done using simple if-else or switch statements. The problem is, how do I initialize a function or any other type of process just ONCE for the entire page. I don't want the function or process to run everytime a new form is displayed. Keep in mind that I'm also using sessions for this. Here is a tiny stripped-down example, of my failed attempt, that might help you analyze my question: session_start(); if(!isset($initialize)) { $start_over = 1; } if ($start_over == 1) { $temp_log = $logged_in; session_unset(); $logged_in = $temp_log; $initialize = 1; session_register(logged_in, initialize); } There is the code/pseudo-code combination of what I have so far. The only problem is that it is not processing the second if block -- if($start_over == 1) -- unless I actually set start_over=1 in the get string. How would I make sure that the page processes everything in that if block only ONCE after the page first loads? Also, if anyone knows a better way of displaying one form after another in on a single php page, I'm open to any ideas. OK, the only reason why the 2nd IF block is not executed is if $initialize is not empty (ie isset($initialize) is TRUE hence $start_over = 1 is never executed). So try: if(!isset($initialize)) { $start_over = 1; } else { var_dump($initialize); // to see what the it contains } -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* My BIOLOGICAL ALARM CLOCK just went off ... It has noiseless DOZE FUNCTION and full kitchen!! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] FAQ a good idea?
I think this is a good idea. We have have for ColdFusion because we can point new people to it and it answers a lot of questions without generating extra traffic on the list. I for one am all for an FAQ. Clint -Original Message- From: Maxim Maletsky [mailto:[EMAIL PROTECTED]] Sent: Friday, November 22, 2002 6:53 AM To: Noodle Snacks Cc: [EMAIL PROTECTED] Subject: Re: [PHP] FAQ a good idea? there is a bunch of info everywhere on the web. One should have better means to find these, but at the end, that is what others do here - answer questions :) I don't think this will ever happen -- Maxim Maletsky [EMAIL PROTECTED] Noodle Snacks [EMAIL PROTECTED] wrote... : I think this group should have a regularly posted faq that outlines common problems such as register globals. I would be glad to help write it etc if anyone else would like an input. I wrote this in response to the millions of register global questions and the message with the subject Be Nice to Newbies. Reply on list if you think it would be a good idea and we can use this thread to discuss it... -- JJ Harrison [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FAQ a good idea?
An about register globals post bi-weekly would eliminate tons of questions I reckon. But maxim is also right. People should find their own info and a faq could dominate the group... -- JJ Harrison [EMAIL PROTECTED] Clint Tredway [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I think this is a good idea. We have have for ColdFusion because we can point new people to it and it answers a lot of questions without generating extra traffic on the list. I for one am all for an FAQ. Clint -Original Message- From: Maxim Maletsky [mailto:[EMAIL PROTECTED]] Sent: Friday, November 22, 2002 6:53 AM To: Noodle Snacks Cc: [EMAIL PROTECTED] Subject: Re: [PHP] FAQ a good idea? there is a bunch of info everywhere on the web. One should have better means to find these, but at the end, that is what others do here - answer questions :) I don't think this will ever happen -- Maxim Maletsky [EMAIL PROTECTED] Noodle Snacks [EMAIL PROTECTED] wrote... : I think this group should have a regularly posted faq that outlines common problems such as register globals. I would be glad to help write it etc if anyone else would like an input. I wrote this in response to the millions of register global questions and the message with the subject Be Nice to Newbies. Reply on list if you think it would be a good idea and we can use this thread to discuss it... -- JJ Harrison [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP/MySQL
Hi... What is the line code to optain the system date? I propose is to compare the system date with the date in one field in the database... Then what would be the mysql command to select all the rows with date with 10 days or less from the system date? Thanks... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Version of Outlook????
no i want to create a php version of the web based outlook account found on msn.com Maxim Maletsky [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... What does outlook have to do with PHP? No, there is nothing official has been made. There are some similar apps though, very good ones actually. -- Maxim Maletsky [EMAIL PROTECTED] Craig [EMAIL PROTECTED] wrote... : Does Any one of a web based version of Microsoft Outlook/MSN Hotmail address book and scheduler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple RegExp Problem...
At 13:38 22.11.2002, @ Nilaab spoke out and said: [snip] Ok, I know this is easy for most of you, and believe me I've been searching and trying to learn all about regular expressions, but I can't seem figure out how to allow addition of spaces between characters. $text = Here is some text; Here, I want to be able to match the alpha characters as well as the spaces in between each word. So far I have: preg_match(/^[a-zA-Z]+$/, $text); But that only matches a single word without spaces. I would like to try to stay away from ereg and use preg_match instead because I heard preg_match is faster. ereg() has a way to match spaces by specifying [[:space:]], but I didn't get that solution to work either. How do I match $text to return true? [snip] use preg_match('/^[a-zA-Z\s]+$/', $text); \s - any [:space:] \S - anything not [:space:] -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
RE: [PHP] PHP/MySQL
What is the line code to optain the system date? I propose is to compare the system date with the date in one field in the database... Then what would be the mysql command to select all the rows with date with 10 days or less from the system date? NOW, CURDATE(), or CURRENT_DATE SELECT * FROM your_table WHERE your_date_column NOW() - INTERVAL 10 DAY; ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with sessions and Internet Explorer
Hi, We have added some new features to a SiteShield protected website which makes it neccessary to use sessions. Although creating the session and the appropriate variables is a server side process there seem to be problems with IE (tested with version 6 on Win2000 Pro and WinXP Pro). If I access the site with IE I will see the following error message at the bottom of the page: Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/home/globstag/tmp) in Unknown on line 0 However if I access the site with any other browser writing the session data works. But this isn't all yet. I can't replicate the problem on any other machine I have access to. On all other machines I have access to the site works fine. First I thought that it might have been a problem with the PHP version because the server runs on PHP 4.0.6 and my notebook runs on PHP 4.2.1. Upgrading the server to 4.2.1 unfortunately didn't solve the problem. I have then deployed the site to my private dedicated server which runs PHP 4.0.6 on SuSE 7.2. Even on that machine I can't replicate the error. The main difference between the other servers and the server in NewYork is that only the server in NewYork is protected with SiteShield. Which leads me to the conclusion that there might be a problem related to the combination of SiteShield, IE and PHP. If you have any ideas feel free to share your thoughts with me. Cheers, Andreas -- Andreas Otto [EMAIL PROTECTED] Using PHP on Windows? www.php4win.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fixed - Re: page cannot be displayed after a post of form with over80 post elements
managed to found out the cause. it was the cookies. it got overloaded with data and exceed the 4k limit. the cookies was storing preferences for too many users thus it break the limit. B.C. Lance wrote: hi guys, i am facing the above problem. i couldn't explain whats causing this behavior. however, those data does get posted to the server. only thing is that the result page is not showing up but the above error page. i have tested with 60+ post elements, but no error of such occur. any idea what could be the cause? platform: win2k, sp3 iis5 php on cgi i have been wondering if it is iis5 that is giving the problem. thanks, lance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Coding HELP
Thank you very much for everyone's help ^_^ I'm very much a novice in PHP, so whether I can actually figure out what I have to do'll be another thing *L* Thanks again ^_^ -Vicky -Original Message- From: Vicky [mailto:[EMAIL PROTECTED]] Sent: Friday, November 22, 2002 9:56 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP Coding HELP Hello! I am looking to find or code a script that does the following. If anyone could help I'd be extremely greatful. Users can upload their files, but the files they upload can only be downloaded X amount of times. After they've been downloaded so many times in an ideal world they'd be automatically removed, though just to be made so people couldn't download them anymore would be great. Please help! Thanks! Vicky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions and trans-sid problem/question
On Fri, 22 Nov 2002 14:57:23 +0900, you wrote: [...] 1- the user logs in 2- bookmarks the page 3- closes the browser 4- opens the browser 5- goes to the saved bookmark page He has access to the page. I.e. the session did not close/terminate when he closed his browser ... I 'm not where I can test this right now, but if a session is older than session.gc_maxlifetime, isn't it invalid anyway? I.E. if I bookmark a page on your site and then come back 3 hours later passing an old SID, shouldn't that session have expired on the server by that time, in which case the session vars would be empty and you could kick me back to your login page? I personally use a custom session handler (MySql based, which I got from www.phpbuilder.com) and I believe this is how my site behaves, but I'm not for certain. I'll try to test it out and see... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with sessions and Internet Explorer
At 14:24 22.11.2002, Andreas Otto spoke out and said: [snip] We have added some new features to a SiteShield protected website which makes it neccessary to use sessions. Although creating the session and the appropriate variables is a server side process there seem to be problems with IE (tested with version 6 on Win2000 Pro and WinXP Pro). If I access the site with IE I will see the following error message at the bottom of the page: Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/home/globstag/tmp) in Unknown on line 0 However if I access the site with any other browser writing the session data works. [snip] Hi, I don't see how this behaviour could be related to a browser version - all browsers behave (should behave?) identically when requesting a page... they simply issue a MIME request, like GET /?PHPSESSIONID=aasdasdasdasdasdasd HTTP/1.0 Host: www.yourhost.com The message you see looks disturbing to me - is the session.save_path value actually set to /home/globstag/tmp? Does Apache (or else) have all necessary rights to this directory? _MAYBE_ you're using some mod_rewrite rules on the target server, depending on the user agent, so IE's would end up in a defunct installation? I'd check for this inn the first place. -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
Re: [PHP] sessions and trans-sid problem/question
At 15:08 22.11.2002, Michael Sims spoke out and said: [snip] I 'm not where I can test this right now, but if a session is older than session.gc_maxlifetime, isn't it invalid anyway? I.E. if I bookmark a page on your site and then come back 3 hours later passing an old SID, shouldn't that session have expired on the server by that time, in which case the session vars would be empty and you could kick me back to your login page? [snip] I don't think the session handler checks session expiry - only gc does. I haven't checked the PHP sources yet, but I found out that on my development server (where we definetely don't have a lot of traffic ;-) session files can persist over night, and the session is still available in the morning... only when the gc_probability is hit (i.e. at the 100th access), the file gets removed. At least with my PHP (4.2.2, RH 7.2). -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
[PHP] transferring data from .php to form's in an .html file
Could someone help me with this: What combination of functions do I have to use to automatically redirect to an .html page (with form's inside), while carrying a variable that would be automatically put into one of the input boxes, just like a predefined value would? Thanks a lot! Krzysztof
Re: [PHP] transferring data from .php to form's in an .html file
What combination of functions do I have to use to automatically redirect to an .html page (with form's inside), while carrying a variable that would be automatically put into one of the input boxes, just like a predefined value would? Can't do it unless your page form page is .php so you can execute some PHP commands in it, or you're using PHP to write the entire .html page with the default values. If you use .php pages for both, then you can just pass the values in the URL www.page.com/page.php?name=john and use input type=text name=name value=?=$_GET['name']? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with sessions and Internet Explorer
Hi Ernest, On Friday 22 November 2002 15:05, Ernest E Vogelsinger wrote: The message you see looks disturbing to me - is the session.save_path value actually set to /home/globstag/tmp? Does Apache (or else) have all necessary rights to this directory? _MAYBE_ you're using some mod_rewrite rules on the target server, depending on the user agent, so IE's would end up in a defunct installation? I'd check for this inn the first place. Well, guess what I did before writing this eMail ;-) At the end of my original eMail I said: On Friday 22 November 2002 14:24, Andreas Otto wrote: The main difference between the other servers and the server in NewYork is that only the server in NewYork is protected with SiteShield. Which leads me to the conclusion that there might be a problem related to the combination of SiteShield, IE and PHP. So what we have is a set of web servers to which access is controlled by a (proxy) server. The software that is used to manage access rights is called SiteShield and is developed by a company called Tempest. Every request to the server I experience this strange problem at has to pass the SiteShield server. The question is now: Has anyone heard about or had problems with the combination of PHP SiteShield and InternetExplorer? Cheers, Andreas -- Andreas Otto [EMAIL PROTECTED] Using PHP on Windows? www.php4win.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie: PHP/MySQL (SELECT)
if one of $titulotxt or $cdstxt is not set, your query will look something like this: SELECT * FROM divx WHERE cds like '$cdstxt' ORDER BY titulo As you see, there is unnecessery . I build my search queries using this form: $query_cond=''; foreach($_GET as $col = $val) { switch($col) { case 'cds': // you can add more cases here for conditions that need to be exact $query_cond .= $col LIKE '$val' AND ; break; case 'titulo': // you can add more cases here for conditions that need not to be exact $query_cond .= $col LIKE '%$val%' AND ; break; } } // get rid of final AND $query_cond = substr($query_cond, 0, strlen($query_cond) - 4); // and as you don't have any other conditions, $query_cond cannot be empty - we would have excessive WHERE // so if it is empty, make it 1 if($query_cond=='') $query_cond='1'; $sql=SELECT * FROM divx WHERE $query_cond ORDER BY titulo; Mr. BuNgL3 wrote: Hi... I'm with a little sintax problem... The question is that i have two search fields (titulotxt and cdstxt) and i want to create an mysql condition... i trying: $sql1=($titulotxt) ? titulo like '%.$titulotxt.%':; $sql2=($cdstxt) ? cds like '$cdstxt':; $sql=SELECT * FROM divx WHERE .$sql1.$sql2 ORDER BY titulo; but he's giving me a sintax error on the 3 line... Can anyone teach me how i must do to validate the mysql condition and make it work? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php-4.3.0pre2, fgets and socket_get_status
An application I am developing contains something like the following: $this-socket = fsockopen($server, $port, $errnum, $errstr, 60); ... while (!feof($this-socket)) { $char = fgets($this-socket,1); if (($char == \n) || ($char == \r)) return $buffer; } $buffer .= $char; } return $buffer; This works fine upto php-4.2.x. However, I've recently built and installed php-4.3.0pre2 and now the above code appears to hang. Substituting fread in place of fgets solves the problem. I know that fgets is supposed to be 'binary safe' as of php-4.3 but I'm not sure if this could be causing the above problem. Does anyone know of any changes to fgets in php-4.3.0 which might be causing this? Are there any reasons why I should not use fread instead of fgets here? Also, I am looking at using something like: $status = socket_get_status($this-socket); if ($status[unread_bytes] = 0) return false; However, $status[unread_bytes] always returns 0 until the first call to fgets($this-socket). Is this right? I'd like to check the status of the socket before I try to read from it. Thanks, Stephen Grier -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Order of arrays
Use usort Mako Shark wrote: I don't think a simple sort() will do this. Is there a way I can sort these following array values so that all will be in numerical order, and then alphabetical after that? I need Dirfiles/97 Dirfiles/98 Dirfiles/99 Dirfiles/100 Dirfiles/101 Dirfiles/102 Dirfiles/ABG1 Dirfiles/ABG2 in that order. They could originally be in any seemingly random order, but when I'm done with it, I need them in that order. Is there a way to do it? A simple string sort() won't work since 9 comes after 1 and it'll order it like 'Dirfiles/100,101,102,97,98,99,ABG1,ABG2'. Any ideas? For some reason, natsort() won't work. __ Do you Yahoo!? Yahoo! Mail Plus Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with sessions and Internet Explorer
At 15:35 22.11.2002, Andreas Otto spoke out and said: [snip] Well, guess what I did before writing this eMail ;-) That's what I have feared... Every request to the server I experience this strange problem at has to pass the SiteShield server. Is it possible to have SiteShield log what its doing? The question is now: Has anyone heard about or had problems with the combination of PHP SiteShield and InternetExplorer? I don't know anything about SiteShield - can anyone else chime in please? I'd also try to holler at the guys at Tempest... -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/
Re: [PHP] ImageMagick Extension v0.2a Released (UPDATED)
I believe there have been a few starts and stops with a module in the past but I haven't found anything with the complete feature set. I intend to do that. I am going to be looking for help in the future but I'd like to get the current stuff closer to my goal. There a number of things on the list that I'd like to get done before asking others to help. I only need another few days before I push this to beta and start testing it on some live sites. Actually, one way to help now is to test it...perhaps compile it on an OS other then Linux and put it through some testing. I'm putting up a site for it now and will push another version by end of today. On Thu, 21 Nov 2002, Weston Houghton wrote: I had no idea anyone was actively working on something like this. Are you looking for help? Do you plan on perhaps making this a Sourceforge project, or something similar? Cheers and great job, Wes On Thursday, November 21, 2002, at 05:56 PM, Michael Montero wrote: Just released the next version of magick, the PHP ImageMagick extension. It is located here: http://apc.communityconnect.com/magick/magick-0.2a.tar.gz Here's the ChangeLog: November 21, 2002 0.2a o functions added: magick_rotate() magick_shear() magick_contrast() magick_equalize() magick_gamma() magick_level() magick_modulate() magick_negate() magick_normalize() magick_drawellipse() o slight changes to output of gen_configm4 o fixed comments in all examples after the initial magick_readimage(), they were wrong o fixed all examples so they exit properly on errors o fixed all examples so they work as either standalone script or web page; they do better output as well o fixed output of magick info. when calling phpinfo() o more commenting o significantly better error handling -- Michael C. Montero Chief Technology Officer Community Connect Inc. Co-founder [EMAIL PROTECTED] -=-=-=-=-= Community Connect Inc. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- The Premier Source of Interactive Online Communities149 Fifth Avenue http://www.CommunityConnectInc.com/ New York, NY 10010 http://www.AsianAvenue.com/ http://www.BlackPlanet.com/ Click into Asian AmericaThe World Is Yours http://www.MiGente.com/ http://www.DiversityJobMarket.com/ The Power of LatinosIn partnership with The New York Times - Your Message May Appear Below This Line -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Michael C. Montero Chief Technology Officer Community Connect Inc. Co-founder [EMAIL PROTECTED] -=-=-=-=-= Community Connect Inc. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- The Premier Source of Interactive Online Communities149 Fifth Avenue http://www.CommunityConnectInc.com/ New York, NY 10010 http://www.AsianAvenue.com/ http://www.BlackPlanet.com/ Click into Asian AmericaThe World Is Yours http://www.MiGente.com/ http://www.DiversityJobMarket.com/ The Power of LatinosIn partnership with The New York Times - Your Message May Appear Below This Line -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with sessions and Internet Explorer
Hi Ernest, On Friday 22 November 2002 16:11, Ernest E Vogelsinger wrote: Is it possible to have SiteShield log what its doing? The question is now: Has anyone heard about or had problems with the combination of PHP SiteShield and InternetExplorer? I don't know anything about SiteShield - can anyone else chime in please? I'd also try to holler at the guys at Tempest... I have been trying that, but it looks like I have to run the query through our office in NewYork where the servers are hosted. My colleagues in NewYork will have the right support details. Cheers, Andreas -- Andreas Otto [EMAIL PROTECTED] Using PHP on Windows? www.php4win.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How do I initialize a page to do something ONCE
Your first post stated.. The only problem is that it is not processing the second if block -- if($start_over == 1) -- unless I actually set start_over=1 in the get string. Your second sounds like it is executing the second block... The variable $initialize contains int(1), so it does set itself within the last if statement. If the second block is being executed... Did you check out php.net and the comments about session_unset()? If it is not, are you closing the browser between tests? The session information stays open even after leaving the site and coming back. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: SQLCODE=-930
i gave up to many problems for a productive site: - gd - need the patches from RH - php-4.2.3 and informix - if you use a own handler, the URI must exist e.g. http://site/own-handler/xyz causes 404 not found http://site/server-status/xyz results 200 php with httpd 2.0 is still: --with-apxs2[=FILE] EXPERIMENTAL: Build shared Apache 2.0 module. Oliver On Thu, 2002-11-21 at 12:56, Matthieu Le Corre wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 oki that good i managed to compile php 4.2.2 but my informix support is still broken :/ did you manage tu connect tu ifx with 4.2.2 and apache 4.0.23 ? yes I used the RH httpd-2.0.36-apxs.patch from the 2.0.40 src.rpm if yes . what's your ifx SDK version ? csdk-2.60.UC1-1 Le Lundi 18 Novembre 2002 17:00, Matthieu Le Corre a écrit : arf ... I failed to compile php 4.2.2 du to compiling error in sapi/apachefilter module for http2.0.43 on a RH 7.2 it's not my days Le Lundi 18 Novembre 2002 15:42, Oliver Fänger a écrit : could somebody tell me why libphp4.so (php-4.2.3 --with-informix, httpd-2.43, RH8, Intel) links against libthasf.so libthgen.so libthos.so libthsql.so and misses libifasf.so libifgen.so libifos.so libifsql.so 4.2.2 works fine with these libs and does not have the above ones. and why do i have to set LDFLAGS=-L/opt/informix/lib -L/opt/informix/lib/esql -L/tmp/src/php-4.2.3/ext/informix i saw something like this in the macro file (/ext/informix/config.m4): PHP_ADD_LIBPATH($INFORMIXDIR/lib, INFORMIX_SHARED_LIBADD) PHP_ADD_LIBPATH($INFORMIXDIR/lib/esql, INFORMIX_SHARED_LIBADD) (INFORMIXDIR is set) php-4.2.3: libdl.so.2 = /lib/libdl.so.2 (0x40192000) libpam.so.0 = /lib/libpam.so.0 (0x40196000) libthsql.so = /opt/informix/lib/esql/libthsql.so (0x4019e000) libthasf.so = /opt/informix/lib/libthasf.so (0x401e1000) libthgen.so = /opt/informix/lib/esql/libthgen.so (0x40217000) libthos.so = /opt/informix/lib/esql/libthos.so (0x40269000) libifgls.so = /lib/libifgls.so (0x4028) libcrypt.so.1 = /lib/libcrypt.so.1 (0x402bb000) libifglx.so = /lib/libifglx.so (0x402e8000) libexpat.so.0 = /usr/lib/libexpat.so.0 (0x402ea000) libpspell.so.4 = /usr/lib/libpspell.so.4 (0x4030a000) libncurses.so.5 = /usr/lib/libncurses.so.5 (0x40323000) libgmp.so.3 = /usr/lib/libgmp.so.3 (0x40362000) libgd.so.1.8 = /usr/lib/libgd.so.1.8 (0x4038f000) libpng12.so.0 = /usr/lib/libpng12.so.0 (0x403c) libz.so.1 = /usr/lib/libz.so.1 (0x403e3000) libdb-4.0.so = /lib/libdb-4.0.so (0x403f1000) libgdbm.so.2 = /usr/lib/libgdbm.so.2 (0x40499000) libcurl.so.2 = /usr/lib/libcurl.so.2 (0x404a) libbz2.so.1 = /usr/lib/libbz2.so.1 (0x404c2000) libssl.so.2 = /lib/libssl.so.2 (0x404d1000) libcrypto.so.2 = /lib/libcrypto.so.2 (0x40501000) libresolv.so.2 = /lib/libresolv.so.2 (0x405d5000) libm.so.6 = /lib/i686/libm.so.6 (0x405e7000) libttf.so.2 = /usr/lib/libttf.so.2 (0x40609000) libfreetype.so.6 = /usr/lib/libfreetype.so.6 (0x4063) libjpeg.so.62 = /usr/lib/libjpeg.so.62 (0x40679000) libnsl.so.1 = /lib/libnsl.so.1 (0x40697000) libxml2.so.2 = /usr/lib/libxml2.so.2 (0x406ac000) libc.so.6 = /lib/i686/libc.so.6 (0x4200) libltdl.so.3 = /usr/lib/libltdl.so.3 (0x40754000) libpspell-modules.so.1 = /usr/lib/libpspell-modules.so.1 (0x4075c000) libstdc++.so.5 = /usr/lib/libstdc++.so.5 (0x4075e000) libgcc_s.so.1 = /lib/libgcc_s.so.1 (0x4081) /lib/ld-linux.so.2 = /lib/ld-linux.so.2 (0x8000) php-4.2.2: libdl.so.2 = /lib/libdl.so.2 (0x40184000) libpam.so.0 = /lib/libpam.so.0 (0x40188000) libifsql.so = /lib/libifsql.so (0x4019) libifasf.so = /lib/libifasf.so (0x401d) libifgen.so = /lib/libifgen.so (0x40206000) libifos.so = /lib/libifos.so (0x40254000) libifgls.so = /lib/libifgls.so (0x40268000) libcrypt.so.1 = /lib/libcrypt.so.1 (0x402a3000) libifglx.so = /lib/libifglx.so (0x402d) libexpat.so.0 = /usr/lib/libexpat.so.0 (0x402d2000) libpspell.so.4 = /usr/lib/libpspell.so.4 (0x402f2000) libncurses.so.5 = /usr/lib/libncurses.so.5 (0x4030b000) libgmp.so.3 = /usr/lib/libgmp.so.3 (0x4034a000) libgd.so.1.8 = /usr/lib/libgd.so.1.8 (0x40377000) libpng12.so.0 = /usr/lib/libpng12.so.0 (0x403a8000) libz.so.1 = /usr/lib/libz.so.1 (0x403cb000) libm.so.6 = /lib/i686/libm.so.6 (0x403d9000) libxml2.so.2 = /usr/lib/libxml2.so.2 (0x403fb000) libdb-4.0.so = /lib/libdb-4.0.so
Re: [PHP] Re: SQLCODE=-930
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 don't do !!! i've a working php 4.2.2 apache 2.0.43 with informix :D and Gd on a redhat 7. 2 ;) update your ifx SDK , il will be better ;) and Server status is working ;) Le Vendredi 22 Novembre 2002 15:39, Oliver Fänger a écrit : i gave up to many problems for a productive site: - gd - need the patches from RH - php-4.2.3 and informix - if you use a own handler, the URI must exist e.g. http://site/own-handler/xyz causes 404 not found http://site/server-status/xyz results 200 php with httpd 2.0 is still: --with-apxs2[=FILE] EXPERIMENTAL: Build shared Apache 2.0 module. Oliver On Thu, 2002-11-21 at 12:56, Matthieu Le Corre wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 oki that good i managed to compile php 4.2.2 but my informix support is still broken :/ did you manage tu connect tu ifx with 4.2.2 and apache 4.0.23 ? yes I used the RH httpd-2.0.36-apxs.patch from the 2.0.40 src.rpm if yes . what's your ifx SDK version ? csdk-2.60.UC1-1 Le Lundi 18 Novembre 2002 17:00, Matthieu Le Corre a écrit : arf ... I failed to compile php 4.2.2 du to compiling error in sapi/apachefilter module for http2.0.43 on a RH 7.2 it's not my days Le Lundi 18 Novembre 2002 15:42, Oliver Fänger a écrit : could somebody tell me why libphp4.so (php-4.2.3 --with-informix, httpd-2.43, RH8, Intel) links against libthasf.so libthgen.so libthos.so libthsql.so and misses libifasf.so libifgen.so libifos.so libifsql.so 4.2.2 works fine with these libs and does not have the above ones. and why do i have to set LDFLAGS=-L/opt/informix/lib -L/opt/informix/lib/esql -L/tmp/src/php-4.2.3/ext/informix i saw something like this in the macro file (/ext/informix/config.m4): PHP_ADD_LIBPATH($INFORMIXDIR/lib, INFORMIX_SHARED_LIBADD) PHP_ADD_LIBPATH($INFORMIXDIR/lib/esql, INFORMIX_SHARED_LIBADD) (INFORMIXDIR is set) php-4.2.3: libdl.so.2 = /lib/libdl.so.2 (0x40192000) libpam.so.0 = /lib/libpam.so.0 (0x40196000) libthsql.so = /opt/informix/lib/esql/libthsql.so (0x4019e000) libthasf.so = /opt/informix/lib/libthasf.so (0x401e1000) libthgen.so = /opt/informix/lib/esql/libthgen.so (0x40217000) libthos.so = /opt/informix/lib/esql/libthos.so (0x40269000) libifgls.so = /lib/libifgls.so (0x4028) libcrypt.so.1 = /lib/libcrypt.so.1 (0x402bb000) libifglx.so = /lib/libifglx.so (0x402e8000) libexpat.so.0 = /usr/lib/libexpat.so.0 (0x402ea000) libpspell.so.4 = /usr/lib/libpspell.so.4 (0x4030a000) libncurses.so.5 = /usr/lib/libncurses.so.5 (0x40323000) libgmp.so.3 = /usr/lib/libgmp.so.3 (0x40362000) libgd.so.1.8 = /usr/lib/libgd.so.1.8 (0x4038f000) libpng12.so.0 = /usr/lib/libpng12.so.0 (0x403c) libz.so.1 = /usr/lib/libz.so.1 (0x403e3000) libdb-4.0.so = /lib/libdb-4.0.so (0x403f1000) libgdbm.so.2 = /usr/lib/libgdbm.so.2 (0x40499000) libcurl.so.2 = /usr/lib/libcurl.so.2 (0x404a) libbz2.so.1 = /usr/lib/libbz2.so.1 (0x404c2000) libssl.so.2 = /lib/libssl.so.2 (0x404d1000) libcrypto.so.2 = /lib/libcrypto.so.2 (0x40501000) libresolv.so.2 = /lib/libresolv.so.2 (0x405d5000) libm.so.6 = /lib/i686/libm.so.6 (0x405e7000) libttf.so.2 = /usr/lib/libttf.so.2 (0x40609000) libfreetype.so.6 = /usr/lib/libfreetype.so.6 (0x4063) libjpeg.so.62 = /usr/lib/libjpeg.so.62 (0x40679000) libnsl.so.1 = /lib/libnsl.so.1 (0x40697000) libxml2.so.2 = /usr/lib/libxml2.so.2 (0x406ac000) libc.so.6 = /lib/i686/libc.so.6 (0x4200) libltdl.so.3 = /usr/lib/libltdl.so.3 (0x40754000) libpspell-modules.so.1 = /usr/lib/libpspell-modules.so.1 (0x4075c000) libstdc++.so.5 = /usr/lib/libstdc++.so.5 (0x4075e000) libgcc_s.so.1 = /lib/libgcc_s.so.1 (0x4081) /lib/ld-linux.so.2 = /lib/ld-linux.so.2 (0x8000) php-4.2.2: libdl.so.2 = /lib/libdl.so.2 (0x40184000) libpam.so.0 = /lib/libpam.so.0 (0x40188000) libifsql.so = /lib/libifsql.so (0x4019) libifasf.so = /lib/libifasf.so (0x401d) libifgen.so = /lib/libifgen.so (0x40206000) libifos.so = /lib/libifos.so (0x40254000) libifgls.so = /lib/libifgls.so (0x40268000) libcrypt.so.1 = /lib/libcrypt.so.1 (0x402a3000) libifglx.so = /lib/libifglx.so (0x402d) libexpat.so.0 = /usr/lib/libexpat.so.0 (0x402d2000) libpspell.so.4 = /usr/lib/libpspell.so.4 (0x402f2000) libncurses.so.5 = /usr/lib/libncurses.so.5 (0x4030b000) libgmp.so.3 =
Re: [PHP] sessions and trans-sid problem/question
Jean, This is a common challenge with a pretty easy solution. First, in case you are curious why the session can be reestablished, the bookmarked page likely has the session identifier in the query string. Thus, it is unnecessary for the browser to send a cookie, because it is sending the session identifier as a GET variable. This is what PHP is using to identify the client. It is a bad idea to depend on the timeout of a cookie or the session cleanup process to maintain a session timeout mechanism. Instead, you should keep a timestamp stored as a session variable that you use to make any time-based decisions for that session. For example: $_SESSION[last_access] = gmmktime(); To use this value to enforce a timeout, you would make a check similar to the following to make sure it hasn't been too long since the last access: $seconds_idle = gmmktime() - $_SESSION[last_access]; If the number of seconds they have been idle is too long for you, force them to reenter their password or even completely reauthenticate to continue. If the idle time is acceptable to you, reset the session variable to the current time. Chris --- Jean-Christian Imbeault [EMAIL PROTECTED] wrote: I've made a site in PHP and on some pages a user needs to log in first before gaining access to the page. (i.e. there is a log in page). Once the user has logged in I keep that fact in a session variable so that he doesn't need to log in again. However I have found out that if: 1- the user logs in 2- bookmarks the page 3- closes the browser 4- opens the browser 5- goes to the saved bookmark page He has access to the page. I.e. the session did not close/terminate when he closed his browser ... In Netscape 7 I have checked the stored cookie and it is set to expire at the end of the session (which is the default I think), so I don't understand why the PHP thinks the session is still opened ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Coding HELP
Ok, make a form for upload with maybe fields as well where the user can write how many time that file is supposed to be downloaded. After submit you store that information in a database (MySQL) and when downloading files you do it through another PHP-file where you can check how many times it has been downloaded, if it reach the amount, delete it, otherwise update the database with one more download for this file! How to upload files can be read in the PHP-Manual. For database use: www.mysql.com Per L. Vicky [EMAIL PROTECTED] wrote in message 016801c2922c$71472720$0200a8c0@omnibook">news:016801c2922c$71472720$0200a8c0@omnibook... Thank you very much for everyone's help ^_^ I'm very much a novice in PHP, so whether I can actually figure out what I have to do'll be another thing *L* Thanks again ^_^ -Vicky -Original Message- From: Vicky [mailto:[EMAIL PROTECTED]] Sent: Friday, November 22, 2002 9:56 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP Coding HELP Hello! I am looking to find or code a script that does the following. If anyone could help I'd be extremely greatful. Users can upload their files, but the files they upload can only be downloaded X amount of times. After they've been downloaded so many times in an ideal world they'd be automatically removed, though just to be made so people couldn't download them anymore would be great. Please help! Thanks! Vicky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Newbie mail () question
I have just built a simple formmail script that validates certain fields and then if alls well mails the information to the client's email addressand displays some confirmatin html. This is all fine except for one minor issue. When I collect the email to check it looks OK etc the header From : in Outlook Express gives the www.servername.com Can I personalise this a bit to display the From: as the email address that the user has supplied i.e $Email I'm v. new to this so any help appreciated! TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CCO
Hi all, Before anything else, thanks for the answers to the last request of mine. Now, I'm trying to make a mailing script which is a very common task to do, but from this one, my client needs to send one e-mail to all the recipients stored in a DB every once in a while. I know that is best to send just one e-mail and add all the recipients to the hidden CC (CCO) instead of adding all of them to the TO header. Now, I usually use a very comfortable way to configure e-mails by setting all the $vaiables first and then adding a mail() function at the bottom, but I never used a CCO target variable and never less a loop to fetch all the addresses... any thoughts? By the way, I'm very used to work with FOR loops, so I'll try to keep using it. Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Newbie mail () question
Why don't you send your mailing code so the rest of us can see it, help you and maybe even learn something from you too... Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -Mensaje original- De: Duncan Ellwood [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 22 de noviembre de 2002 13:30 Para: [EMAIL PROTECTED] Asunto: [PHP] Newbie mail () question I have just built a simple formmail script that validates certain fields and then if alls well mails the information to the client's email addressand displays some confirmatin html. This is all fine except for one minor issue. When I collect the email to check it looks OK etc the header From : in Outlook Express gives the www.servername.com Can I personalise this a bit to display the From: as the email address that the user has supplied i.e $Email I'm v. new to this so any help appreciated! TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] phpUpLoad
Hi! I'm using phpUpLoad but when I try to upload a file I get this error - Warning: Unable to create '/home/silversa/AC/files/Amber.pet': No such file or directory in /home/silversa/public_html/AC/do_upload.php on line 9 Couldn't copy file. I made a directory called files in the folder incase that was the problem but it hasn't helped. I also made the path /usr/home/silversa/public_html/AC/ incase that was the problem but that didn't help either. Can you shed any light? Thanks ^_^ Vicky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DB] Forums?
www.invisionboard.com is great thought the skinning takes some getitng used to. If you aren't out for the absolute best like IB, go with XMB. http://www.xmbforum.com/. I haven't used it much but I hear it's easy to skin, features are great, and all that. The admin panel is kind of hard to use but you get used to it rather quickly... - Original Message - From: Paul Ihrig [EMAIL PROTECTED] To: [EMAIL PROTECTED]; 'Jason Vincent' [EMAIL PROTECTED] Sent: Friday, November 22, 2002 8:04 AM Subject: [PHP-DB] Forums? hey guys. a friend want help setting up a forum. what are some good easy to use ones out there? thanks -paul -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpUpLoad
I'm using phpUpLoad but when I try to upload a file I get this error - Warning: Unable to create '/home/silversa/AC/files/Amber.pet': No such file or directory in /home/silversa/public_html/AC/do_upload.php on line 9 Couldn't copy file. I made a directory called files in the folder incase that was the problem but it hasn't helped. I also made the path /usr/home/silversa/public_html/AC/ incase that was the problem but that didn't help either. Can you shed any light? Does the Web Server/PHP have permission to write in that directory? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpUpLoad
Need to ensure that your web sever is able to write to the location. You may need to chmod the dir to 775 or even 777 hope that helps. At 04:35 PM 11/22/2002 +, Vicky wrote: Hi! I'm using phpUpLoad but when I try to upload a file I get this error - Warning: Unable to create '/home/silversa/AC/files/Amber.pet': No such file or directory in /home/silversa/public_html/AC/do_upload.php on line 9 Couldn't copy file. I made a directory called files in the folder incase that was the problem but it hasn't helped. I also made the path /usr/home/silversa/public_html/AC/ incase that was the problem but that didn't help either. Can you shed any light? Thanks ^_^ Vicky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpUpLoad
Hint: Never change your directory or file to mod 777 that just invites hackers, plus it is a bad habit. The best thing is to make sure that your directory is owned by your apache server and that it is writeable for that user... Verify the user in your httpd.conf file and change the directory ownership to that user. Then give that user and only that user write access to it... On Fri, 2002-11-22 at 09:35, Vicky wrote: Hi! I'm using phpUpLoad but when I try to upload a file I get this error - Warning: Unable to create '/home/silversa/AC/files/Amber.pet': No such file or directory in /home/silversa/public_html/AC/do_upload.php on line 9 Couldn't copy file. I made a directory called files in the folder incase that was the problem but it hasn't helped. I also made the path /usr/home/silversa/public_html/AC/ incase that was the problem but that didn't help either. Can you shed any light? Thanks ^_^ Vicky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Newbie mail () question
I have just built a simple formmail script that validates certain fields and then if alls well mails the information to the client's email addressand displays some confirmatin html. This is all fine except for one minor issue. When I collect the email to check it looks OK etc the header From : in Outlook Express gives the www.servername.com Can I personalise this a bit to display the From: as the email address that the user has supplied i.e $Email I'm v. new to this so any help appreciated! Try this: //...snip $headers=From: $name $email\r\n; mail($recipient, $subject, $message, $headers); //...end The above code seems to work for me. -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: How to cache PHP on Apache
My header looks just like this: HTTP/1.0 200 OK Date: Sat, 16 Nov 2002 16:45:29 GMT Server: Apache/1.3.20 (Win32) PHP/4.0.6 Cache-Control: public, max-age=3600 Expires: Sat, 16 Nov 2002 17:45:29 GMT X-Powered-By: PHP/4.0.6 Content-Type: text/html And yes, we use sessions. So, setting session_cache_limiter() to public should solve my problem? The pragma header is what is missing? Instead of changing the code, could i use Apache´s mod_header to do the job? Thank you for the help! Luanna Do you use sessions? If so, try using session_cache_limiter() function. Otherwise connect directly to apache with telnet and see the headers yourself. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpUpLoad
Yup, both directorys are chmoded to 755. Lots of users are going to use this script so... I'm still not sure what's wrong or what to do hehe. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpUpLoad
You either need to make the directory 777 or change the ownership of the dir to apache or nobody (depending on which user httpd runs as) Adam On Fri, 22 Nov 2002, Vicky wrote: Yup, both directorys are chmoded to 755. Lots of users are going to use this script so... I'm still not sure what's wrong or what to do hehe. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help Porting PHP Sites from Solaris to RedHat 7.3
Hi All, I've been using PHP and FastTemplates for a couple of years on multiple platforms (Mac OSX, Win98, WinNT, Solaris). I've just installed RedHat 7.3 and FastTemplates doesn't work anymore. I get the message: Warning: Invalid content of \{\} in /var/www/cgi-bin/php/FastTemplate/class.FastTemplate.php4 on line 201 Here are the lines from FastTemplate: line 199 //php4 doesn't like '{$' combinations. line 200 $key = {.$key.}; line 201 $template = ereg_replace($key,$val,$template); I've applied the patch for FastTemplates and php4. The version of PHP that comes with RedHat 7.3 is 4.1.2 which is the same as my Mac OSX which works fine. One of the only differences I see is that with phpinfo the RedHat systems are using the system regex library and the others are using the bundled library. This is the default installation with RH7.3. Any Clues? Thanks, Gary Smith -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpUpLoad
I tried making the dir. 777 too, but it didn't work. How do I change the ownership of the dir? -Vicky - Original Message - From: Adam Williams [EMAIL PROTECTED] To: Vicky [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, November 22, 2002 6:35 PM Subject: Re: [PHP] phpUpLoad You either need to make the directory 777 or change the ownership of the dir to apache or nobody (depending on which user httpd runs as) Adam On Fri, 22 Nov 2002, Vicky wrote: Yup, both directorys are chmoded to 755. Lots of users are going to use this script so... I'm still not sure what's wrong or what to do hehe. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Opening a socket and sending GET data
I am able to open a socket and send POST data, however I do not know the format of doing the same for the GET method. Here is my POST Query: Query: POST http://209.204.172.137:80/_calendar/php/selectevent.php HTTP/1.0 Accept-Language: en-us Host: 209.204.172.137:80 Connection: close Content-type: application/x-www-form-urlencoded Content-length: 125 pa_county=reenter_page=1sel_from_mo=Novembersel_from_dy=22sel_from_yr=2002sel_to_mo=Decembersel_to_dy=06sel_to_yr=2002 Any help would be greatly appreciated --
Re: [PHP] phpUpLoad
On Fri, 22 Nov 2002, Adam Williams wrote: You either need to make the directory 777 or change the ownership of the dir to apache or nobody (depending on which user httpd runs as) Adam ... or use a wrapper SUID to the user or group who owns the dir and have it wrap a back-end script that actually does the work. I've used this effectively, and so long as the back-end script is properly written I believe it's a very secure method. -- Morgan Hughes C programmer and highly caffeinated mammal. [EMAIL PROTECTED] ICQ: 79293356 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Capturing multiple select with Javascript - nearly ther
My original reply may have got lost in the sending, so thanks for the info in case you didn't receive it. Phoebe. Mike Ford wrote: -Original Message- From: Phoebe Bright [mailto:[EMAIL PROTECTED]] Sent: 19 November 2002 14:20 My remaining problem is that the array that PHP sees only has the final few characters of the values it should have. This is the result of print_r after selecting two items (analysis1 and analysis3): Array ( [0] = ysis1 [1] = ysis3 ) expecting: Array ( [0] = analysis1 [1] = analysis3 ) Known bug. A quick search of http://bugs.php.net/ for character cut off form array reveals half a dozen reports for this, of which this is probably the most informative: http://bugs.php.net/bug.php?id=19518. Basically, you need to configure PHP without --enable-mbstr-enc-trans (or install 4.3.0RC1, if that's acceptable for you). Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpUpLoad
in your shell or ftp type chmod 777 files Vicky wrote: I tried making the dir. 777 too, but it didn't work. How do I change the ownership of the dir? -Vicky - Original Message - From: Adam Williams [EMAIL PROTECTED] To: Vicky [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, November 22, 2002 6:35 PM Subject: Re: [PHP] phpUpLoad You either need to make the directory 777 or change the ownership of the dir to apache or nobody (depending on which user httpd runs as) Adam On Fri, 22 Nov 2002, Vicky wrote: Yup, both directorys are chmoded to 755. Lots of users are going to use this script so... I'm still not sure what's wrong or what to do hehe. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Opening a socket and sending GET data
This is your same HTTP request using the GET method rather than POST to send the same data. GET http://209.204.172.137/_calendar/php/selectevent.php?pa_county=reenter_page=1sel_from_mo=Novembersel_from_dy=22sel_from_yr=2002sel_to_mo=Decembersel_to_dy=06sel_to_yr=2002 HTTP/1.1 Host: 209.204.172.137 Accept-Language: en-us Connection: Close --- Todd Cary [EMAIL PROTECTED] wrote: I am able to open a socket and send POST data, however I do not know the format of doing the same for the GET method. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail() problem...
Hi, i wrote a helpdesk script, which can send the user emails, if requested. The helpdesk sends emails as [EMAIL PROTECTED], but some servers don't accept nobody as the sender! do you know how i can change that? i don't mean the From: header, but the real sender header of the email... e.g.: Received: from nobody by hostname.mydomain.com with local (Exim .. Would i have to change the apache user to change this? I mean, there are so many scripts out there and they all have a proper Received: from... header, so i guess i simply overlooked s.th. Thanks for your help, Duncan . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ob_output
Hi! here is my test code ?php ob_start(); for ($n=1;$n10;$n++) { echo testbr; ob_end_flush(); sleep(2); } ? I can make this work on php and apache. I always get output in one shot not line by line. If i try this code with php and iis it works. What am i doing wrong. Do i have to tell apache to send line by line to browser not everything together. -- lp, Uros -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: How to cache PHP on Apache
Luanna, This response allows caching, but the cached response is only considered fresh for one hour (which might be appropriate for you), as is determined by both the Expires header and the max-age attribute of the Cache-Control header. The Pragma header is defined under HTTP/1.0 and is only used when backwards compatibility with HTTP/1.0 Web agents is required (meaning, Web agents that do not support HTTP/1.1). The absence of Pragma will not restrict caching in any way, however, even with an HTTP/1.0 cache. You can use PHP's header() function to manipulate headers. One thing I am not clear on is whether this type of caching is what you were originally inquiring about. The HTTP headers specify what restrictions are placed on the ability for a caching system to cache this HTTP response. It has nothing to do with caching the PHP script in any way on the server. If that latter sounds more like what you are interested in, there are several products that can help with this also. One is Zend Cache. Chris --- Luanna Silva [EMAIL PROTECTED] wrote: My header looks just like this: HTTP/1.0 200 OK Date: Sat, 16 Nov 2002 16:45:29 GMT Server: Apache/1.3.20 (Win32) PHP/4.0.6 Cache-Control: public, max-age=3600 Expires: Sat, 16 Nov 2002 17:45:29 GMT X-Powered-By: PHP/4.0.6 Content-Type: text/html And yes, we use sessions. So, setting session_cache_limiter() to public should solve my problem? The pragma header is what is missing? Instead of changing the code, could i use Apache´s mod_header to do the job? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() problem...
This header is added by mail server, so you must change the apache user. Duncan wrote: Hi, i wrote a helpdesk script, which can send the user emails, if requested. The helpdesk sends emails as [EMAIL PROTECTED], but some servers don't accept nobody as the sender! do you know how i can change that? i don't mean the From: header, but the real sender header of the email... e.g.: Received: from nobody by hostname.mydomain.com with local (Exim .. Would i have to change the apache user to change this? I mean, there are so many scripts out there and they all have a proper Received: from... header, so i guess i simply overlooked s.th. Thanks for your help, Duncan . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ob_output
On Fri, 22 Nov 2002, Uros Gruber wrote: ob_end_flush(); This turns off output buffering after flushing, the first time it gets called in the first iteration of your for() loop. I can make this work on php and apache. I always get output in one shot not line by line. If i try this code with php and iis it works. Try using ob_flush() instead. http://www.php.net/ob_flush This function does not destroy the output buffer like ob_end_flush() does. What's odd is that it works like you want it to in IIS g.luck, ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] ob_output
Hi! I changed it to ob_flush() and the problem still exist. Check the link and you'll se. http://www.kud-igen.si/link.php I have 3 apache servers and no one works as i want to. But iis makes no problems. -- bye, Uros Friday, November 22, 2002, 8:32:56 PM, you wrote: CW On Fri, 22 Nov 2002, Uros Gruber wrote: ob_end_flush(); CW This turns off output buffering after flushing, the first time it gets CW called in the first iteration of your for() loop. I can make this work on php and apache. I always get output in one shot not line by line. If i try this code with php and iis it works. CW Try using ob_flush() instead. http://www.php.net/ob_flush CW This function does not destroy the output buffer like ob_end_flush() CW does. CW What's odd is that it works like you want it to in IIS CW g.luck, CW ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ob_output
You need to use flush() to try and send a chunked response that will display on the user's browser line at a time like that. Output buffering is fairly closely related I suppose, but it is a separate thing. As far as I know, you cannot flush() with output buffering started unless you end or flush that output buffering first. However, output buffering is not required for what you are wanting to do, so only use it if you also need that. I wrote a quick little example of displaying a bulleted list one item at a time that might be helpful to you: http://shiflett.org/tutorials/php_flush.txt Chris --- Uros Gruber [EMAIL PROTECTED] wrote: ?php ob_start(); for ($n=1;$n10;$n++) { echo testbr; ob_end_flush(); sleep(2); } ? I can make this work on php and apache. I always get output in one shot not line by line. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RES: [PHP] RE: How to cache PHP on Apache
Chris, your explanation was just what i needed to really understand my problem :-) For the moment, i want to cache the HTTP Response. So, if i´m correct, the header that i sent to the list should do the job. I have: Apache Web Server 1.3.x A Reverse Proxy The client(IE 5.00) I thought that, if the responses were cached, the access.log file would have 304 codes on the responses for php scripts. Is that correct? Well, if it is, that´s not happening. If its not, i´m pretty lost :-) Thank you for the explanation! Luanna -Mensagem original- De: Chris Shiflett [mailto:[EMAIL PROTECTED]] Enviada em: sexta-feira, 22 de novembro de 2002 17:32 Para: Luanna Silva; [EMAIL PROTECTED] Assunto: Re: [PHP] RE: How to cache PHP on Apache Luanna, This response allows caching, but the cached response is only considered fresh for one hour (which might be appropriate for you), as is determined by both the Expires header and the max-age attribute of the Cache-Control header. The Pragma header is defined under HTTP/1.0 and is only used when backwards compatibility with HTTP/1.0 Web agents is required (meaning, Web agents that do not support HTTP/1.1). The absence of Pragma will not restrict caching in any way, however, even with an HTTP/1.0 cache. You can use PHP's header() function to manipulate headers. One thing I am not clear on is whether this type of caching is what you were originally inquiring about. The HTTP headers specify what restrictions are placed on the ability for a caching system to cache this HTTP response. It has nothing to do with caching the PHP script in any way on the server. If that latter sounds more like what you are interested in, there are several products that can help with this also. One is Zend Cache. Chris --- Luanna Silva [EMAIL PROTECTED] wrote: My header looks just like this: HTTP/1.0 200 OK Date: Sat, 16 Nov 2002 16:45:29 GMT Server: Apache/1.3.20 (Win32) PHP/4.0.6 Cache-Control: public, max-age=3600 Expires: Sat, 16 Nov 2002 17:45:29 GMT X-Powered-By: PHP/4.0.6 Content-Type: text/html And yes, we use sessions. So, setting session_cache_limiter() to public should solve my problem? The pragma header is what is missing? Instead of changing the code, could i use Apache´s mod_header to do the job? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() problem...
Hi, The helpdesk sends emails as [EMAIL PROTECTED], but some servers don't accept nobody as the sender! do you know how i can change that? i don't mean the From: header, but the real sender header of the email... I don't know if this is a good way to do things or not, but I have scripts that send mail as several different addresses, and I do it this way: mail('user@wherever', 'Test', 'Test', 'From: [EMAIL PROTECTED]', '[EMAIL PROTECTED]'); (Outlook may screw that line up a bit, and if it does, I apologize). Sara Keesler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() problem...
Oh, i see. Thanks. Marek Kilimajer wrote: This header is added by mail server, so you must change the apache user. Duncan wrote: Hi, i wrote a helpdesk script, which can send the user emails, if requested. The helpdesk sends emails as [EMAIL PROTECTED], but some servers don't accept nobody as the sender! do you know how i can change that? i don't mean the From: header, but the real sender header of the email... e.g.: Received: from nobody by hostname.mydomain.com with local (Exim .. Would i have to change the apache user to change this? I mean, there are so many scripts out there and they all have a proper Received: from... header, so i guess i simply overlooked s.th. Thanks for your help, Duncan . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session Problem
Hi all, I'm having this strange issue with a remote server. I'm trying to create a session control for administrative use which works fine in my PC but once I upload these scripts to that server, it doesn't recognize the $username $password variables and kick me right into the else{} of the login.php script. Here's my code: if ($username $password) { $db_conn = mysql_connect(www.icaam.com.ar, icaam, xxx); mysql_select_db(icaam, $db_conn); $query = SELECT * FROM maraadmins WHERE adminuser = '$username' AND adminpassword = password('$password'); $result = mysql_query($query, $db_conn); if (mysql_num_rows($result) 0) { $row = mysql_fetch_array($result); $valid_admin = $row['adminid']; session_register(valid_admin); header(Location: admin.php); exit; } else { header(Location: ../login.html); exit; } } else { //header(Location: ../login.html); //exit; echo nothing; } Any thoughts?? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FAQ a good idea?
An about register globals post bi-weekly would eliminate tons of questions I reckon. But maxim is also right. People should find their own info and a faq could dominate the group... The fact you must call session_start before sending anything to the browser is another FAQ that would help. An interest of FAQ, is that it helps beginners to find some answers they need quickly, so they will be more interested in continuing PHP. It helps making the language even more attractive, because it is a part of the language support. An FAQ can also remind the first places where information can be found, where one should search before asking. So, before someone asks is there a function to do this, the FAQ could tell how to find said function, pointing out the most commonly used sections in the documentation. Strings, regular expressions, arrays, date/time are the ones that come out of my mind when wondering what do I use most often. Vincent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session Problem
Seems like the remote server has register_globals off. You must use $_GET, $_POST, $_SESSION ... Cesar Aracena wrote: Hi all, I'm having this strange issue with a remote server. I'm trying to create a session control for administrative use which works fine in my PC but once I upload these scripts to that server, it doesn't recognize the $username $password variables and kick me right into the else{} of the login.php script. Here's my code: if ($username $password) { $db_conn = mysql_connect(www.icaam.com.ar, icaam, xxx); mysql_select_db(icaam, $db_conn); $query = SELECT * FROM maraadmins WHERE adminuser = '$username' AND adminpassword = password('$password'); $result = mysql_query($query, $db_conn); if (mysql_num_rows($result) 0) { $row = mysql_fetch_array($result); $valid_admin = $row['adminid']; session_register(valid_admin); header(Location: admin.php); exit; } else { header(Location: ../login.html); exit; } } else { //header(Location: ../login.html); //exit; echo nothing; } Any thoughts?? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session Problem
Is it your register_globals setting? ---John Holmes... - Original Message - From: Cesar Aracena [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 22, 2002 2:59 PM Subject: [PHP] Session Problem Hi all, I'm having this strange issue with a remote server. I'm trying to create a session control for administrative use which works fine in my PC but once I upload these scripts to that server, it doesn't recognize the $username $password variables and kick me right into the else{} of the login.php script. Here's my code: if ($username $password) { $db_conn = mysql_connect(www.icaam.com.ar, icaam, xxx); mysql_select_db(icaam, $db_conn); $query = SELECT * FROM maraadmins WHERE adminuser = '$username' AND adminpassword = password('$password'); $result = mysql_query($query, $db_conn); if (mysql_num_rows($result) 0) { $row = mysql_fetch_array($result); $valid_admin = $row['adminid']; session_register(valid_admin); header(Location: admin.php); exit; } else { header(Location: ../login.html); exit; } } else { //header(Location: ../login.html); //exit; echo nothing; } Any thoughts?? Thanks in advance, Cesar L. Aracena [EMAIL PROTECTED] [EMAIL PROTECTED] (0299) 156-356688 Neuquén (8300) Capital Argentina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie mail () question
At 11/22/2002 04:30 PM, Duncan Ellwood wrote: Can I personalise this a bit to display the From: as the email address that the user has supplied i.e $Email You can specify the FROM field in the headers before you call the mail() function. It's all in the manual. http://www.php.net/manual/en/function.mail.php See Example #2. -- S. Keller UI Engineer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Pkwy. Anchorage, AK 99508 907.770.6200 ext.220 907.336.6205 (fax) Email: [EMAIL PROTECTED] Web: www.healthtvchannel.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Php search results
you could also use regular expressions, but php isn't perl, so good luck on that one :p. Philip Hallstrom [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... You could use strstr() to find the index location of the string searched for in FIELD. Then use substr() to return say 50 characters on either side... -philip On Thu, 21 Nov 2002, Daniel Masson wrote: Hello everyone ... Im working on some kind of search engine for two little tables on text fields on mssql, and the text fields can be very large fields, im doing the search with SELECT FIELD FROM TABLE WHERE FIELD LIKE '%SOMTHING%' .. My question is: When displaying the search results i dont want to display the entire field, only the specific parts where the keyword was found , and bold for the keyword and i just dony know how to to do that, i mean displaying the keyword in bold is no problem .. I need to know how to display only the parts where this keyword is. Any help will be very helpful Thanks every1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: RES: [PHP] RE: How to cache PHP on Apache
Well, my explanation was not complete, because I wanted to make sure I was talking about the right thing. :-) One important thing I failed to mention is that caching applies to responses to GET and HEAD requests. If the response you showed us was a reply to a POST, it is not going to be cached. As far as the 304 responses are concerned, this depends in part on the Web browser. For example, if the browser sends a conditional GET request with an If-Modified-Since header (it has a date as a value), the Web server will make a decision. If the resource being requested has in fact been modified since the specified date, the entire resource is returned in a 200 OK response. If it has remained unchanged, a 304 Not Modified response is sent with no content, saving bandwidth. If you would like a good example to compare responses with, request an image from your Web server and notice the HTTP headers used. If you take a page such as Google as an example, your browser requests http://www.google/com first, receives the HTML from that, then notices the embedded image and requests http://www.google.com/images/logo.gif in a separate request. If you are like me and visit Google all the time, your browser has this image saved and rarely (usually only on holidays) gets anything but a 304 response from Google. So, for pages you make available via GET requests that you want to be cachable in the same way as Google's logo, you can start by mimicking what they do. Here is an example of the HTTP transactions required to see http://www.google.com/ (HTML and some headers edited for readability): -- GET / HTTP/1.1 Host: www.google.com User-Agent: Mozilla/5.0 (...) Accept: text/xml, ... Accept-Language: en-us, en;q=0.50 Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66 Keep-Alive: 300 Cache-Control: max-age=0 -- HTTP/1.1 200 OK Content-Length: 9390 Server: GWS/2.0 Date: Fri, 22 Nov 2002 20:31:18 GMT Content-Type: text/html Cache-control: private html... -- GET /images/logo.gif HTTP/1.1 Host: www.google.com User-Agent: Mozilla/5.0 (...) Accept-Language: en-us, en;q=0.50 Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66 Keep-Alive: 300 Accept: video/x-mng, ... Referer: http://www.google.com/ If-Modified-Since: Mon, 21 Oct 2002 02:32:25 GMT Cache-Control: max-age=0 -- HTTP/1.1 304 Not Modified Content-Length: 0 Server: GWS/2.0 Content-Type: text/html Date: Fri, 22 Nov 2002 20:31:19 GMT -- Hopefully that provides a little more information to get you going. Chris --- Luanna Silva [EMAIL PROTECTED] wrote: For the moment, i want to cache the HTTP Response. So, if i´m correct, the header that i sent to the list should do the job. I thought that, if the responses were cached, the access.log file would have 304 codes on the responses for php scripts. Is that correct? Well, if it is, that´s not happening. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] writing functions to preform mysql queries
Hi, I'm trying to separate my database query code from my application logic. I want to do this by creating a small application-level library with functions that INSERT, DELETE and UPDATE specific information in a mysql database. So I created a file called news_mysql.lib.php and put it in a /library directory. It has functions that look something like this: function get_news_item($id) { // boundary and error checking, strip out potentially nasty SQL stuff // build the SQL statement $result = $mysql_query($sql); return mysql_fetch_array($result); } // and so on... My news.php file looks something like: require_once('path/to/library/news_mysql.lib.php'); $id = $_GET['id']; $news_item = get_news_item($id); if (count($news_item) = 0) { echo 'h1Error/h1'; // deal with the error } else { echo 'h1' . $news_item['headline'] . '/h1'; echo 'h4' . $news_item['date'] . '/h4'; echo 'p' . $news_item['body'] . '/p'; } // and so on... This works great for UPDATE, INSERT and DELETE statements, but not so well for SELECT statements that return more than one row. The first problem is that mysql_fetch_array() works so well for stepping through the mysql result set, but I don't know how to duplicate it's functionality in a library function. The second problem is that even though I might SELECT information from the same table in a database several times in my application, each time the query might be a little different. Sometimes I want the information sorted in a certain way, for example. So I don't want to use a bunch of bit flags to identify exactly which information I need. The best I can come up with is to make an exception for the one function that will return more than one record, and get it to accept an SQL string as input (instead of a couple parameters), to return a mysql resource identifier, and then to use mysql_fetch_array on that resource identifier and step through the results in a while loop as I would normally. What's the better way of doing this? Thank you, Beau -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Recommendations for PHP/MySQl calendar on-line submission/voting
All, I working with helping our local high school technical center set up a web server/site. Went with the typical AMP solution (unfortunately on MSWin though). The center is wanting to add an on-line calendar system. This doesn't need to be anything fancy, just something that will display a monthly view with event titles, a way to provide detail content for the event, and a way for multiple users to add/edit/remove entries. I'm doing some searching for solutions but there's definitely plenty to choose from., so if anyone has any recommendations I'd appreciate it. Also, the school tries to get a lot of community involvement by doing a lot of Name the ... whatever the activity is at time competitions and they are wanting to come up with a way to do online entry submission and online voting/polling of the entries. Obviously I could write this, but was wondering if anybody had any suggestions of existing code to do this. TIA Dave Merritt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Simple RegExp Problem...
Thanks so much!!! It works. I didn't know I could also place extra characters inside the brackets to specify what I want. :) -Original Message- From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED]] Sent: Friday, November 22, 2002 7:19 AM To: @ Nilaab Cc: Php-General Subject: Re: [PHP] Simple RegExp Problem... At 13:38 22.11.2002, @ Nilaab spoke out and said: [snip] Ok, I know this is easy for most of you, and believe me I've been searching and trying to learn all about regular expressions, but I can't seem figure out how to allow addition of spaces between characters. $text = Here is some text; Here, I want to be able to match the alpha characters as well as the spaces in between each word. So far I have: preg_match(/^[a-zA-Z]+$/, $text); But that only matches a single word without spaces. I would like to try to stay away from ereg and use preg_match instead because I heard preg_match is faster. ereg() has a way to match spaces by specifying [[:space:]], but I didn't get that solution to work either. How do I match $text to return true? [snip] use preg_match('/^[a-zA-Z\s]+$/', $text); \s - any [:space:] \S - anything not [:space:] -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] writing to a file
On Fri, 22 Nov 2002, Jason Wong wrote: On Friday 22 November 2002 16:34, gamin wrote: Hello, file as the data is being written, not when the file is closed I think you should try fclose() the file before you die! Or, if you need to force the data out to disk while writing, use fflush()... -- Morgan Hughes C programmer and highly caffeinated mammal. [EMAIL PROTECTED] ICQ: 79293356 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Keywords in includes
I am moving my website over to PHP but there are two things I'm not sure of. First: Do search engines find their keywords if they are in an include instead of the main PHP file? (strictly speaking, I think they are not really in the URL you gave them) In other words, does it read the source code after it is output (which does contain the include contents)? Just to be on the safe side, I left a redundant file.htm copy (apart from file.php) of the pages with best search engine results, as bait for the engines. Is this unnecessary? Second: Also, I haven't changed over the home page, which is still all-html, because I'm dreaming that the host's PHP might fail or something. I imagine this is sheer paranoia, but could somebody please confirm if there is any security benefit in doing so? Thanks Alberto http://estudiobrea.com