Re: [PHP] Record Sorting Using Up and Down Arrows
I'm hoping someone can help me solve this problem. I've almost got something working. Only problem is I am having some difficulty trying to come up with a case or condition for the single value (ie. devmodfile value = file 3 in example below) that it won't print any arrows up, up/down, or down. It's a bit of a puzzler and haven't added anything to the case. I have a print_r and a print with the variables so that anyone can see what is happening. I put a small array of test values in so that it can be run. The data will come from an SQL database but this is enough to test. Once this is working, I'll attach graphics and actions to the up and down arrows. The script is below: Thanks in advance for any help. Regards, Dave Pratt ?php $items[] = array(devfunctionid = 1, devmodfile = file1); $items[] = array(devfunctionid = 2, devmodfile = file1); $items[] = array(devfunctionid = 3, devmodfile = file1); $items[] = array(devfunctionid = 4, devmodfile = file2); $items[] = array(devfunctionid = 5, devmodfile = file2); $items[] = array(devfunctionid = 6, devmodfile = file3); $items[] = array(devfunctionid = 7, devmodfile = file4); $items[] = array(devfunctionid = 8, devmodfile = file4); foreach ($items as $item) { $devmodfile_values[] = $item['devmodfile']; } $rownum = 1; $numrows = count($items); $last_position = ''; foreach ($items as $item) { if (!isset($devmodfile_values[$rownum])) { $next_position = ''; } else { $next_position = $devmodfile_values[$rownum]; } $up = up arrow; $down = down arrow; switch($rownum) { case 1: if ($next_position != $item['devmodfile']) { $arrows = ''; } else { $arrows = $down; } break; case $numrows: if ($last_position != $item['devmodfile']) { $arrows = ''; } else { $arrows = $up; } break; default: if ($devmodfile_values[$rownum] != $item['devmodfile']) { $arrows = $up; } elseif ($item['devmodfile'] != $last_position) { $arrows = $down; } else { $arrows = $up $down; } break; } $rownum++; $last_position = $item['devmodfile']; print $arrows . --current file value: . $item['devmodfile'] . --last_position: . $last_position . --next_position: . $next_position . /br; } print /br/br; print_r($devmodfile_values); ?
[PHP] How to connect Web database
Hi Friends, I am having a local MySQL database tables in Linux and the data is updated in the table using PHP scripts working through apache web server. local MySQL database is connected using the following php scripts. mysql_connect(localhost,root,vinodb) or die (cannot connect to mysqld); mysql_select_db(lnnet) or die(cannot select database); I have created same database and tables which is available locally on web which is having MySQL PHP support. Now I want to update the web database from the local database using php scripts. How do I connect web database and local database simultaneously. I will be grateful, if any body can mail me the connecting scripts, so that I can write php scripts to update the records from local database. or can any body suggest a solution on how to update the tables. Regards, Vinod. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to connect Web Database from local machine
Hi all, I am having MySQL database on web. (eg., at www.lmcr.net). What is the PHP script which I can connect the MySQL table from my Local machine. Can anybody help me. Regards, Vinod. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to connect Web database
You have to use mysqldump utility to make script, then you can put it into your PHP script and run that script: ?php $sql = PRODUCED SCRIPT BODY GOES HERE; mysql_query($sql); ? or just dump your database directly to remote server by running mysqldump with parameters Host and some other. The only difficulty could be, that remote provider could reject all emote connections :(( the third way is to place PHP script on remote mashine and to connect to your local MySQL server and just make some SELECT-INSERT. Here you can have the same problem as in previous: proveder can reject all connection aoutside their box :((( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sessions without cookies *or* URLs
Hi, all -- I've seen a recent flurry of discussion on sessions, and that's good; lovely how that has shown up just as I need to dig into sessions. I think I've come to understand, though, that you can't manage sessions without either URL extensions or cookies, and that's bad (for me, at least). Is that a correct understanding? It seems that using forms to pass the session token would work, but that means having all buttons instead of links, which has its own disadvantages. Is there any other way to get data to the server? We currently use the URL to pass variables but we don't want to hang the page password out there :-) and so we have to maove away from that somehow, and it would be nice if we could get away from URL mangling entirely. Cookies aren't an option, though. TIA HAND :-D -- David T-G * It's easier to fight for one's principles (play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie (work) [EMAIL PROTECTED] http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg! msg81262/pgp0.pgp Description: PGP signature
[PHP] Using date() function
Hi people I have a guestbook, and i need to convert the date and time from the database into a normal readable date.. Like Sunday, 6 october 2002 13:30:00. I thought i could use the date() function here. I have done this: $entry_date = date('l, d F Y H:i:s','$sql[date]'); echo $entry_date; But then i dont get the date i need. It says Thursday, 01 January 1970 01:00:00 (i wasn`t even born then;-), so it wasn`t me signing that guestbook. Any sugestions what i am doing wrong. Thanks for your time. Best regards, Davy Obdam, mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Using date() function
First you should use : $entry_date = date('l, d F Y H:i:s',$sql['date']); And $sql['date'] must be a TIMESTAMP. -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Davy Obdam [EMAIL PROTECTED] a écrit dans le message de news: 001601c26d2c$e5391ff0$[EMAIL PROTECTED] Hi people I have a guestbook, and i need to convert the date and time from the database into a normal readable date.. Like Sunday, 6 october 2002 13:30:00. I thought i could use the date() function here. I have done this: $entry_date = date('l, d F Y H:i:s','$sql[date]'); echo $entry_date; But then i dont get the date i need. It says Thursday, 01 January 1970 01:00:00 (i wasn`t even born then;-), so it wasn`t me signing that guestbook. Any sugestions what i am doing wrong. Thanks for your time. Best regards, Davy Obdam, mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions without cookies *or* URLs
I think you're under a little misconception about how sessions are used. Maintaining a session is simply just having a unique identifier for each user, so that the server can recognise the user from page to page, maintaining state. Typically this is done by passing a session id around in he URL or cookies or POSTing forms. A session ID is typically a long unique number -- that's it. What you then do associate or register data TO that Session ID... this data is stored on the SERVER, and NOT passed around in the URL. So you pass around PHPSESSID=198235021612423 in the url or a cookie, and assign data to that session... all of which is stored server side. The session with the id 198235021612423 may have a username, password, shoe size, favourite colour, etc etc all attached to it, done with either: $_SESSION['shoesize'] = 14; // new register globals OFF method or $shoesize = 14; session_register(shoesize); // old method Therefor, I can see no need for anything other than the session ID to be passed around in the URL. Hope this clears it up! Justin French on 06/10/02 9:26 PM, David T-G ([EMAIL PROTECTED]) wrote: Hi, all -- I've seen a recent flurry of discussion on sessions, and that's good; lovely how that has shown up just as I need to dig into sessions. I think I've come to understand, though, that you can't manage sessions without either URL extensions or cookies, and that's bad (for me, at least). Is that a correct understanding? It seems that using forms to pass the session token would work, but that means having all buttons instead of links, which has its own disadvantages. Is there any other way to get data to the server? We currently use the URL to pass variables but we don't want to hang the page password out there :-) and so we have to maove away from that somehow, and it would be nice if we could get away from URL mangling entirely. Cookies aren't an option, though. TIA HAND :-D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_fetch_row() problem
I have this small bit of code to fetch the latest songs submitted by a user on theire profile for my tab website, here is the code: ?php $get_songs = mysql_query(SELECT `id`,`title`,`artist_id`,`type` FROM `resources` WHERE `user_id` = '$id' ORDER BY `rating` LIMIT 0,10); ? table border=0 cellpadding=1trtdB10 Latest Songs Submited by ?php echo($profile_array[0]); ?/b/tdtd/tdtd/td/tr ?php for ($i = 0; $i mysql_num_rows($get_songs); $i ++) { $latsongs = mysql_fetch_row($get_songs); $get_anames = mysql_query(SELECT `name` FROM `artists` WHERE `artist_id` = '$id'); $anames = mysql_fetch_row($get_names);// !!! ERROR LINE !!! echo(trtda href=\view.php?id=$latsongs[0]\$latsongs[1]/a/tdtda href=\artist.php?id=$latsongs[2]\$anames[0]/a/tdtd($latsongs[3])/t d/tr); } ? The problem is with the line i labelled !!! ERROR LINE !!!, to fetch the artist name. The error returned is: Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/tabzilla/public_html/profile.php on line 115 You can see the complete page at http://www.tabzilla.com/profile.php?id=3 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Using date() function
Hi Nicos, Using $entry_date = date('l, d F Y H:i:s',$sql['date']); now gives me back Tuesday, 19 January 2038 04:14:07 with ever entry. $sql['date'] is a TIMESTAMP and looks like this 20021006141256 in the datebase. It should give me Sunday, 06 October 2002 14:12:56..? Wierd eh? Do u know a solution? Best regards, Davy Obdam, mailto:[EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 06, 2002 1:59 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] Re: Using date() function First you should use : $entry_date = date('l, d F Y H:i:s',$sql['date']); And $sql['date'] must be a TIMESTAMP. -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Using date() function
Hello, Why not just do it in your sql query? If you're using MySQL perhaps this page would be helpful: http://www.mysql.com/doc/en/Date_and_time_functions.html Just an idea... - E On Sunday, October 6, 2002 10:01 PM Davy Obdam wrote: Hi people I have a guestbook, and i need to convert the date and time from the database into a normal readable date.. Like Sunday, 6 october 2002 13:30:00. I thought i could use the date() function here. I have done this: $entry_date = date('l, d F Y H:i:s','$sql[date]'); echo $entry_date; But then i dont get the date i need. It says Thursday, 01 January 1970 01:00:00 (i wasn`t even born then;-), so it wasn`t me signing that guestbook. Any sugestions what i am doing wrong. Thanks for your time. Best regards, Davy Obdam, mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Using date() function
Using $entry_date = date('l, d F Y H:i:s',$sql['date']); now gives me back Tuesday, 19 January 2038 04:14:07 with ever entry. $sql['date'] is a TIMESTAMP and looks like this 20021006141256 in the datebase. It should give me Sunday, 06 October 2002 14:12:56..? Wierd eh? Do u know a solution? No, not weird. MySQL uses a timestamp in the MMDDHHMMSS format. Date() is expecting a UNIX timestamp, which is the number of seconds since Jan 1, 1970. So... you can either use DATE_FORMAT() in your query, with is the MySQL equivalent of date(). Look up the format in the manual. Or, you can use UNIX_TIMESTAMP() in your query to select out the unix timestamp instead of the mysql timestamp, and then use that value within date() in your PHP script. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to connect Web Database from local machine
I am having MySQL database on web. (eg., at www.lmcr.net). What is the PHP script which I can connect the MySQL table from my Local machine. Can anybody help me. Well, most hosting companies do not allow remote access to the MySQL server, but if you're does, then you connect the same way as usual... $link_id = mysql_connect(mysql.yourdomain.com,user,password); You just pass the IP or name of your MySQL server in the mysql_connect function. To also connect to your local database, just use $link_id2 = mysql_connect(localhost,user,password); And then you have a connection to each one open. Be sure to use the appropriate $link_id in your queries. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQLLimit size
I have a form with a textarea. When I put a long text(one word page for example), when I submit, the form is not submitted. I have to remove some line to submit. I don't have any limit in the textarea. The content of this form is sorted in a MySQL database. I tried to set the field where the textarea will be stored to LONGTEXt or LONGBLOB but I have all the time the same problem. Are you using POST or GET for your form? Show some code... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQLLimit size
Are you using POST or GET for your form? Show some code... I use get. But I tried to post and look ok. Why this difference ? Christian, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQLLimit size
Are you using POST or GET for your form? Show some code... I use get. But I tried to post and look ok. Why this difference ? Christian, You can only send so much data through GET, because the URL is limited as to how long it can be. It may be different for each browser, but I think it's usually 1024 characters. There is no limit with POST. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: [PHP-WIN] RE: [PHP] Re: Using date() function
Hi John, How do u use UNIX_TIMESTAMP or DATE_FORMAT in your query. My query now looks like this: SELECT * FROM guestbook2002 ORDER BY entryID DESC LIMIT $entry, $show; Can u help me;-) Thanks for your time Best regards, Davy Obdam, mailto:[EMAIL PROTECTED] -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 06, 2002 3:31 PM To: 'Davy Obdam'; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-WIN] RE: [PHP] Re: Using date() function Using $entry_date = date('l, d F Y H:i:s',$sql['date']); now gives me back Tuesday, 19 January 2038 04:14:07 with ever entry. $sql['date'] is a TIMESTAMP and looks like this 20021006141256 in the datebase. It should give me Sunday, 06 October 2002 14:12:56..? Wierd eh? Do u know a solution? No, not weird. MySQL uses a timestamp in the MMDDHHMMSS format. Date() is expecting a UNIX timestamp, which is the number of seconds since Jan 1, 1970. So... you can either use DATE_FORMAT() in your query, with is the MySQL equivalent of date(). Look up the format in the manual. Or, you can use UNIX_TIMESTAMP() in your query to select out the unix timestamp instead of the mysql timestamp, and then use that value within date() in your PHP script. ---John Holmes... -- PHP Windows 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] RE: [PHP-WIN] RE: [PHP] Re: Using date() function
Hi John, How do u use UNIX_TIMESTAMP or DATE_FORMAT in your query. My query now looks like this: SELECT * FROM guestbook2002 ORDER BY entryID DESC LIMIT $entry, $show; Can u help me;-) Thanks for your time Did you read the Date and Time Functions chapter of the MySQL manual?? SELECT UNIX_TIMESTAMP(your_timestamp_column) AS alias FROM your_table ... SELECT DATE_FORMAT(column,'format'), column2, column3, etc FROM yourtable ... You have to name the columns and not use * in your query. You'll also want to read up on the AS alias, if you don't know what that is. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Mysqldump
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hey, I'm not sure about windows machines as I use linux but it looks like you're sending the right commands. You need to check your permissions. ~Paul On Sunday 06 October 2002 12:30 am, Uma Shankari T. wrote: Hello, I am trying to dump the text file contents to mysql which was already backup from mysql only..While trying to dump it is telling access denied error i am trying from here d:\mysql\binmysqldump databasename txt.file name Can anyone tell me how to go about with this ?? Regards, Uma - -- ~Paul Nicholson Design Specialist @ WebPower Design The webthe way you want it! [EMAIL PROTECTED] It said uses Windows 98 or better, so I loaded Linux! Registered Linux User #183202 using Register Linux System # 81891 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9oFpTDyXNIUN3+UQRAq7wAJ97jRHEUq/oQivyZzHD22wpQegbZwCdGeTl Sux8I5NCDdbJk9lstKeKsr8= =dwjM -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] working with pspell
Hi everybody, I just installed pspell and would like to get behind of the whole concept of spellchecking with php. As far as I understand, I have to check it word by word. Is there an algorithm which allowes to give a sentence to check and highlight all the words mispelled. On clickin the mispelled word to open a popup with suggestions and by clicking on the proper word to automaticly replace the wrong word. This sounds very complicated. Has anybody a good suggestion, or article to recommend on this topic? Thanx for your help, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: access denied
I don't know exactly what shell access is, but in my quest to do what i was trying to do, i realised its not worth it due to the fact the file i was copying was still being accessed everytime the php file was open, and my aim was to get the particular file from the remote server, copy it onto my server 2 times a day and then the php file that im working on would access the local file instead of the remote file which its doing now, Anyways, thanx for all your help -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick question.
Hi, sorry about the delay, i have some computer problems in the last few days, all fixed now i hope. I don't know exactly what shell access is, or ssh for that matter, but in my quest to do what i was trying to do, I realised its not worth it due to the fact the file i was copying was still being accessed everytime the php file was open, and my aim was to get the particular file from the remote server, copy it onto my server 2 times a day and then the php file that im working on would access the local file instead of the remote file which its doing now, Anyways, thanx for all your help -- Cheers - Simon Angell Canberra ACT www.canberra-wx.com - Member of: Australian Severe Weather Association. www.severeweather.asn.au - This email is virus free. Scanned before leaving my mailbox using Norton Antivirus 2002 for Win2k Scanned with the latest definition File. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] working with pspell
From: Andy [EMAIL PROTECTED] I just installed pspell and would like to get behind of the whole concept of spellchecking with php. As far as I understand, I have to check it word by word. Is there an algorithm which allowes to give a sentence to check and highlight all the words mispelled. On clickin the mispelled word to open a popup with suggestions and by clicking on the proper word to automaticly replace the wrong word. This sounds very complicated. Has anybody a good suggestion, or article to recommend on this topic? I'm currently doing a spell checker, and found this article very helpful: http://www.zend.com/zend/spotlight/spellchecking.php. -- Lowell Allen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can it be Done?
Hello, I was wondering if what I want to do is possible. I have a website that uses iframes and sometimes the search engines pick up the file that's displayed in the iframe. That file jsut plain looks really bad but in the site itself and displayed in the iframe it looks a whole lot better. What I want to be able to do is this. If the file is being displayed just plain, not in the iframe, it forwards to the main site and then displays the file in the iframe. But then, if the file is already being displayed in the iframe, it doesn't do anything. Can this be done and how? Thanks, Stephen Craton
Re: [PHP] Can it be Done?
Hi, i don't think you can do this all on Server-side. I once made things like that work with usual frames. I used Javascript in each page of the frameset to find out if the parent exists - and if not, redirect to the frameset which itself was a PHP script whom i told to load the current page in correct frames. I don't know if that's also posibile with iframes. Anyway, you need to do two steps: 1. You must be able to view the outer page with a parameter, which tells it what Site is to be viewed inside the iframe. 2. Some sort of JavaScript wich redirects to the outer page. Tha JavaScript must live inside each site that might show up inside the iframe. Regards Sascha Am Sonntag, 6. Oktober 2002 18:29 schrieb Stephen: Hello, I was wondering if what I want to do is possible. I have a website that uses iframes and sometimes the search engines pick up the file that's displayed in the iframe. That file jsut plain looks really bad but in the site itself and displayed in the iframe it looks a whole lot better. What I want to be able to do is this. If the file is being displayed just plain, not in the iframe, it forwards to the main site and then displays the file in the iframe. But then, if the file is already being displayed in the iframe, it doesn't do anything. Can this be done and how? Thanks, Stephen Craton -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Can it be Done?
'Not really sure, but perhaps, with Javascript. But I'd rather recommend you to give up iframes... ;) - E On Monday, October 7, 2002 1:29 AM Stephen wrote: Hello, I was wondering if what I want to do is possible. I have a website that uses iframes and sometimes the search engines pick up the file that's displayed in the iframe. That file jsut plain looks really bad but in the site itself and displayed in the iframe it looks a whole lot better. What I want to be able to do is this. If the file is being displayed just plain, not in the iframe, it forwards to the main site and then displays the file in the iframe. But then, if the file is already being displayed in the iframe, it doesn't do anything. Can this be done and how? Thanks, Stephen Craton -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: after mysqlfront?
DB tools (getting better every version) http://www.dbtools.com.br/EN/ Let's hope so, because the version I just downloaded would always crash whenever you tried to set up a new connection Mascon seems to be a very good project and far more features than MySQL-Front. And I'm a big fan of MySQL-Front... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] formatting / beautifying PHP code
Is there a utility that formats / beautifies PHP code like indent does for C code? -- Andrew Ziem Is Jesus Your Answer? http://www.ChristianAnswers.net/gospel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Can it be Done?
Hi people, Edwin wrore: 'Not really sure, but perhaps, with Javascript. But I'd rather recommend you to give up iframes... ;) Can you post an example of Javascript code checking for _parent frame? By the way, what's wrong with iframes? bye, Adr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 6 Oct 2002 20:00:00 -0000 Issue 1628
php-general Digest 6 Oct 2002 20:00:00 - Issue 1628 Topics (messages 118984 through 119012): How to connect Web database 118984 by: Vinod Bhaskar 118986 by: Intruder How to connect Web Database from local machine 118985 by: Vinod Bhaskar 118996 by: John W. Holmes sessions without cookies *or* URLs 118987 by: David T-G 118990 by: Justin French Using date() function 118988 by: Davy Obdam 118989 by: nicos.php.net 118992 by: Davy Obdam 118994 by: . Edwin 118995 by: John W. Holmes mysql_fetch_row() problem 118991 by: tony.tabzilla.com 118993 by: Intruder Re: MySQLLimit size 118997 by: John W. Holmes 118998 by: Christian Ista 118999 by: John W. Holmes Re: [PHP-WIN] RE: [PHP] Re: Using date() function 119000 by: Davy Obdam 119001 by: John W. Holmes Re: Mysqldump 119002 by: Paul Nicholson working with pspell 119003 by: Andy 119006 by: Lowell Allen Re: access denied 119004 by: Simon Angell Re: Quick question. 119005 by: Simon Angell Can it be Done? 119007 by: Stephen 119008 by: Sascha Cunz 119009 by: . Edwin 119012 by: Adriano Re: after mysqlfront? 119010 by: John W. Holmes formatting / beautifying PHP code 119011 by: Andrew Ziem Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Hi Friends, I am having a local MySQL database tables in Linux and the data is updated in the table using PHP scripts working through apache web server. local MySQL database is connected using the following php scripts. mysql_connect(localhost,root,vinodb) or die (cannot connect to mysqld); mysql_select_db(lnnet) or die(cannot select database); I have created same database and tables which is available locally on web which is having MySQL PHP support. Now I want to update the web database from the local database using php scripts. How do I connect web database and local database simultaneously. I will be grateful, if any body can mail me the connecting scripts, so that I can write php scripts to update the records from local database. or can any body suggest a solution on how to update the tables. Regards, Vinod. ---End Message--- ---BeginMessage--- You have to use mysqldump utility to make script, then you can put it into your PHP script and run that script: ?php $sql = PRODUCED SCRIPT BODY GOES HERE; mysql_query($sql); ? or just dump your database directly to remote server by running mysqldump with parameters Host and some other. The only difficulty could be, that remote provider could reject all emote connections :(( the third way is to place PHP script on remote mashine and to connect to your local MySQL server and just make some SELECT-INSERT. Here you can have the same problem as in previous: proveder can reject all connection aoutside their box :((( ---End Message--- ---BeginMessage--- Hi all, I am having MySQL database on web. (eg., at www.lmcr.net). What is the PHP script which I can connect the MySQL table from my Local machine. Can anybody help me. Regards, Vinod. ---End Message--- ---BeginMessage--- I am having MySQL database on web. (eg., at www.lmcr.net). What is the PHP script which I can connect the MySQL table from my Local machine. Can anybody help me. Well, most hosting companies do not allow remote access to the MySQL server, but if you're does, then you connect the same way as usual... $link_id = mysql_connect(mysql.yourdomain.com,user,password); You just pass the IP or name of your MySQL server in the mysql_connect function. To also connect to your local database, just use $link_id2 = mysql_connect(localhost,user,password); And then you have a connection to each one open. Be sure to use the appropriate $link_id in your queries. ---John Holmes... ---End Message--- ---BeginMessage--- Hi, all -- I've seen a recent flurry of discussion on sessions, and that's good; lovely how that has shown up just as I need to dig into sessions. I think I've come to understand, though, that you can't manage sessions without either URL extensions or cookies, and that's bad (for me, at least). Is that a correct understanding? It seems that using forms to pass the session token would work, but that means having all buttons instead of links, which has its own disadvantages. Is there any other way to get data to the server? We currently use the URL to pass variables but we don't want to hang the page password out there :-) and so we have to maove away from that somehow, and it would be nice if we could get away from URL mangling entirely. Cookies aren't an option, though. TIA HAND :-D -- David T-G
Re: [PHP] Re: Can it be Done?
To produce such a JavaScript: define('_DOMBASE', 'http://yourdomain.com'); echo 'SCRIPT language=JavaScript type=text/javascript'.\n .'if (document.location == top.location)'.\n .' top.location='._DOMBASE.'/index.php?goto=' .base64_encode($_SERVER[REQUEST_URI]).';'.\n .'/SCRIPT'; where the index.php works like: ? if (!isset($_GET['goto'])) $goto = home.php; else $goto = base64_decode($_GET['goto']); ? FRAMESET someframes FRAME src=http://yourdomain.com/? echo $goto; ? /FRAMESET As Stephen reported me recently, this also works with iframes. Sascha Am Sonntag, 6. Oktober 2002 21:37 schrieb Adriano: Hi people, Edwin wrore: 'Not really sure, but perhaps, with Javascript. But I'd rather recommend you to give up iframes... ;) Can you post an example of Javascript code checking for _parent frame? By the way, what's wrong with iframes? bye, Adr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Can it be Done?
I understand and thank you Sascha. Curiosity: why do you use the 'base64_encode' function to send querystring arguments? I'd rather used urlencode... Sascha Cunz [EMAIL PROTECTED] ha scritto nel messaggio [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... To produce such a JavaScript: define('_DOMBASE', 'http://yourdomain.com'); echo 'SCRIPT language=JavaScript type=text/javascript'.\n .'if (document.location == top.location)'.\n .' top.location='._DOMBASE.'/index.php?goto=' .base64_encode($_SERVER[REQUEST_URI]).';'.\n .'/SCRIPT'; where the index.php works like: ? if (!isset($_GET['goto'])) $goto = home.php; else $goto = base64_decode($_GET['goto']); ? FRAMESET someframes FRAME src=http://yourdomain.com/? echo $goto; ? /FRAMESET As Stephen reported me recently, this also works with iframes. Sascha Am Sonntag, 6. Oktober 2002 21:37 schrieb Adriano: Hi people, @ Edwin wrore: 'Not really sure, but perhaps, with Javascript. But I'd rather recommend you to give up iframes... ;) Can you post an example of Javascript code checking for _parent frame? By the way, what's wrong with iframes? bye, Adr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Can it be Done?
should be interchangeable. When i wrote this, i didn't want to show the real url up in browser, so i used base64 encoding. Sascha Am Sonntag, 6. Oktober 2002 23:52 schrieb Adriano: I understand and thank you Sascha. Curiosity: why do you use the 'base64_encode' function to send querystring arguments? I'd rather used urlencode... Sascha Cunz [EMAIL PROTECTED] ha scritto nel messaggio [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... To produce such a JavaScript: define('_DOMBASE', 'http://yourdomain.com'); echo 'SCRIPT language=JavaScript type=text/javascript'.\n .'if (document.location == top.location)'.\n .' top.location='._DOMBASE.'/index.php?goto=' .base64_encode($_SERVER[REQUEST_URI]).';'.\n .'/SCRIPT'; where the index.php works like: ? if (!isset($_GET['goto'])) $goto = home.php; else $goto = base64_decode($_GET['goto']); ? FRAMESET someframes FRAME src=http://yourdomain.com/? echo $goto; ? /FRAMESET As Stephen reported me recently, this also works with iframes. Sascha Am Sonntag, 6. Oktober 2002 21:37 schrieb Adriano: Hi people, @ Edwin wrore: 'Not really sure, but perhaps, with Javascript. But I'd rather recommend you to give up iframes... ;) Can you post an example of Javascript code checking for _parent frame? By the way, what's wrong with iframes? bye, Adr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] need help for a where clause
Hi, I need a where clause in following situation: Say I want to query two tables: A and B. In table A there is field Afn, while in table B there are 3 fields: Bfn1, Bfn2 and Bfn3. I want to do a query, in which the where clause must do these things: if A.Afn=1, then check value of B.Bfn1; if A.Afn=2, then check value of B.Bfn2; if A.Afn=3, then check value of B.Bfn3. So how can I create such a where clause to do this? Thanks in advance! Alex Shi -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to drop a element from an array
Is there a good way do drop an element from an array? Alex Shi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to drop a element from an array
Hint... look at array_push etc (like a stack) Timothy Hitchens (HITCHO) [EMAIL PROTECTED] HITCHO has Spoken! -Original Message- From: Alex Shi [mailto:[EMAIL PROTECTED]] Sent: Monday, 7 October 2002 8:35 AM To: [EMAIL PROTECTED] Subject: [PHP] How to drop a element from an array Is there a good way do drop an element from an array? Alex Shi -- 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] How to drop a element from an array
Yes I have read about the array functions in the manul. But I don't think they are what I need. What I want is to drop what ever an element from an array, not just from top or bottom. I can create a function to do this. But I need a better solution, that is to say not to cost too much memery. Alex Shi Timothy J Hitchens [EMAIL PROTECTED] 写入消息新闻 :002e01c26d89$780c14c0$[EMAIL PROTECTED] Hint... look at array_push etc (like a stack) Timothy Hitchens (HITCHO) [EMAIL PROTECTED] HITCHO has Spoken! -Original Message- From: Alex Shi [mailto:[EMAIL PROTECTED]] Sent: Monday, 7 October 2002 8:35 AM To: [EMAIL PROTECTED] Subject: [PHP] How to drop a element from an array Is there a good way do drop an element from an array? Alex Shi -- 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] How to drop a element from an array
unset $some_variable[4]; then you would need to resort... etc (if needed) Timothy Hitchens (HITCHO) [EMAIL PROTECTED] HITCHO has Spoken! -Original Message- From: Alex Shi [mailto:[EMAIL PROTECTED]] Sent: Monday, 7 October 2002 8:43 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] How to drop a element from an array Yes I have read about the array functions in the manul. But I don't think they are what I need. What I want is to drop what ever an element from an array, not just from top or bottom. I can create a function to do this. But I need a better solution, that is to say not to cost too much memery. Alex Shi Timothy J Hitchens [EMAIL PROTECTED] дÈëÏûÏ¢ÐÂÎÅ :002e01c26d89$780c14c0$[EMAIL PROTECTED] Hint... look at array_push etc (like a stack) Timothy Hitchens (HITCHO) [EMAIL PROTECTED] HITCHO has Spoken! -Original Message- From: Alex Shi [mailto:[EMAIL PROTECTED]] Sent: Monday, 7 October 2002 8:35 AM To: [EMAIL PROTECTED] Subject: [PHP] How to drop a element from an array Is there a good way do drop an element from an array? Alex Shi -- 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] How to drop a element from an array
That adds an element to an array. Just use unset. unset($array[0]); ---John Holmes... -Original Message- From: Timothy J Hitchens [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 06, 2002 6:41 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] How to drop a element from an array Hint... look at array_push etc (like a stack) Timothy Hitchens (HITCHO) [EMAIL PROTECTED] HITCHO has Spoken! -Original Message- From: Alex Shi [mailto:[EMAIL PROTECTED]] Sent: Monday, 7 October 2002 8:35 AM To: [EMAIL PROTECTED] Subject: [PHP] How to drop a element from an array Is there a good way do drop an element from an array? Alex Shi -- 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] How to drop a element from an array
Alex Shi wrote: Is there a good way do drop an element from an array? Unset (http://www.php.net/unset) the element and it will be removed from the array. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to drop a element from an array
Thanks! Alex Shi Timothy J Hitchens [EMAIL PROTECTED] 写入消息新闻 :002f01c26d8a$77332470$[EMAIL PROTECTED] unset $some_variable[4]; then you would need to resort... etc (if needed) Timothy Hitchens (HITCHO) [EMAIL PROTECTED] HITCHO has Spoken! -Original Message- From: Alex Shi [mailto:[EMAIL PROTECTED]] Sent: Monday, 7 October 2002 8:43 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] How to drop a element from an array Yes I have read about the array functions in the manul. But I don't think they are what I need. What I want is to drop what ever an element from an array, not just from top or bottom. I can create a function to do this. But I need a better solution, that is to say not to cost too much memery. Alex Shi Timothy J Hitchens [EMAIL PROTECTED] 写入消息新闻 :002e01c26d89$780c14c0$[EMAIL PROTECTED] Hint... look at array_push etc (like a stack) Timothy Hitchens (HITCHO) [EMAIL PROTECTED] HITCHO has Spoken! -Original Message- From: Alex Shi [mailto:[EMAIL PROTECTED]] Sent: Monday, 7 October 2002 8:35 AM To: [EMAIL PROTECTED] Subject: [PHP] How to drop a element from an array Is there a good way do drop an element from an array? Alex Shi -- 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] need help for a where clause
A solution on that depends strongly on how much values A.Afn would take. For 3, it's still okay. But i wouldn't do more. Against what shall the B.Bfn* be checked? What Data do you want to be returned from the query? try: SELECT ### FROM A, B WHERE ((A.Afn=1) AND (B.Bfn1 = ...)) OR ((A.Afn=2) AND (B.Bfn2 = ...)) OR ((A.Afn=3) AND (B.Bfn3 = ...)) where you should replace ### with things you want to select and ... with the things you want to check. On more than 3 different values for A.Afn, you should use a more normalized version of B. i.e.: B contains only one Bfn field and a Reference to A.Afn. - SELECT ### FROM A, B WHERE B.AfnRef = A.Afn AND B.Bfn = ... Sascha Am Montag, 7. Oktober 2002 00:33 schrieb Alex Shi: Hi, I need a where clause in following situation: Say I want to query two tables: A and B. In table A there is field Afn, while in table B there are 3 fields: Bfn1, Bfn2 and Bfn3. I want to do a query, in which the where clause must do these things: if A.Afn=1, then check value of B.Bfn1; if A.Afn=2, then check value of B.Bfn2; if A.Afn=3, then check value of B.Bfn3. So how can I create such a where clause to do this? Thanks in advance! Alex Shi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IIS 5 - ASP PHP dev enviorment
I have done a little searching and haven't really had a good solid answer for my question. I mainly use ASP for development (and will continue to), but I wanted to dabble in a little PHP for my own curiosity. I am using IIS 5 on Win XP Pro for my dev machine. I have a few ASP applications going and I am looking for some questions as to what to expect to happen if I set up IIS 5 to also run PHP. Am I putting my ASP projects in harms way, buy setting up IIS to use ASP and PHP? Any help would be appreciated, links to information would be just fine. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need help for a where clause
Thanks! This is what I need! Alex Shi Sascha Cunz [EMAIL PROTECTED] 写入消息新闻 :[EMAIL PROTECTED] A solution on that depends strongly on how much values A.Afn would take. For 3, it's still okay. But i wouldn't do more. Against what shall the B.Bfn* be checked? What Data do you want to be returned from the query? try: SELECT ### FROM A, B WHERE ((A.Afn=1) AND (B.Bfn1 = ...)) OR ((A.Afn=2) AND (B.Bfn2 = ...)) OR ((A.Afn=3) AND (B.Bfn3 = ...)) where you should replace ### with things you want to select and ... with the things you want to check. On more than 3 different values for A.Afn, you should use a more normalized version of B. i.e.: B contains only one Bfn field and a Reference to A.Afn. - SELECT ### FROM A, B WHERE B.AfnRef = A.Afn AND B.Bfn = ... Sascha Am Montag, 7. Oktober 2002 00:33 schrieb Alex Shi: Hi, I need a where clause in following situation: Say I want to query two tables: A and B. In table A there is field Afn, while in table B there are 3 fields: Bfn1, Bfn2 and Bfn3. I want to do a query, in which the where clause must do these things: if A.Afn=1, then check value of B.Bfn1; if A.Afn=2, then check value of B.Bfn2; if A.Afn=3, then check value of B.Bfn3. So how can I create such a where clause to do this? Thanks in advance! Alex Shi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: IIS 5 - ASP PHP dev enviorment
If the PHP interpreter is installed, there is nothing stopping you from using both (morals aside). -- Jason Morehouse (jm[@]netconcepts[.]com) Netconcepts - http://www.netconcepts.com Auckland, New Zealand Linux: Because rebooting is for adding hardware. On Sun, 06 Oct 2002 21:10:22 +, Jgreening wrote: I have done a little searching and haven't really had a good solid answer for my question. I mainly use ASP for development (and will continue to), but I wanted to dabble in a little PHP for my own curiosity. I am using IIS 5 on Win XP Pro for my dev machine. I have a few ASP applications going and I am looking for some questions as to what to expect to happen if I set up IIS 5 to also run PHP. Am I putting my ASP projects in harms way, buy setting up IIS to use ASP and PHP? Any help would be appreciated, links to information would be just fine. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] IIS 5 - ASP PHP dev enviorment
I have done a little searching and haven't really had a good solid answer for my question. I mainly use ASP for development (and will continue to), but I wanted to dabble in a little PHP for my own curiosity. I am using IIS 5 on Win XP Pro for my dev machine. I have a few ASP applications going and I am looking for some questions as to what to expect to happen if I set up IIS 5 to also run PHP. Am I putting my ASP projects in harms way, buy setting up IIS to use ASP and PHP? Any help would be appreciated, links to information would be just fine. You can run both of them without problems. Since ASP is a default on IIS, any IIS server set up to run PHP is running them both... I haven't heard of any problems caused just by having the two running at once. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IIS 5 - ASP PHP dev enviorment
You can run both of them without problems. Since ASP is a default on IIS, any IIS server set up to run PHP is running them both... I haven't heard of any problems caused just by having the two running at once. ---John Holmes... I got this configuration times ago... Works without any problems I am still using one machine, which needs IIS and PHP. There is really no big deal about that. Sascha -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: IIS 5 - ASP PHP dev enviorment
I don't know how familiar you are with PHP yet. But I recently decided to learn PHP myself having already learnt ASP. These 3 things helped me the most. This is a summary of the language differences between PHP, JScript/Javascript and VBScript http://php.weblogs.com/php_jscript_vbscript_1 ADOdb: encapsulates the different PHP database code into a class that's very similar to ADO. thus the name. This enables you to access a MySQL Db, an Access DB or anything else with little hassle. Handy from a cross platform point of view and when you might need to change DB's at a later date. http://php.weblogs.com/ADOdb And of course get the latest downloadable PHP manual. Happy Dabbling! Cheers Brendon -Original Message- From: Jason Morehouse [mailto:[EMAIL PROTECTED]] Sent: Monday, October 07, 2002 9:52 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: IIS 5 - ASP PHP dev enviorment If the PHP interpreter is installed, there is nothing stopping you from using both (morals aside). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] getimagesize or loop pblm
Hi all, Does anybody can tell me why i have this error :Fatal error: Maximum execution time of 5 seconds exceeded in photos2.php on line 28 whith this $tab_img = array(); $tab_img_size = array(); for($i=0;$i=56;$i++){ $tab_img[$i] = images/tof/real_size/techp02_.$i..jpg; $tab_img_size = array( /* line 28 */ $i = getimagesize($tab_img[$i])); } Is the getimagesize function too long for making it 56 times?? What do u think ? In fact i want to get all the image size to make a popup link on the thumnail at the real size of the image.Because images don't have the same size and i want to have a clean window whith the popup. I've ever tried this before : $tab_img = array(); $tab_img_size = array(); for($i=0;$i=56;$i++){ $tab_img[$i] = images/tof/real_size/techp02_.$i..jpg; $tab_img_size[$i] = getimagesize($tab_img[$i]); } Hope you understand. TIA. zeg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] getimagesize or loop pblm
It could take a while. Depends how fast your server's disk sub-system is. Going to disk to stat and open an image and then parse through the initial headers to get the sizing data can take some time. I'd suggest caching this data somewhere if you are going to need it on every request. -Rasmus On Mon, 7 Oct 2002, arnaud gonzales wrote: Hi all, Does anybody can tell me why i have this error :Fatal error: Maximum execution time of 5 seconds exceeded in photos2.php on line 28 whith this $tab_img = array(); $tab_img_size = array(); for($i=0;$i=56;$i++){ $tab_img[$i] = images/tof/real_size/techp02_.$i..jpg; $tab_img_size = array( /*line 28 */ $i = getimagesize($tab_img[$i])); } Is the getimagesize function too long for making it 56 times?? What do u think ? In fact i want to get all the image size to make a popup link on the thumnail at the real size of the image.Because images don't have the same size and i want to have a clean window whith the popup. I've ever tried this before : $tab_img = array(); $tab_img_size = array(); for($i=0;$i=56;$i++){ $tab_img[$i] = images/tof/real_size/techp02_.$i..jpg; $tab_img_size[$i] = getimagesize($tab_img[$i]); } Hope you understand. TIA. zeg -- 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] getimagesize or loop pblm
So my code is clean ? There isn't a problem of infiny loop? My server is free.fr. How do u suggest i can cach the data? -Message d'origine- De : Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Envoye : lundi 7 octobre 2002 03:07 A : arnaud gonzales Cc : Php-General Objet : Re: [PHP] getimagesize or loop pblm It could take a while. Depends how fast your server's disk sub-system is. Going to disk to stat and open an image and then parse through the initial headers to get the sizing data can take some time. I'd suggest caching this data somewhere if you are going to need it on every request. -Rasmus On Mon, 7 Oct 2002, arnaud gonzales wrote: Hi all, Does anybody can tell me why i have this error :Fatal error: Maximum execution time of 5 seconds exceeded in photos2.php on line 28 whith this $tab_img = array(); $tab_img_size = array(); for($i=0;$i=56;$i++){ $tab_img[$i] = images/tof/real_size/techp02_.$i..jpg; $tab_img_size = array( /*line 28 */ $i = getimagesize($tab_img[$i])); } Is the getimagesize function too long for making it 56 times?? What do u think ? In fact i want to get all the image size to make a popup link on the thumnail at the real size of the image.Because images don't have the same size and i want to have a clean window whith the popup. I've ever tried this before : $tab_img = array(); $tab_img_size = array(); for($i=0;$i=56;$i++){ $tab_img[$i] = images/tof/real_size/techp02_.$i..jpg; $tab_img_size[$i] = getimagesize($tab_img[$i]); } Hope you understand. TIA. zeg -- 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] sessions without cookies *or* URLs
Justin, et al -- ...and then Justin French said... % % I think you're under a little misconception about how sessions are used. Perhaps. I'm new to them :-) % Maintaining a session is simply just having a unique identifier for each % user, so that the server can recognise the user from page to page, % maintaining state. Right. And since it can recognize the user, it can store all sorts of things for him, like the fact that he's been authenticated and what function he did last and so on. Right? % % Typically this is done by passing a session id around in he URL or cookies % or POSTing forms. A session ID is typically a long unique number -- that's % it. Right. But it's the in the URL or cookies that's a problem for me. % % % What you then do associate or register data TO that Session ID... this data % is stored on the SERVER, and NOT passed around in the URL. I understand enough that the data itself isn't in the URL, and that's good (because some of these page comments get long!). % % % So you pass around PHPSESSID=198235021612423 in the url or a cookie, and % assign data to that session... all of which is stored server side. Are those the only ways that I can pass it around? Is there anything else? [Note that I've come to the conclusion that they are and there isn't except perhaps a POST form, but I'd love to be pleasantly surprised.] % % The session with the id 198235021612423 may have a username, password, shoe % size, favourite colour, etc etc all attached to it, done with either: Good deal; that's what I like. % % $_SESSION['shoesize'] = 14; // new register globals OFF method % % or % % $shoesize = 14; % session_register(shoesize); // old method Right. % % % Therefor, I can see no need for anything other than the session ID to be % passed around in the URL. % % Hope this clears it up! It's a start; it confirms some of what I think I understand about sessions. Now if only I can get the session ID out of the URL without using any cookies... Any ideas, anyone? % % % Justin French TIA HAND :-D -- David T-G * It's easier to fight for one's principles (play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie (work) [EMAIL PROTECTED] http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg! msg81311/pgp0.pgp Description: PGP signature
Re: [PHP] getimagesize or loop pblm
You can calculate the image size when adding the image (rather than when displaying it) and store the information in a file or a database. This file or database you could use for posting the right sizes for popup windows. Sascha Am Montag, 7. Oktober 2002 03:22 schrieb arnaud gonzales: So my code is clean ? There isn't a problem of infiny loop? My server is free.fr. How do u suggest i can cach the data? -Message d'origine- De : Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Envoye : lundi 7 octobre 2002 03:07 A : arnaud gonzales Cc : Php-General Objet : Re: [PHP] getimagesize or loop pblm It could take a while. Depends how fast your server's disk sub-system is. Going to disk to stat and open an image and then parse through the initial headers to get the sizing data can take some time. I'd suggest caching this data somewhere if you are going to need it on every request. -Rasmus On Mon, 7 Oct 2002, arnaud gonzales wrote: Hi all, Does anybody can tell me why i have this error :Fatal error: Maximum execution time of 5 seconds exceeded in photos2.php on line 28 whith this $tab_img = array(); $tab_img_size = array(); for($i=0;$i=56;$i++){ $tab_img[$i] = images/tof/real_size/techp02_.$i..jpg; $tab_img_size = array( /* line 28 */ $i = getimagesize($tab_img[$i])); } Is the getimagesize function too long for making it 56 times?? What do u think ? In fact i want to get all the image size to make a popup link on the thumnail at the real size of the image.Because images don't have the same size and i want to have a clean window whith the popup. I've ever tried this before : $tab_img = array(); $tab_img_size = array(); for($i=0;$i=56;$i++){ $tab_img[$i] = images/tof/real_size/techp02_.$i..jpg; $tab_img_size[$i] = getimagesize($tab_img[$i]); } Hope you understand. TIA. zeg -- 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 without cookies *or* URLs
You can pass the session ID in a form, too. Just use POST, and make it a hidden element passed to the next page. input type=hidden name=PHPSESSID value=?=$PHPSESSID? It's no different than passing it in the URL. I hope you're not thinking that it's more secure by doing it this way. Either way the data is coming from the user and it can't be trusted and it can be modified. I don't know what this phobia is about passing something in the URL... ---John Holmes... -Original Message- From: David T-G [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 06, 2002 9:33 PM To: PHP General list Cc: Justin French Subject: Re: [PHP] sessions without cookies *or* URLs Justin, et al -- ...and then Justin French said... % % I think you're under a little misconception about how sessions are used. Perhaps. I'm new to them :-) % Maintaining a session is simply just having a unique identifier for each % user, so that the server can recognise the user from page to page, % maintaining state. Right. And since it can recognize the user, it can store all sorts of things for him, like the fact that he's been authenticated and what function he did last and so on. Right? % % Typically this is done by passing a session id around in he URL or cookies % or POSTing forms. A session ID is typically a long unique number -- that's % it. Right. But it's the in the URL or cookies that's a problem for me. % % % What you then do associate or register data TO that Session ID... this data % is stored on the SERVER, and NOT passed around in the URL. I understand enough that the data itself isn't in the URL, and that's good (because some of these page comments get long!). % % % So you pass around PHPSESSID=198235021612423 in the url or a cookie, and % assign data to that session... all of which is stored server side. Are those the only ways that I can pass it around? Is there anything else? [Note that I've come to the conclusion that they are and there isn't except perhaps a POST form, but I'd love to be pleasantly surprised.] % % The session with the id 198235021612423 may have a username, password, shoe % size, favourite colour, etc etc all attached to it, done with either: Good deal; that's what I like. % % $_SESSION['shoesize'] = 14; // new register globals OFF method % % or % % $shoesize = 14; % session_register(shoesize); // old method Right. % % % Therefor, I can see no need for anything other than the session ID to be % passed around in the URL. % % Hope this clears it up! It's a start; it confirms some of what I think I understand about sessions. Now if only I can get the session ID out of the URL without using any cookies... Any ideas, anyone? % % % Justin French TIA HAND :-D -- David T-G * It's easier to fight for one's principles (play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie (work) [EMAIL PROTECTED] http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sessions without cookies *or* URLs
on 07/10/02 11:32 AM, David T-G ([EMAIL PROTECTED]) wrote: It's a start; it confirms some of what I think I understand about sessions. Now if only I can get the session ID out of the URL without using any cookies... Any ideas, anyone? I Thought I made it clear, but I'll try again :) You have three options for maintaining state: - Cookies - URL - POSTed forms The most common method is plain cookies. But if you want guaranteed state, then URL is the answer. My main problem with the URL method is that it requires the writer(s) to be careful when typing links... ensuring that they have the session ID in them. Impossible for a CMS. The answer is enabel_trans_sid. More and more hosts are compiling with enable_trans_sid... what this does is: attempt to pass the SID around in a cookie. If this fails, it will re-write any relative URLs in your pages to include the session ID... it's the best of both worlds... transparent cookies if possible, otherwise the SID is passed around in a URL. So, this rules out a complaint about complicated URLs, because you don't have to type them. I urge you to look around all the big sites... if they need to maintain state (a session) they do so with URLs... amazon.com, whatever -- they all do it. Why do you not wish to use URLs? Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] server error sending email from script
Q: If I'm not on the server that is to be used to send the email, how can I configure PHP to send from a certain server? thanks all Warning: Server Error in c:\program files\apache group\apache\htdocs\sonicmailer\sonicadmin.php on line 276 and line 276 is mail($address, stripslashes($subject), $finalbody, $mailheaders); and it's not sending the email. The variables are OK, $mailheaders=From: blah Reply-To: [EMAIL PROTECTED]
Re: [PHP] server error sending email from script
it appears you are on windows, so look in php.ini for the smtp directive. enter your isp's smtp server address there. then restart apache and it should work. Jason Reid [EMAIL PROTECTED] -- AC Host Canada www.achost.ca - Original Message - From: John [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, October 06, 2002 8:31 PM Subject: [PHP] server error sending email from script Q: If I'm not on the server that is to be used to send the email, how can I configure PHP to send from a certain server? thanks all Warning: Server Error in c:\program files\apache group\apache\htdocs\sonicmailer\sonicadmin.php on line 276 and line 276 is mail($address, stripslashes($subject), $finalbody, $mailheaders); and it's not sending the email. The variables are OK, $mailheaders=From: blah Reply-To: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] server error sending email from script
I don't use Windows for development/production but I read somewhere that you needed to set in your php.ini for windows a config for either the host server that had email capabilities. That's all I can offer. Timothy Hitchens (HITCHO) [EMAIL PROTECTED] HITCHO has Spoken! -Original Message- From: John [mailto:[EMAIL PROTECTED]] Sent: Monday, 7 October 2002 12:32 PM To: [EMAIL PROTECTED] Subject: [PHP] server error sending email from script Q: If I'm not on the server that is to be used to send the email, how can I configure PHP to send from a certain server? thanks all Warning: Server Error in c:\program files\apache group\apache\htdocs\sonicmailer\sonicadmin.php on line 276 and line 276 is mail($address, stripslashes($subject), $finalbody, $mailheaders); and it's not sending the email. The variables are OK, $mailheaders=From: blah Reply-To: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Can it be Done?
Hello, Adriano wrote: Hi people, @ Edwin wrore: 'Not really sure, but perhaps, with Javascript. But I'd rather recommend you to give up iframes... ;) Can you post an example of Javascript code checking for _parent frame? I think you already got this working... however, what if javascript is disabled? By the way, what's wrong with iframes? Browser support. (And perhaps, usability and accessiblity.) It seems like iframes have lesser problems than frames. Anyway, the bottomline is, if you're concerned about making your site more accessible to more people, just say "no" to frames and iframes. - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session.cookie_domain
howdy, I have a server running a number of domains as virtual hosts under apache if i wanted to set a cookie domain can i set it for all domains in php.ini? or is it better to set it using ini_set(session.cookie_domain, domain) in each site? Cheers Peter the only dumb question is the one that wasn't asked -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php