php-general Digest 7 Feb 2009 10:53:34 -0000 Issue 5945
php-general Digest 7 Feb 2009 10:53:34 - Issue 5945 Topics (messages 287862 through 287890): Re: Clarity needed OT 287862 by: Frank Stanovcak 287863 by: Daniel Brown 287871 by: Ashley Sheridan 287873 by: Shawn McKenzie 287878 by: Daniel Brown 287883 by: Phpster Re: long echo statement performance question 287864 by: Sancar Saran 287865 by: Stephen Re: Clarity needed (Really OT) 287866 by: Nathan Rixham 287867 by: Shawn McKenzie 287868 by: Shawn McKenzie Re: DB Comparisons 287869 by: Ashley Sheridan 287877 by: Andrew Ballard Re: Email configuration 287870 by: Ashley Sheridan 287872 by: Shawn McKenzie 287874 by: Nathan Rixham 287875 by: Nathan Rixham 287876 by: Nathan Rixham 287880 by: Shawn McKenzie 287881 by: Nathan Rixham 287882 by: Ashley M. Kirchner Re: PHP pop-up windows 287879 by: Clancy Re: Using DLL with PHP 287884 by: Phpster Session variables 287885 by: Paul M Foster 287886 by: Phpster 287887 by: German Geek 287888 by: Stuart 287889 by: German Geek move_uploaded_file() problem 287890 by: DuÅ¡an NovakoviÄ Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Daniel Brown danbr...@php.net wrote in message news:ab5568160902061416u10e761dal224ec7177d83e...@mail.gmail.com... On Fri, Feb 6, 2009 at 13:46, Frank Stanovcak blindspot...@comcast.net wrote: Ok...I'm sure that somewhere in here has to be reference to the original topic, and php...right? Frank...there is isn't there? *sigh* Stick around you'll see this happens frequently. It's considered a Good Thing[tm]. It maintains a level of sanity among the community. -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Unadvertised dedicated server deals, too low to print - email me to find out! since when have the words 'sanity', and 'programmer' ever been used together outside of the setup for a joke? Frank...still faithfully taking his pills. ---End Message--- ---BeginMessage--- On Fri, Feb 6, 2009 at 17:26, Frank Stanovcak blindspot...@comcast.net wrote: since when have the words 'sanity', and 'programmer' ever been used together outside of the setup for a joke? Frank...still faithfully taking his pills. This guy fits in well 'round there here parts. ;-P -- /Daniel P. Brown daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ Unadvertised dedicated server deals, too low to print - email me to find out! ---End Message--- ---BeginMessage--- On Fri, 2009-02-06 at 13:13 -0500, tedd wrote: At 1:55 AM +0100 2/6/09, Jochem Maas wrote: that tedd's unlimited educational resources (tutors/courses) might go someway to undoing all the harm Fox News inflicts on the masses. Or to provide clarity to those who think that Fox News is doing harm. Alter all, the main-stream news doesn't like reporting unfavorable things about their favorites celebrities, do they? Keep in mind that not paying taxes by elected officials has not met the same threshold of reporting not knowing how to speak publicly has made. I would rather have all politicians stammer in their speeches and pay their taxes than the other way around. In fact, it would be nice if the politicians would get their facts/words straight. For example, the Speaker of the House just announced that Last month over 500 million people lost their jobs in her support for the importance of rushing the approval of the Stimulus package (whatever that is). In any event, it's interesting to realize that accordingly to her, EVERYONE in the USA lost their job last month and two thirds of the population lost it twice! It would be nice if the Speaker of the House at least realized how many people actually live in the country she represents. BUT -- you didn't hear that on the main-stream news -- or -- if you did, they didn't make much of it, right? However, if Bush had said it, that would have been something different -- it would be headline news and on Saturday Night Live. Clearly, there is a difference in news reporting today. There are no impartial sources -- everything has biases and spin. The days of Walter Cronkite reporting are over. Viva opposing opinions. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com Come off it. Look around you, there are government conspiracies everywhere. I shouldn't even be saying
php-general Digest 8 Feb 2009 01:24:58 -0000 Issue 5946
php-general Digest 8 Feb 2009 01:24:58 - Issue 5946 Topics (messages 287891 through 287914): Re: move_uploaded_file() problem 287891 by: DuÅ¡an NovakoviÄ 287892 by: Alpár Török 287893 by: DuÅ¡an NovakoviÄ 287895 by: Chris 287896 by: Carlos Medina 287897 by: Ashley Sheridan 287899 by: Alpár Török 287900 by: German Geek Re: Session variables 287894 by: Nathan Rixham Re: Email configuration 287898 by: Ashley Sheridan Re: Some kind of Popup 287901 by: Patrick Moloney 287902 by: Ashley Sheridan 287903 by: Phpster 287904 by: Patrick Moloney 287905 by: Ashley Sheridan Marketing Job Openings Available 287906 by: Nandy Edwards Adding Records Capture The New Record ID 287907 by: revDAVE 287908 by: Stuart 287910 by: revDAVE 287911 by: Stuart 287912 by: tedd 287914 by: Ashley Sheridan Sending XML requests as raw post data 287909 by: Marc Steinert 287913 by: Alpár Török Administrivia: To subscribe to the digest, e-mail: php-general-digest-subscr...@lists.php.net To unsubscribe from the digest, e-mail: php-general-digest-unsubscr...@lists.php.net To post to the list, e-mail: php-gene...@lists.php.net -- ---BeginMessage--- Hi, I'm having problem with function move_uploaded_file() under Linux (Slackware 12.2). It simply won't execute only that function in php file. So maybe I should add something to http.config file or ? I tried to execute that php file under Windows and it's working just fine (I've copied whole project to xampp's htdocs folder and run it normally). And also I have question, does anyone knows how to configure apache (also under same Linux) so that in future I wouldn't have to write ?php but only ? every time I start php code? Thnx, Dusan On Sat, Feb 7, 2009 at 11:53 AM, Dušan Novaković ndu...@gmail.com wrote: Hi, I'm having problem with function move_uploaded_file() under Linux (Slackware 12.2). It simply want execute only that function in php file. So maybe I should add something to http.config file or ? I tried to execute that php file under Windows and it's working just fine (I've copied whole project to xampp's htdocs folder and run it normally). And also I have question, does anyone knows how to configure apache (also under same Linux) so that in future I wouldn't have to write ?php but only ? every time I start php code? Thnx, Dusan -- made by Dusan -- made by Dusan ---End Message--- ---BeginMessage--- 2009/2/7 Dušan Novaković ndu...@gmail.com Hi, I'm having problem with function move_uploaded_file() under Linux (Slackware 12.2). It simply won't execute only that function in php file. So maybe I should add something to http.config file or ? I tried to execute that php file under Windows and it's working just fine (I've copied whole project to xampp's htdocs folder and run it normally). Can you show some code? And also I have question, does anyone knows how to configure apache (also under same Linux) so that in future I woul dn't have to write ?php but only ? every time I start php code? You need to change the enable_short_tags directive. It is probably more simple to do it in the php.ini configuration file and not in the apache configuration file, but you should know that short tags are off by default because they conflict with xml. Thnx, Dusan On Sat, Feb 7, 2009 at 11:53 AM, Dušan Novaković ndu...@gmail.com wrote: Hi, I'm having problem with function move_uploaded_file() under Linux (Slackware 12.2). It simply want execute only that function in php file. So maybe I should add something to http.config file or ? I tried to execute that php file under Windows and it's working just fine (I've copied whole project to xampp's htdocs folder and run it normally). And also I have question, does anyone knows how to configure apache (also under same Linux) so that in future I wouldn't have to write ?php but only ? every time I start php code? Thnx, Dusan -- made by Dusan -- made by Dusan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Alpar Torok ---End Message--- ---BeginMessage--- On Sat, Feb 7, 2009 at 12:29 PM, Alpár Török torokal...@gmail.com wrote: 2009/2/7 Dušan Novaković ndu...@gmail.com Hi, I'm having problem with function move_uploaded_file() under Linux (Slackware 12.2). It simply won't execute only that function in php file. So maybe I should add something to http.config file or ? I tried to execute that php file under Windows and it's working just fine (I've copied whole project to xampp's htdocs folder and run it normally). Can you show some code? This is part where I use function
Re: [PHP] Session variables
2009/2/7 Paul M Foster pa...@quillandmouse.com: I'm not too clear on HTTP headers, cookies, and such. So here are questions related to that. Let's say I generate a random number that I want the user to enter in a form. When I generate the number, I store it in a session variable ($_SESSION). When the user submits the form, I check the number they enter with what I've stored in the session variable. Since this session variable survives across page loads (assuming session_start() is appropriately called), how is it stored and recalled? Is it automatically stored as a cookie on the user's system? Or is it stored on the server? And how does a server get a cookie? Is it a separate request made by the server to the client? If the value I've asked the user for is *not* stored as a cookie, then is it passed as part of the HTTP submission or what? Thanks for any enlightenment on this. Session data is stored on the server and tied to a browser using a cookie. The cookie contains a random string which uniquely identifies a session on the server. The session_start() function handles all the details of setting and maintaining that cookie and managing the server-side data. Cookies are transferred between client and server with every request in the headers. If you don't have Firefox getfirefox.com. The google for the livehttpheaders addon and install that. Turn it on and browse your site. You will see the cookies in the headers of both requests and responses. Cookies are not stored on the server side, they are sent by the client with each request. No additional HTTP requests are involved when using sessions. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session variables
Yeah i guess the cookie doesn't need to be stored on the server since it's in the header anyway. Thanks for clearing that up. Tim-Hinnerk Heuer http://www.ihostnz.com Charles M. Schulz - I love mankind; it's people I can't stand. 2009/2/7 Stuart stut...@gmail.com 2009/2/7 Paul M Foster pa...@quillandmouse.com: I'm not too clear on HTTP headers, cookies, and such. So here are questions related to that. Let's say I generate a random number that I want the user to enter in a form. When I generate the number, I store it in a session variable ($_SESSION). When the user submits the form, I check the number they enter with what I've stored in the session variable. Since this session variable survives across page loads (assuming session_start() is appropriately called), how is it stored and recalled? Is it automatically stored as a cookie on the user's system? Or is it stored on the server? And how does a server get a cookie? Is it a separate request made by the server to the client? If the value I've asked the user for is *not* stored as a cookie, then is it passed as part of the HTTP submission or what? Thanks for any enlightenment on this. Session data is stored on the server and tied to a browser using a cookie. The cookie contains a random string which uniquely identifies a session on the server. The session_start() function handles all the details of setting and maintaining that cookie and managing the server-side data. Cookies are transferred between client and server with every request in the headers. If you don't have Firefox getfirefox.com. The google for the livehttpheaders addon and install that. Turn it on and browse your site. You will see the cookies in the headers of both requests and responses. Cookies are not stored on the server side, they are sent by the client with each request. No additional HTTP requests are involved when using sessions. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] move_uploaded_file() problem
Hi, I'm having problem with function move_uploaded_file() under Linux (Slackware 12.2). It simply want execute only that function in php file. So maybe I should add something to http.config file or ? I tried to execute that php file under Windows and it's working just fine (I've copied whole project to xampp's htdocs folder and run it normally). And also I have question, does anyone knows how to configure apache (also under same Linux) so that in future I wouldn't have to write ?php but only ? every time I start php code? Thnx, Dusan -- made by Dusan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: move_uploaded_file() problem
Hi, I'm having problem with function move_uploaded_file() under Linux (Slackware 12.2). It simply won't execute only that function in php file. So maybe I should add something to http.config file or ? I tried to execute that php file under Windows and it's working just fine (I've copied whole project to xampp's htdocs folder and run it normally). And also I have question, does anyone knows how to configure apache (also under same Linux) so that in future I wouldn't have to write ?php but only ? every time I start php code? Thnx, Dusan On Sat, Feb 7, 2009 at 11:53 AM, Dušan Novaković ndu...@gmail.com wrote: Hi, I'm having problem with function move_uploaded_file() under Linux (Slackware 12.2). It simply want execute only that function in php file. So maybe I should add something to http.config file or ? I tried to execute that php file under Windows and it's working just fine (I've copied whole project to xampp's htdocs folder and run it normally). And also I have question, does anyone knows how to configure apache (also under same Linux) so that in future I wouldn't have to write ?php but only ? every time I start php code? Thnx, Dusan -- made by Dusan -- made by Dusan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: move_uploaded_file() problem
2009/2/7 Dušan Novaković ndu...@gmail.com Hi, I'm having problem with function move_uploaded_file() under Linux (Slackware 12.2). It simply won't execute only that function in php file. So maybe I should add something to http.config file or ? I tried to execute that php file under Windows and it's working just fine (I've copied whole project to xampp's htdocs folder and run it normally). Can you show some code? And also I have question, does anyone knows how to configure apache (also under same Linux) so that in future I woul dn't have to write ?php but only ? every time I start php code? You need to change the enable_short_tags directive. It is probably more simple to do it in the php.ini configuration file and not in the apache configuration file, but you should know that short tags are off by default because they conflict with xml. Thnx, Dusan On Sat, Feb 7, 2009 at 11:53 AM, Dušan Novaković ndu...@gmail.com wrote: Hi, I'm having problem with function move_uploaded_file() under Linux (Slackware 12.2). It simply want execute only that function in php file. So maybe I should add something to http.config file or ? I tried to execute that php file under Windows and it's working just fine (I've copied whole project to xampp's htdocs folder and run it normally). And also I have question, does anyone knows how to configure apache (also under same Linux) so that in future I wouldn't have to write ?php but only ? every time I start php code? Thnx, Dusan -- made by Dusan -- made by Dusan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Alpar Torok
Re: [PHP] Re: move_uploaded_file() problem
On Sat, Feb 7, 2009 at 12:29 PM, Alpár Török torokal...@gmail.com wrote: 2009/2/7 Dušan Novaković ndu...@gmail.com Hi, I'm having problem with function move_uploaded_file() under Linux (Slackware 12.2). It simply won't execute only that function in php file. So maybe I should add something to http.config file or ? I tried to execute that php file under Windows and it's working just fine (I've copied whole project to xampp's htdocs folder and run it normally). Can you show some code? This is part where I use function move_uploaded_file() if($_FILES['file']['name'] $_FILES['file']['size']55){ $file_name = news_.$_FILES['file']['name']; $image=../_img/news/.$file_name; //Upload file move_uploaded_file($_FILES['file']['tmp_name'], $image); } And normaly HTML code: form action=?php $_SERVER['PHP_SELF']; ? method=post enctype=multipart/form-data name=form id=form ... pbr Slika [max 500kB; formati: gif, jpg, jpeg]: input name=file type=file size=50 /p . And also I have question, does anyone knows how to configure apache (also under same Linux) so that in future I woul dn't have to write ?php but only ? every time I start php code? You need to change the enable_short_tags directive. It is probably more simple to do it in the php.ini configuration file and not in the apache configuration file, but you should know that short tags are off by default because they conflict with xml. Thnx, Dusan On Sat, Feb 7, 2009 at 11:53 AM, Dušan Novaković ndu...@gmail.com wrote: Hi, I'm having problem with function move_uploaded_file() under Linux (Slackware 12.2). It simply want execute only that function in php file. So maybe I should add something to http.config file or ? I tried to execute that php file under Windows and it's working just fine (I've copied whole project to xampp's htdocs folder and run it normally). And also I have question, does anyone knows how to configure apache (also under same Linux) so that in future I wouldn't have to write ?php but only ? every time I start php code? Thnx, Dusan -- made by Dusan -- made by Dusan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Alpar Torok -- made by Dusan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Session variables
Paul M Foster wrote: I'm not too clear on HTTP headers, cookies, and such. So here are questions related to that. Let's say I generate a random number that I want the user to enter in a form. When I generate the number, I store it in a session variable ($_SESSION). When the user submits the form, I check the number they enter with what I've stored in the session variable. Since this session variable survives across page loads (assuming session_start() is appropriately called), how is it stored and recalled? Is it automatically stored as a cookie on the user's system? Or is it stored on the server? And how does a server get a cookie? Is it a separate request made by the server to the client? If the value I've asked the user for is *not* stored as a cookie, then is it passed as part of the HTTP submission or what? Thanks for any enlightenment on this. Paul seeing as you're a voomer here's a very mini explanation session has an id a: session id is passed to a user in the http headers users client gets sessionid and stores it in a cookie users client sends cookie with sessionid in it back to website every page load b: on the server a small file is stored in a temp directory containing all the stuff you've stored in session the file is named with the session id when php recieves a request, with a cookie, with a session id in it, then it grabs the related server side session files, pulls the variables from it an makes them available to you in $_SESSION. v simple :p -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: move_uploaded_file() problem
if($_FILES['file']['name'] $_FILES['file']['size']55){ $file_name = news_.$_FILES['file']['name']; $image=../_img/news/.$file_name; //Upload file move_uploaded_file($_FILES['file']['tmp_name'], $image); error_reporting(E_ALL); ini_set('display_errors', true); what does it show? does it get this far in the code? Add an error_log or echo line is . __LINE__ or something so you know for certain this is the problem. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: move_uploaded_file() problem
Chris schrieb: if($_FILES['file']['name'] $_FILES['file']['size']55){ $file_name = news_.$_FILES['file']['name']; $image=../_img/news/.$file_name; //Upload file move_uploaded_file($_FILES['file']['tmp_name'], $image); error_reporting(E_ALL); ini_set('display_errors', true); what does it show? does it get this far in the code? Add an error_log or echo line is . __LINE__ or something so you know for certain this is the problem. Hallo, please show in the php.net site the Method is bool move_uploaded_file ( string $filename , string $destination ) String filename and destination are not right... Carlos Medina -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: move_uploaded_file() problem
On Sat, 2009-02-07 at 14:03 +0100, Carlos Medina wrote: Chris schrieb: if($_FILES['file']['name'] $_FILES['file']['size']55){ $file_name = news_.$_FILES['file']['name']; $image=../_img/news/.$file_name; //Upload file move_uploaded_file($_FILES['file']['tmp_name'], $image); error_reporting(E_ALL); ini_set('display_errors', true); what does it show? does it get this far in the code? Add an error_log or echo line is . __LINE__ or something so you know for certain this is the problem. Hallo, please show in the php.net site the Method is bool move_uploaded_file ( string $filename , string $destination ) String filename and destination are not right... Carlos Medina I've been using this function for years, it's definitely right. Are you sure your strings are right? The should be absolute or relative paths to the file. Usually you'd do something like this Chris showed you. Also, as you're on a Linux system, make sure that the directory into which you are trying to put the file has got the right permissions to allow Apache to do this. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Email configuration
On Sat, 2009-02-07 at 01:58 +, Nathan Rixham wrote: Shawn McKenzie wrote: Nathan Rixham wrote: Shawn McKenzie wrote: Ever heard of RBL or DNSBL? I use it on my email server and so do many lol snap, just sent same message at same time - tis so easy to jump on ash's back cos he's always so sure he's right lolol Hmmm... So Ashley is a him? yeah quot: Actually I'm a guy, but we can't all be perfect ;) http://www.mail-archive.com/php-general@lists.php.net/msg235765.html dunno why I insist on winding him up either, he's pretty sound lol Thanks! And yes, I just checked this morning, and I am still a guy! Bloody Americans cannibalising the spelling of it for their girls! Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: move_uploaded_file() problem
2009/2/7 Dušan Novaković ndu...@gmail.com On Sat, Feb 7, 2009 at 12:29 PM, Alpár Török torokal...@gmail.com wrote: 2009/2/7 Dušan Novaković ndu...@gmail.com Hi, I'm having problem with function move_uploaded_file() under Linux (Slackware 12.2). It simply won't execute only that function in php file. So maybe I should add something to http.config file or ? I tried to execute that php file under Windows and it's working just fine (I've copied whole project to xampp's htdocs folder and run it normally). Can you show some code? This is part where I use function move_uploaded_file() if($_FILES['file']['name'] $_FILES['file']['size']55){ $file_name = news_.$_FILES['file']['name']; $image=../_img/news/.$file_name; //Upload file move_uploaded_file($_FILES['file']['tmp_name'], $image); } And normaly HTML code: Make sure that the relative path resolves to what you think it does. Try to make a test with a hard coded absolute path, and do an echo realpath(../_img/news/$file_name); to see the absolute path that it resolves to. It might be that the function does indeed work, but places files in annother folder than you expect it to. form action=?php $_SERVER['PHP_SELF']; ? method=post enctype=multipart/form-data name=form id=form ... pbr Slika [max 500kB; formati: gif, jpg, jpeg]: input name=file type=file size=50 /p . And also I have question, does anyone knows how to configure apache (also under same Linux) so that in future I woul dn't have to write ?php but only ? every time I start php code? You need to change the enable_short_tags directive. It is probably more simple to do it in the php.ini configuration file and not in the apache configuration file, but you should know that short tags are off by default because they conflict with xml. Thnx, Dusan On Sat, Feb 7, 2009 at 11:53 AM, Dušan Novaković ndu...@gmail.com wrote: Hi, I'm having problem with function move_uploaded_file() under Linux (Slackware 12.2). It simply want execute only that function in php file. So maybe I should add something to http.config file or ? I tried to execute that php file under Windows and it's working just fine (I've copied whole project to xampp's htdocs folder and run it normally). And also I have question, does anyone knows how to configure apache (also under same Linux) so that in future I wouldn't have to write ?php but only ? every time I start php code? Thnx, Dusan -- made by Dusan -- made by Dusan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Alpar Torok -- made by Dusan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Alpar Torok
Re: [PHP] Re: move_uploaded_file() problem
make sure the permissions on the folders are right, so at least read for the httpd in the tmp folder and write in the destination folder. since its moving i would make them both writeable to the webserver daemon user. permissions can be annoying are necessary though... They caught me quite a few times now, so its one of the first things i would check. Tim-Hinnerk Heuer http://www.ihostnz.com Charles M. Schulz - I love mankind; it's people I can't stand. 2009/2/8 Alpár Török torokal...@gmail.com 2009/2/7 Dušan Novaković ndu...@gmail.com On Sat, Feb 7, 2009 at 12:29 PM, Alpár Török torokal...@gmail.com wrote: 2009/2/7 Dušan Novaković ndu...@gmail.com Hi, I'm having problem with function move_uploaded_file() under Linux (Slackware 12.2). It simply won't execute only that function in php file. So maybe I should add something to http.config file or ? I tried to execute that php file under Windows and it's working just fine (I've copied whole project to xampp's htdocs folder and run it normally). Can you show some code? This is part where I use function move_uploaded_file() if($_FILES['file']['name'] $_FILES['file']['size']55){ $file_name = news_.$_FILES['file']['name']; $image=../_img/news/.$file_name; //Upload file move_uploaded_file($_FILES['file']['tmp_name'], $image); } And normaly HTML code: Make sure that the relative path resolves to what you think it does. Try to make a test with a hard coded absolute path, and do an echo realpath(../_img/news/$file_name); to see the absolute path that it resolves to. It might be that the function does indeed work, but places files in annother folder than you expect it to. form action=?php $_SERVER['PHP_SELF']; ? method=post enctype=multipart/form-data name=form id=form ... pbr Slika [max 500kB; formati: gif, jpg, jpeg]: input name=file type=file size=50 /p . And also I have question, does anyone knows how to configure apache (also under same Linux) so that in future I woul dn't have to write ?php but only ? every time I start php code? You need to change the enable_short_tags directive. It is probably more simple to do it in the php.ini configuration file and not in the apache configuration file, but you should know that short tags are off by default because they conflict with xml. Thnx, Dusan On Sat, Feb 7, 2009 at 11:53 AM, Dušan Novaković ndu...@gmail.com wrote: Hi, I'm having problem with function move_uploaded_file() under Linux (Slackware 12.2). It simply want execute only that function in php file. So maybe I should add something to http.config file or ? I tried to execute that php file under Windows and it's working just fine (I've copied whole project to xampp's htdocs folder and run it normally). And also I have question, does anyone knows how to configure apache (also under same Linux) so that in future I wouldn't have to write ?php but only ? every time I start php code? Thnx, Dusan -- made by Dusan -- made by Dusan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Alpar Torok -- made by Dusan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Alpar Torok
Re: [PHP] Re: Some kind of Popup
Ashley Sheridan wrote: On Sat, 2008-11-22 at 12:32 -0500, Patrick Moloney wrote: Yeti wrote: Another JavaScript method would be to load the content in a hidden div with position: absolute. I think that's what I was considering doing with CSS except it would be labels only in the content. I only wanted to retrieve the data record from mysql if the user asked for the specs. One issue is I don't want to leave the space available on my regular web page and would like to try not to overwrite something there - I'd rather have a separate window of some sort that sort of floats over the web page. The best way to have the popup work, even with popup blockers is to have a link like this: a href=details.php?id=1 target=details onclick=window.open('about: blank', 'details','width=300,height=200');More Details/a The onclick handler is called before the link is actioned, and it opens a new window with your settings, called 'details'. When that is finished, the browser continues actioning the link, looks to find the window/frame called 'details', finds one, and uses it. This way, even if a user has scripting turned off, the link still works and opens in a new window. Ash www.ashleysheridan.co.uk Ashley, Thanks, I finally worked on the popup you suggested. That is the closest to what I am looking for. I'm sure there are some other settings that could be useful. For example, the popup window gets hidden behind the primary web page if the user goes back there, and does not come back if he clicks again. But, my bigger question is this: Is this solution specific to MS Windows. What would happen if someone were viewing the website using Apple or Linus etc? Here's hoping you see this. Thanks, Patrick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Some kind of Popup
On Sat, 2009-02-07 at 09:06 -0500, Patrick Moloney wrote: Ashley Sheridan wrote: On Sat, 2008-11-22 at 12:32 -0500, Patrick Moloney wrote: Yeti wrote: Another JavaScript method would be to load the content in a hidden div with position: absolute. I think that's what I was considering doing with CSS except it would be labels only in the content. I only wanted to retrieve the data record from mysql if the user asked for the specs. One issue is I don't want to leave the space available on my regular web page and would like to try not to overwrite something there - I'd rather have a separate window of some sort that sort of floats over the web page. The best way to have the popup work, even with popup blockers is to have a link like this: a href=details.php?id=1 target=details onclick=window.open('about: blank', 'details','width=300,height=200');More Details/a The onclick handler is called before the link is actioned, and it opens a new window with your settings, called 'details'. When that is finished, the browser continues actioning the link, looks to find the window/frame called 'details', finds one, and uses it. This way, even if a user has scripting turned off, the link still works and opens in a new window. Ash www.ashleysheridan.co.uk Ashley, Thanks, I finally worked on the popup you suggested. That is the closest to what I am looking for. I'm sure there are some other settings that could be useful. For example, the popup window gets hidden behind the primary web page if the user goes back there, and does not come back if he clicks again. But, my bigger question is this: Is this solution specific to MS Windows. What would happen if someone were viewing the website using Apple or Linus etc? Here's hoping you see this. Thanks, Patrick I use Linux myself, and the Window does stay in the background if it's already open. You could fix this by changing the onclick a bit: script language=javascript type=text/javascript function details_popup() { detailsWin = window.open('about: blank', 'details','width=300,height=200'); detailsWin.focus(); } /script a href=details.php?id=1 target=details onclick=details_popup()More Details/a I've not tested this, but it should allow your link to bring the window to focus even if it is already open and in the background. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Some kind of Popup
No, it's a generic solution, should be pretty much the same across browsers. Why not download more browsers and test? I would also add a window.focus() to the body tag in the popup to bring the window back on top when the user reclocks the link body onload='window.focus();' Bastien Sent from my iPod On Feb 7, 2009, at 9:06, Patrick Moloney webpa...@gmail.com wrote: Ashley Sheridan wrote: On Sat, 2008-11-22 at 12:32 -0500, Patrick Moloney wrote: Yeti wrote: Another JavaScript method would be to load the content in a hidden div with position: absolute. I think that's what I was considering doing with CSS except it would be labels only in the content. I only wanted to retrieve the data record from mysql if the user asked for the specs. One issue is I don't want to leave the space available on my regular web page and would like to try not to overwrite something there - I'd rather have a separate window of some sort that sort of floats over the web page. The best way to have the popup work, even with popup blockers is to have a link like this: a href=details.php?id=1 target=details onclick=window.open('about: blank', 'details','width=300,height=200');More Details/a The onclick handler is called before the link is actioned, and it opens a new window with your settings, called 'details'. When that is finished, the browser continues actioning the link, looks to find the window/frame called 'details', finds one, and uses it. This way, even if a user has scripting turned off, the link still works and opens in a new window. Ash www.ashleysheridan.co.uk Ashley, Thanks, I finally worked on the popup you suggested. That is the closest to what I am looking for. I'm sure there are some other settings that could be useful. For example, the popup window gets hidden behind the primary web page if the user goes back there, and does not come back if he clicks again. But, my bigger question is this: Is this solution specific to MS Windows. What would happen if someone were viewing the website using Apple or Linus etc? Here's hoping you see this. Thanks, Patrick -- 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] Re: Some kind of Popup
Phpster wrote: No, it's a generic solution, should be pretty much the same across browsers. Why not download more browsers and test? Thanks all, I thought this might get lost in history here. It's not just different browsers, it's different operating systems - Apple, Linux, more. I can't download those. Although I have thought about setting up one dedicated machine just to test Linux on such things. I thought the Window function(?) is probably part of MS Windows. Maybe it's also implemented in Linux, possibly others just to be compatible. I'll keep working on this with a little CSS and other options. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Some kind of Popup
On Sat, 2009-02-07 at 09:43 -0500, Patrick Moloney wrote: Phpster wrote: No, it's a generic solution, should be pretty much the same across browsers. Why not download more browsers and test? Thanks all, I thought this might get lost in history here. It's not just different browsers, it's different operating systems - Apple, Linux, more. I can't download those. Although I have thought about setting up one dedicated machine just to test Linux on such things. I thought the Window function(?) is probably part of MS Windows. Maybe it's also implemented in Linux, possibly others just to be compatible. I'll keep working on this with a little CSS and other options. Thanks Window doesn't refer to MS Windows, it's just the generic object for the browser window, so anything that supports Javascript will support it! There are a lot of browser-specific additions to Javascript, but the code we've all shown here is all pretty generic. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Adding Records Capture The New Record ID
Newbie question... Hi folks, Adding records capture the new record ID: In the past, if I added a new record from a form in a phonebook file as an example, I would use a web form to fill out the info, and then add and invisible text item that stored a random number in one of the unused database fields. Then, after I inserted the record - I would do a quick query that would retrieve the record ID by searching for the random number Q: is there a better way to retrieve the record ID from the newly added record? -- Thanks - RevDave Cool @ hosting4days . com [db-lists 09] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Adding Records Capture The New Record ID
2009/2/7 revDAVE c...@hosting4days.com: Adding records capture the new record ID: In the past, if I added a new record from a form in a phonebook file as an example, I would use a web form to fill out the info, and then add and invisible text item that stored a random number in one of the unused database fields. Then, after I inserted the record - I would do a quick query that would retrieve the record ID by searching for the random number Ouch that's nasty!! Q: is there a better way to retrieve the record ID from the newly added record? Use an auto_increment field then, assuming MySQL you can use mysql_insert_id to get the ID of the last record inserted on a given connection. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Adding Records Capture The New Record ID
On 2/7/2009 11:41 AM, Stuart stut...@gmail.com wrote: Then, after I inserted the record - I would do a quick query that would retrieve the record ID by searching for the random number Ouch that's nasty!! Q: is there a better way to retrieve the record ID from the newly added record? Use an auto_increment field then, assuming MySQL you can use mysql_insert_id to get the ID of the last record inserted on a given connection. -Stuart Thanks Stuart - it works great - so much Less Nasty! BTW: as long as - mysql_insert_id is right after the insert statement - is it 100% accurate - (in that no other insert from another user could get in the middle of this)? -- Thanks - RevDave Cool @ hosting4days . com [db-lists 09] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Adding Records Capture The New Record ID
2009/2/7 revDAVE c...@hosting4days.com: On 2/7/2009 11:41 AM, Stuart stut...@gmail.com wrote: Then, after I inserted the record - I would do a quick query that would retrieve the record ID by searching for the random number Ouch that's nasty!! Q: is there a better way to retrieve the record ID from the newly added record? Use an auto_increment field then, assuming MySQL you can use mysql_insert_id to get the ID of the last record inserted on a given connection. -Stuart Thanks Stuart - it works great - so much Less Nasty! BTW: as long as - mysql_insert_id is right after the insert statement - is it 100% accurate - (in that no other insert from another user could get in the middle of this)? Yes. As I stated, it returns the ID of the last record inserted on a given connection. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Adding Records Capture The New Record ID
At 12:12 PM -0800 2/7/09, revDAVE wrote: On 2/7/2009 11:41 AM, Stuart stut...@gmail.com wrote: Then, after I inserted the record - I would do a quick query that would retrieve the record ID by searching for the random number Ouch that's nasty!! Q: is there a better way to retrieve the record ID from the newly added record? Use an auto_increment field then, assuming MySQL you can use mysql_insert_id to get the ID of the last record inserted on a given connection. -Stuart Thanks Stuart - it works great - so much Less Nasty! BTW: as long as - mysql_insert_id is right after the insert statement - is it 100% accurate - (in that no other insert from another user could get in the middle of this)? That's one way, to use mysql_insert_id (probably the best). But another is simply to read back in the record you just created and check the $row['id']. That's the way I do it sometimes. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sending XML requests as raw post data
2009/2/7 Marc Steinert li...@bithub.net Hi there! The software I'm maintaining uses $HTTP_RAW_POST_DATA to receive XML requests, posted by some client written in C#. Now I need to write a PHP client that posts XML requests the same way as the C# client, so that the posted data is stored in $HTTP_RAW_POST_DATA, too. I tried to use curl to match my needs, but failed to establish a connection with the following code: $header[] = Host: .$host; $header[] = MIME-Version: 1.0; $header[] = Accept: text/xml; $header[] = Content-length: .strlen($xmlRequest); $header[] = Cache-Control: no-cache; $header[] = Connection: close \r\n; $header[] = $xmlRequest; // Contains the XML request curl_setopt($curl, CURLOPT_URL,self::BASE_URL); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_TIMEOUT, 4); curl_setopt($curl, CURLOPT_CUSTOMREQUEST,'POST'); curl_setopt($curl, CURLOPT_HTTPHEADER, $header); // Dispatch request and read answer $response = curl_exec($curl); // returns false Thanks for your help. Greetings from Germany Marc -- http://bithub.net/ Synchronize and share your files over the web for free My Twitter feed http://twitter.com/MarcSteinert Take a look at the free, open source php JSON-RPC at *jsonrpcphp*.org , in the client you will find a very good example of what you need. (Sorry no time to provide it directly) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Alpar Torok
Re: [PHP] Adding Records Capture The New Record ID
On Sat, 2009-02-07 at 15:26 -0500, tedd wrote: At 12:12 PM -0800 2/7/09, revDAVE wrote: On 2/7/2009 11:41 AM, Stuart stut...@gmail.com wrote: Then, after I inserted the record - I would do a quick query that would retrieve the record ID by searching for the random number Ouch that's nasty!! Q: is there a better way to retrieve the record ID from the newly added record? Use an auto_increment field then, assuming MySQL you can use mysql_insert_id to get the ID of the last record inserted on a given connection. -Stuart Thanks Stuart - it works great - so much Less Nasty! BTW: as long as - mysql_insert_id is right after the insert statement - is it 100% accurate - (in that no other insert from another user could get in the middle of this)? That's one way, to use mysql_insert_id (probably the best). But another is simply to read back in the record you just created and check the $row['id']. That's the way I do it sometimes. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com How do you plan on reading back the row if you don't use the mysql_insert_id value? For most cases, it's not enough to read back the values you just put in as they may be the same for some people. Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sending XML requests as raw post data
Marc Steinert wrote: Hi there! The software I'm maintaining uses $HTTP_RAW_POST_DATA to receive XML requests, posted by some client written in C#. Now I need to write a PHP client that posts XML requests the same way as the C# client, so that the posted data is stored in $HTTP_RAW_POST_DATA, too. I tried to use curl to match my needs, but failed to establish a connection with the following code: $header[] = Host: .$host; $header[] = MIME-Version: 1.0; $header[] = Accept: text/xml; $header[] = Content-length: .strlen($xmlRequest); $header[] = Cache-Control: no-cache; $header[] = Connection: close \r\n; $header[] = $xmlRequest; // Contains the XML request curl_setopt($curl, CURLOPT_URL,self::BASE_URL); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_TIMEOUT, 4); curl_setopt($curl, CURLOPT_CUSTOMREQUEST,'POST'); curl_setopt($curl, CURLOPT_HTTPHEADER, $header); // Dispatch request and read answer $response = curl_exec($curl); // returns false Thanks for your help. Greetings from Germany Marc i think.. curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlhere ); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sending XML requests as raw post data
Marc Steinert wrote: Hi there! The software I'm maintaining uses $HTTP_RAW_POST_DATA to receive XML requests, posted by some client written in C#. Now I need to write a PHP client that posts XML requests the same way as the C# client, so that the posted data is stored in $HTTP_RAW_POST_DATA, too. I tried to use curl to match my needs, but failed to establish a connection with the following code: $header[] = Host: .$host; $header[] = MIME-Version: 1.0; $header[] = Accept: text/xml; $header[] = Content-length: .strlen($xmlRequest); $header[] = Cache-Control: no-cache; $header[] = Connection: close \r\n; $header[] = $xmlRequest; // Contains the XML request curl_setopt($curl, CURLOPT_URL,self::BASE_URL); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_TIMEOUT, 4); curl_setopt($curl, CURLOPT_CUSTOMREQUEST,'POST'); curl_setopt($curl, CURLOPT_HTTPHEADER, $header); // Dispatch request and read answer $response = curl_exec($curl); // returns false Thanks for your help. Greetings from Germany Marc and nearly forgot, you can loose all of those headers, half the ones you specified are for responses not requests anyways :p $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, self::BASE_URL); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $xmlRequest); curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($curl, CURLINFO_HEADER_OUT, 1); $response = curl_exec($curl); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reg-ex help
Thanks! That's a big help. - Craige Jim Lucas wrote: Craige Leeder wrote: Hey guys, I'm trying to write a regular expression to match a tag for my frameworks template engine. I seem to be having some trouble. The expression should match: {:seg 'segname':} {:seg 'segname' cache:} What I have is... $fSegRegEx = #\{:seg \'[a-z0-9\-\_]{3,}\'( cache)?:\}#i; Which when run against my test data, seems to match: {:seg 'segname' cache:} cache Thanks guys. This has been bugging me for a couple days. - Craige I used some of your code, but try this variant on for size. plaintext ?php error_reporting(E_ALL); ini_set('display_errors', 1); $dummyData = DATA html body h1{:seg 'title':}/h1 h1{:seg 'title' cache:}/h1 /body /html DATA; # For arguments sake, I'll provide the whole code snippet... $fSegRegEx = |\{:(seg) \'([a-z0-9\-\_]{3,})\'\s?(cache)?:\}|i; preg_match_all($fSegRegEx, $dummyData, $faSegMatches, PREG_SET_ORDER); print_r($faSegMatches); ? Not sure what your input is going to be (HTML, XML, etc...) so I used HTML Anyways, output from the above code is this: plaintext Array ( [0] = Array ( [0] = {:seg 'title':} [1] = seg [2] = title ) [1] = Array ( [0] = {:seg 'title' cache:} [1] = seg [2] = title [3] = cache ) ) Hope this starts you down the right path. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Seeking PHP Work in Chicago or Telecommute
I figure if job postings are okay, then so are job requests, right? :-) I'm looking for PHP work in Chicago or telecommuting. My resume is here: http://l-i-e.com/resume.htm -- Some people ask for gifts here. I just want you to buy an Indie CD for yourself: http://cdbaby.com/search/from/lynch -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php