Re: [PHP] Refresh (F5) adds another SQL record.
If the user hits the back button and then the forward, it sometimes resubmits the form. This is why i initiated the session and ended it at the end of the data processing page. If they happen to press forward, or back, it will still not initiate the form unless they have actually visitied and submitted the form. 2008/12/7 Ashley Sheridan <[EMAIL PROTECTED]> > On Sun, 2008-12-07 at 16:44 +, Bhupendra Patel wrote: > > I've found a way that works for me. > > > > Using the START SESSION on the initial form, e.g. > > > session_start(); > > // store session data > > $_SESSION['form'] = "1"; > > ?> > > > > and the using the code below in the processing form. > > > > You can do a check if the user has already submitted the from by the > initial > > session that starts then he/she is on the submitting form. If it is > already > > set it can continue, else stop and redirect. > > MAKE SURE to put the unset session at the end of the form. > > > > > > > > Add Publication > > > > > > Add > > > // Check session > > session_start(); > > if ($_SESSION['form'] == 1) > > { > > // create short variable names > > $producttype=$_POST['producttype']; > > $producttitle=$_POST['producttitle']; > > $productdescription=$_POST['productdescription']; > > $productauthor=$_POST['productauthor']; > > $productlang=$_POST['productlang']; > > $productprice=$_POST['productprice']; > > $productstatus=$_POST['productstatus']; > > $productimg=$_POST['productimg']; > > } > > else > > { > > echo 'Go back and complete the form'; > > echo header('Location: insertpublication.php'); > > exit; > > } > > // End session checking > > > > if (!$producttype || !$producttitle || !$productauthor || !$productlang > || > > !$productprice || !$productstatus) > > { > > echo 'You have not entered all the required details.' > > .'Please go back and try again.'; > > unset($_SESSION['form']); > > exit; > > } > > > > @ $prodb = new mysqli('I DONT THINK SO!!!'); > > if (mysqli_connect_errno()) > > { > > echo 'Error: Could not connect to database. Please try again > later.'; > > exit; > > } > > $query = "INSERT into tblproductinfo > > (ProductType, ProductTitle, ProductDesc, ProdAuthor, > > ProductLang, ProductPrice, ProductStatus, ProductImg) > > VALUES > > ('".$producttype."', '".$producttitle."', > > '".$productdescription."', '".$productauthor."', '".$productlang."', > > '".$productprice."', '".$productstatus."', > '".$productimg."')"; > > > > $result = $prodb->query($query); > > if ($result) > > echo $prodb->affected_rows.' book inserted into database.'; > > > > $queryshow = " > > SELECT > > tblproductinfo.ProductID, > > tblproductinfo.ProductTitle, > > tblproductinfo.ProductDesc, > > tblproductinfo.ProductPrice, > > tblproductinfo.ProductTQty, > > tblproductinfo.ProductImg, > > tblauthor.AuthorName, > > tblproductlang.ProductLang, > > tblproducttype.ProductType, > > tblproductstatus.ProductStatus > > FROM > > tblproductinfo > > Inner Join tblproductstatus ON tblproductinfo.ProductStatus = > > tblproductstatus.ProductStatusID > > Inner Join tblproductlang ON tblproductinfo.ProductLang = > > tblproductlang.ProductLangID > > Inner Join tblauthor ON tblproductinfo.ProdAuthor = > tblauthor.AuthorID > > Inner Join tblproducttype ON tblproductinfo.ProductType = > > tblproducttype.ProductTypeID"; > > $resultshow = $prodb->query($queryshow); > > > > $num_results = $resultshow->num_rows; > > echo ' > > > > > > > > Book ID > > > > > > Type > > > > > > Title > > > > > > Description > > > > > > Author > > > > > > Language > > > > > > Price > > > > > > Status > > > > > > Image > > > >'; > > for ($i=0; $i <$num_results; $i++) > > { > > $row = $resultshow->fetch_assoc(); > > echo ''; > > echo ''.($row['ProductID']).''; > > echo ''.($row['ProductType']).''; > > echo ''.($row['ProductTitle']).''; > > echo ''.($row['ProductDesc']).''; > > echo ''.($row['AuthorName']).''; > > echo ''.($row['ProductLang']).''; > > echo '£'.($row['ProductPrice']).''; > > echo ''.($row['ProductStatus']).''; > > echo 'Preview image > > '; > > echo ''; > >}; > > echo ''; > > > > unset($_SESSION['form']); > > > > $prodb->close(); > > ?> > > > > > Would redirecting the user with a header() request do the job? Or, > failing that, how about outputting a > location.href='foo.com' line? > > > Ash > www.ashleysheridan.co.uk > >
Re: [PHP] Refresh (F5) adds another SQL record.
On Sun, 2008-12-07 at 16:44 +, Bhupendra Patel wrote: > I've found a way that works for me. > > Using the START SESSION on the initial form, e.g. > session_start(); > // store session data > $_SESSION['form'] = "1"; > ?> > > and the using the code below in the processing form. > > You can do a check if the user has already submitted the from by the initial > session that starts then he/she is on the submitting form. If it is already > set it can continue, else stop and redirect. > MAKE SURE to put the unset session at the end of the form. > > > > Add Publication > > > Add > // Check session > session_start(); > if ($_SESSION['form'] == 1) > { > // create short variable names > $producttype=$_POST['producttype']; > $producttitle=$_POST['producttitle']; > $productdescription=$_POST['productdescription']; > $productauthor=$_POST['productauthor']; > $productlang=$_POST['productlang']; > $productprice=$_POST['productprice']; > $productstatus=$_POST['productstatus']; > $productimg=$_POST['productimg']; > } > else > { > echo 'Go back and complete the form'; > echo header('Location: insertpublication.php'); > exit; > } > // End session checking > > if (!$producttype || !$producttitle || !$productauthor || !$productlang || > !$productprice || !$productstatus) > { > echo 'You have not entered all the required details.' > .'Please go back and try again.'; > unset($_SESSION['form']); > exit; > } > > @ $prodb = new mysqli('I DONT THINK SO!!!'); > if (mysqli_connect_errno()) > { > echo 'Error: Could not connect to database. Please try again later.'; > exit; > } > $query = "INSERT into tblproductinfo > (ProductType, ProductTitle, ProductDesc, ProdAuthor, > ProductLang, ProductPrice, ProductStatus, ProductImg) > VALUES > ('".$producttype."', '".$producttitle."', > '".$productdescription."', '".$productauthor."', '".$productlang."', > '".$productprice."', '".$productstatus."', '".$productimg."')"; > > $result = $prodb->query($query); > if ($result) > echo $prodb->affected_rows.' book inserted into database.'; > > $queryshow = " > SELECT > tblproductinfo.ProductID, > tblproductinfo.ProductTitle, > tblproductinfo.ProductDesc, > tblproductinfo.ProductPrice, > tblproductinfo.ProductTQty, > tblproductinfo.ProductImg, > tblauthor.AuthorName, > tblproductlang.ProductLang, > tblproducttype.ProductType, > tblproductstatus.ProductStatus > FROM > tblproductinfo > Inner Join tblproductstatus ON tblproductinfo.ProductStatus = > tblproductstatus.ProductStatusID > Inner Join tblproductlang ON tblproductinfo.ProductLang = > tblproductlang.ProductLangID > Inner Join tblauthor ON tblproductinfo.ProdAuthor = tblauthor.AuthorID > Inner Join tblproducttype ON tblproductinfo.ProductType = > tblproducttype.ProductTypeID"; > $resultshow = $prodb->query($queryshow); > > $num_results = $resultshow->num_rows; > echo ' > > > > Book ID > > > Type > > > Title > > > Description > > > Author > > > Language > > > Price > > > Status > > > Image > >'; > for ($i=0; $i <$num_results; $i++) > { > $row = $resultshow->fetch_assoc(); > echo ''; > echo ''.($row['ProductID']).''; > echo ''.($row['ProductType']).''; > echo ''.($row['ProductTitle']).''; > echo ''.($row['ProductDesc']).''; > echo ''.($row['AuthorName']).''; > echo ''.($row['ProductLang']).''; > echo '£'.($row['ProductPrice']).''; > echo ''.($row['ProductStatus']).''; > echo 'Preview image > '; > echo ''; >}; > echo ''; > > unset($_SESSION['form']); > > $prodb->close(); > ?> > > Would redirecting the user with a header() request do the job? Or, failing that, how about outputting a location.href='foo.com' line? Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh (F5) adds another SQL record.
I've found a way that works for me. Using the START SESSION on the initial form, e.g. and the using the code below in the processing form. You can do a check if the user has already submitted the from by the initial session that starts then he/she is on the submitting form. If it is already set it can continue, else stop and redirect. MAKE SURE to put the unset session at the end of the form. Add Publication Add ' .'Please go back and try again.'; unset($_SESSION['form']); exit; } @ $prodb = new mysqli('I DONT THINK SO!!!'); if (mysqli_connect_errno()) { echo 'Error: Could not connect to database. Please try again later.'; exit; } $query = "INSERT into tblproductinfo (ProductType, ProductTitle, ProductDesc, ProdAuthor, ProductLang, ProductPrice, ProductStatus, ProductImg) VALUES ('".$producttype."', '".$producttitle."', '".$productdescription."', '".$productauthor."', '".$productlang."', '".$productprice."', '".$productstatus."', '".$productimg."')"; $result = $prodb->query($query); if ($result) echo $prodb->affected_rows.' book inserted into database.'; $queryshow = " SELECT tblproductinfo.ProductID, tblproductinfo.ProductTitle, tblproductinfo.ProductDesc, tblproductinfo.ProductPrice, tblproductinfo.ProductTQty, tblproductinfo.ProductImg, tblauthor.AuthorName, tblproductlang.ProductLang, tblproducttype.ProductType, tblproductstatus.ProductStatus FROM tblproductinfo Inner Join tblproductstatus ON tblproductinfo.ProductStatus = tblproductstatus.ProductStatusID Inner Join tblproductlang ON tblproductinfo.ProductLang = tblproductlang.ProductLangID Inner Join tblauthor ON tblproductinfo.ProdAuthor = tblauthor.AuthorID Inner Join tblproducttype ON tblproductinfo.ProductType = tblproducttype.ProductTypeID"; $resultshow = $prodb->query($queryshow); $num_results = $resultshow->num_rows; echo ' Book ID Type Title Description Author Language Price Status Image '; for ($i=0; $i <$num_results; $i++) { $row = $resultshow->fetch_assoc(); echo ''; echo ''.($row['ProductID']).''; echo ''.($row['ProductType']).''; echo ''.($row['ProductTitle']).''; echo ''.($row['ProductDesc']).''; echo ''.($row['AuthorName']).''; echo ''.($row['ProductLang']).''; echo '£'.($row['ProductPrice']).''; echo ''.($row['ProductStatus']).''; echo 'Preview image '; echo ''; }; echo ''; unset($_SESSION['form']); $prodb->close(); ?>
Re: [PHP] Cron php & refresh
On Sunday 20 April 2008 13:37:04 Per Jessen wrote: > Børge Holen wrote: > > Is the MTA operational on the server? if so, forget > > mailing with php and rather use php to access the mta. > > Yeah, that is what mail() does - it calls sendmail. > > > /Per Jessen, Zürich What the point of 50 mails now and then, let it all be decided by the mta. you don't need php to do stuff it isn't intended for. the mta will send next mail as the previous is accepted and written off as sent. -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cron php & refresh
On Sun, 2008-04-20 at 13:32 -0500, Larry Garfield wrote: > On Sunday 20 April 2008, Jeffrey wrote: > > I'm working on an application that includes e-mail notifications of > > certain events. Because the application will have hundreds or thousands > > of users, I've designed it so that e-mail notifications are saved to a > > MySQL table. Then a regular cron job runs a php page to select the data > > from the table, put it into a mail() command and mail. > > > > My original vision was to have the script do about 50 mails, then pause > > for a 5 seconds, do a meta refresh and run through another 50 and so on > > - with experimentation in numbers as necessary. This process was set up > > because I recall reading somewhere - perhaps the manual - that it is not > > a good thing to run too many php mail()s in succession. Also, I worry > > about php time-outs. > > > > If you know more about PHP and 'nix than I do, you already realise the > > fatal flaw here: meta refresh doesn't work on a cron job. > > > > Question: is there an alternative? I appreciate I could use sleep() > > after every 50 mails - but there would still be the time-out problem. > > > > I've searched the manual and via Google - but haven't found anything - > > possibly I am searching on the wrong terms. > > > > Your help will be much appreciated. > > Why not just have the cron task itself run every 5 minutes? Every 5 > minutes, > hit a PHP script that will pull the next 50 messages to send and send them, > then exit. In 5 minutes minus the time that takes, cron will fire your > script again. Problem solved. If you take this approach, just make sure you build a proper queuing system or mark the mails you're processing as being processed in the DB. Otherwise you could end up with a situation where the system takes longer than 5 minutes to process the mails (it shouldn't, but you never know - maybe there's a rogue process or the mail queue is backed up or something) and then the PHP script starts at the beginning of those 50 mails again. It's an obvious error, but I've done it in an app where I thought "There's no way the process won't finish before the next cron job starts", and then it happened and I ended up sending a couple thousand SMS's out twice at cost to my client. Oops. J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cron php & refresh
On Sunday 20 April 2008, Jeffrey wrote: > I'm working on an application that includes e-mail notifications of > certain events. Because the application will have hundreds or thousands > of users, I've designed it so that e-mail notifications are saved to a > MySQL table. Then a regular cron job runs a php page to select the data > from the table, put it into a mail() command and mail. > > My original vision was to have the script do about 50 mails, then pause > for a 5 seconds, do a meta refresh and run through another 50 and so on > - with experimentation in numbers as necessary. This process was set up > because I recall reading somewhere - perhaps the manual - that it is not > a good thing to run too many php mail()s in succession. Also, I worry > about php time-outs. > > If you know more about PHP and 'nix than I do, you already realise the > fatal flaw here: meta refresh doesn't work on a cron job. > > Question: is there an alternative? I appreciate I could use sleep() > after every 50 mails - but there would still be the time-out problem. > > I've searched the manual and via Google - but haven't found anything - > possibly I am searching on the wrong terms. > > Your help will be much appreciated. Why not just have the cron task itself run every 5 minutes? Every 5 minutes, hit a PHP script that will pull the next 50 messages to send and send them, then exit. In 5 minutes minus the time that takes, cron will fire your script again. Problem solved. -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it." -- Thomas Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cron php & refresh
Børge Holen wrote: > Is the MTA operational on the server? if so, forget > mailing with php and rather use php to access the mta. Yeah, that is what mail() does - it calls sendmail. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cron php & refresh
Jeffrey wrote: > Per Jessen wrote: >> Jeffrey wrote: >> >>> I'm working on an application that includes e-mail notifications of >>> certain events. Because the application will have hundreds or >>> thousands of users, I've designed it so that e-mail notifications >>> are saved to a MySQL table. Then a regular cron job runs a php page >>> to select the data from the table, put it into a mail() command and >>> mail. >> >> Why not just send the notification at the time of the event? (I >> assume you update the database at the time of the event). >> >> >> /Per Jessen, Zürich >> >> > Because in my experience, several hundred e-mails takes time to send, > hence either the user leaves the page before all the mails are sent or > the page times out before all mails are sent. And if there are > thousands of e-mails, it will only get worse. Sorry, I (wrongly) assumed 1 event = 1 email. OK, then I'd stick to what you're doing - add the event to a queue (i.e. your database), and poll this at regular intervals. I don't think you need to worry about the number of emails sent per interval. Just let your PHP script generate the sendmail commands and the email-text to stdout, then pipe that to /bin/sh. The output generated by your script would look like this: sendmail -oi -r . < .
Re: [PHP] Cron php & refresh
Per Jessen wrote: Jeffrey wrote: I'm working on an application that includes e-mail notifications of certain events. Because the application will have hundreds or thousands of users, I've designed it so that e-mail notifications are saved to a MySQL table. Then a regular cron job runs a php page to select the data from the table, put it into a mail() command and mail. Why not just send the notification at the time of the event? (I assume you update the database at the time of the event). /Per Jessen, Zürich Because in my experience, several hundred e-mails takes time to send, hence either the user leaves the page before all the mails are sent or the page times out before all mails are sent. And if there are thousands of e-mails, it will only get worse. Jeffrey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cron php & refresh
On Sunday 20 April 2008 11:27:38 Jeffrey wrote: > I'm working on an application that includes e-mail notifications of > certain events. Because the application will have hundreds or thousands > of users, I've designed it so that e-mail notifications are saved to a > MySQL table. Then a regular cron job runs a php page to select the data > from the table, put it into a mail() command and mail. > > My original vision was to have the script do about 50 mails, then pause > for a 5 seconds, do a meta refresh and run through another 50 and so on > - with experimentation in numbers as necessary. This process was set up > because I recall reading somewhere - perhaps the manual - that it is not > a good thing to run too many php mail()s in succession. Also, I worry > about php time-outs. > > If you know more about PHP and 'nix than I do, you already realise the > fatal flaw here: meta refresh doesn't work on a cron job. > > Question: is there an alternative? I appreciate I could use sleep() > after every 50 mails - but there would still be the time-out problem. > > I've searched the manual and via Google - but haven't found anything - > possibly I am searching on the wrong terms. > > Your help will be much appreciated. > > Thanks, > > Jeffrey What a waste. Is the MTA operational on the server? if so, forget mailing with php and rather use php to access the mta. It is designed to actually send mails, lots of lots of em. If not, set it up. I recon a cluster with hundreds of thousands of users ought to have such a thing... a couple of blades or some of those solaris niagara 8 core nicies doing it. -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cron php & refresh
Jeffrey wrote: > I'm working on an application that includes e-mail notifications of > certain events. Because the application will have hundreds or > thousands of users, I've designed it so that e-mail notifications are > saved to a MySQL table. Then a regular cron job runs a php page to > select the data from the table, put it into a mail() command and mail. Why not just send the notification at the time of the event? (I assume you update the database at the time of the event). /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cron php & refresh
I'm working on an application that includes e-mail notifications of certain events. Because the application will have hundreds or thousands of users, I've designed it so that e-mail notifications are saved to a MySQL table. Then a regular cron job runs a php page to select the data from the table, put it into a mail() command and mail. My original vision was to have the script do about 50 mails, then pause for a 5 seconds, do a meta refresh and run through another 50 and so on - with experimentation in numbers as necessary. This process was set up because I recall reading somewhere - perhaps the manual - that it is not a good thing to run too many php mail()s in succession. Also, I worry about php time-outs. If you know more about PHP and 'nix than I do, you already realise the fatal flaw here: meta refresh doesn't work on a cron job. Question: is there an alternative? I appreciate I could use sleep() after every 50 mails - but there would still be the time-out problem. I've searched the manual and via Google - but haven't found anything - possibly I am searching on the wrong terms. Your help will be much appreciated. Thanks, Jeffrey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh PHP page via onclick event
At 1:40 PM +0200 4/15/06, Alain Roger wrote: Hi, Sorry to look like stupid for some of you, but i'm still not able to link to link ( ) or to a button via onclick event) the refresh of my page. i've check META tag and also $PHP_SELF variable, but it does not work. here is what i would like to do. i have 1 PHP page on which i have 3 flags (3 images) if user click on 1 of these flags, $_SESSION['Localization'] is set up to flag language and the page must be refreshed. thanks a lot for some help or tutorials. Alain Alain: Try this: http://www.sperling.com/examples/styleswitch/ The demo jumps from one style sheet to another, but with a little alteration it could be expanded to solve your problem. It also stores the user preference in a cookie -- you probably want that as well. However, it does use a POST in the operation, BUT the switch is so fast that the user usually doesn't see it added to the url. Try the above link and see for yourself. HTH's tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh PHP page via onclick event
Or, use form and images as button and you will not get variables at the end of the link: > and on the top of the page (php file) before you grab info from database and language info (maybe i the header file): -afan > On 15 Apr 2006, at 12:51, Alain Roger wrote: > >> but i do not want to add some variable at the end of link... >> when user click on the flag, it should first store language into a >> $_SESSION >> variable and after redirect/refresh page. > > Not possible. Web pages don't work like that. > > You need the flags to link somewhere, and only then can it store the > details in the session. So either each flag links to its own PHP > script (pointless), or you follow the advice of Chris and handle it > that way. However you look at it though, you've got to pass a > language somehow. Either via the query string, or by calling a unique > script that handles that language only. > > Cheers, > > Rich > -- > http://www.corephp.co.uk > Zend Certified Engineer > PHP Development Services > > -- > 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] refresh PHP page via onclick event
On 15 Apr 2006, at 12:51, Alain Roger wrote: but i do not want to add some variable at the end of link... when user click on the flag, it should first store language into a $_SESSION variable and after redirect/refresh page. Not possible. Web pages don't work like that. You need the flags to link somewhere, and only then can it store the details in the session. So either each flag links to its own PHP script (pointless), or you follow the advice of Chris and handle it that way. However you look at it though, you've got to pass a language somehow. Either via the query string, or by calling a unique script that handles that language only. Cheers, Rich -- http://www.corephp.co.uk Zend Certified Engineer PHP Development Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh PHP page via onclick event
but i do not want to add some variable at the end of link... when user click on the flag, it should first store language into a $_SESSION variable and after redirect/refresh page. On 4/15/06, chris smith <[EMAIL PROTECTED]> wrote: > > On 4/15/06, Alain Roger <[EMAIL PROTECTED]> wrote: > > Hi, > > > > Sorry to look like stupid for some of you, but i'm still not able to > link to > > link ( ) or to a button via onclick event) the refresh of my > page. > > > > i've check META tag and also $PHP_SELF variable, but it does not work. > > What happens when you try? > > > i have 1 PHP page on which i have 3 flags (3 images) > > if user click on 1 of these flags, $_SESSION['Localization'] is set up > to > > flag language and the page must be refreshed. > > Something like this should work: > > English > French > > Then check $_GET['lang'] to use the new language var (then set it in > the session etc). > > -- > Postgresql & php tutorials > http://www.designmagick.com/ >
Re: [PHP] refresh PHP page via onclick event
On 4/15/06, Alain Roger <[EMAIL PROTECTED]> wrote: > Hi, > > Sorry to look like stupid for some of you, but i'm still not able to link to > link ( ) or to a button via onclick event) the refresh of my page. > > i've check META tag and also $PHP_SELF variable, but it does not work. What happens when you try? > i have 1 PHP page on which i have 3 flags (3 images) > if user click on 1 of these flags, $_SESSION['Localization'] is set up to > flag language and the page must be refreshed. Something like this should work: English French Then check $_GET['lang'] to use the new language var (then set it in the session etc). -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] refresh PHP page via onclick event
Hi, Sorry to look like stupid for some of you, but i'm still not able to link to link ( ) or to a button via onclick event) the refresh of my page. i've check META tag and also $PHP_SELF variable, but it does not work. here is what i would like to do. i have 1 PHP page on which i have 3 flags (3 images) if user click on 1 of these flags, $_SESSION['Localization'] is set up to flag language and the page must be refreshed. thanks a lot for some help or tutorials. Alain
Re: [PHP] Refresh
Put this between the page's tags: http://somesite_to_refresh_to";> The "1" in the above line controls the time to refresh; the higher the number, the longer to refresh. Matt Darby Miguel Guirao wrote: Hello people, I need to have a web page (PHP) that displays a status about electric facilities, this status is read from a database (MySQL), the thing is that these status may change from time to time in the DB so I need to re read the DB and display the according status on the web page. So, Is there a way to refresh or reload the page every 10 minutes automatically? Regards, --- Miguel Guirao Aguilera Logistica R8 TELCEL Tel. (999) 960.7994 Cel. 9931 600. Este mensaje es exclusivamente para el uso de la persona o entidad a quien esta dirigido; contiene informacion estrictamente confidencial y legalmente protegida, cuya divulgacion es sancionada por la ley. Si el lector de este mensaje no es a quien esta dirigido, ni se trata del empleado o agente responsable de esta informacion, se le notifica por medio del presente, que su reproduccion y distribucion, esta estrictamente prohibida. Si Usted recibio este comunicado por error, favor de notificarlo inmediatamente al remitente y destruir el mensaje. Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Radiomovil Dipsa, S.A. de C.V. o alguna de sus empresas controladas, controladoras, afiliadas y subsidiarias. Este mensaje intencionalmente no contiene acentos. This message is for the sole use of the person or entity to whom it is being sent. Therefore, it contains strictly confidential and legally protected material whose disclosure is subject to penalty by law. If the person reading this message is not the one to whom it is being sent and/or is not an employee or the responsible agent for this information, this person is herein notified that any unauthorized dissemination, distribution or copying of the materials included in this facsimile is strictly prohibited. If you received this document by mistake please notify immediately to the subscriber and destroy the message. Any opinions contained in this e-mail are those of the author of the message and do not necessarily coincide with those of Radiomovil Dipsa, S.A. de C.V. or any of its control, controlled, affiliates and subsidiaries companies. No part of this message or attachments may be used or reproduced in any manner whatsoever. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh
""david forums"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > well I see two way. > > First is to make a php script without end, which will run continuously. I don't recommend this way at all. Why take up all that energy > > second way is to add refresh html tag, in your page, or a js script to > reload automaticaly. Much better and simpler idea, you can use an http header to do this. http://4umi.com/web/html/httpheaders.htm has a list of them Third idea, which may be overkill, depending on how important this information is, how many people will be accessing it, and whether people _need_ to see it real time. set up a cron job/scheduled task to read the db value every 30 seconds, say, and write out a flat html page with the latest data in. This is only of value if your db is getting hammered by requests. I only really mention this as it's the Open Golf Championship this week, and I used to work on their live scoring app, which pretty much worked as above. > > I'm not seeing other solution in php. > > regards > > Le Thu, 14 Jul 2005 02:27:47 +0200, Miguel Guirao > <[EMAIL PROTECTED]> a écrit: > > > > > > > Hello people, > > > > I need to have a web page (PHP) that displays a status about electric > > facilities, this status is read from a database (MySQL), the thing is > > that > > these status may change from time to time in the DB so I need to re read > > the > > DB and display the according status on the web page. > > > > So, Is there a way to refresh or reload the page every 10 minutes > > automatically? > > > > Regards, > > > > --- > > Miguel Guirao Aguilera > > Logistica R8 TELCEL > > Tel. (999) 960.7994 > > Cel. 9931 600. > > > > > > Este mensaje es exclusivamente para el uso de la persona o entidad a > > quien esta dirigido; contiene informacion estrictamente confidencial y > > legalmente protegida, cuya divulgacion es sancionada por la ley. Si el > > lector de este mensaje no es a quien esta dirigido, ni se trata del > > empleado o agente responsable de esta informacion, se le notifica por > > medio del presente, que su reproduccion y distribucion, esta > > estrictamente prohibida. Si Usted recibio este comunicado por error, > > favor de notificarlo inmediatamente al remitente y destruir el mensaje. > > Todas las opiniones contenidas en este mail son propias del autor del > > mensaje y no necesariamente coinciden con las de Radiomovil Dipsa, S.A. > > de C.V. o alguna de sus empresas controladas, controladoras, afiliadas y > > subsidiarias. Este mensaje intencionalmente no contiene acentos. > > > > This message is for the sole use of the person or entity to whom it is > > being sent. Therefore, it contains strictly confidential and legally > > protected material whose disclosure is subject to penalty by law. If > > the person reading this message is not the one to whom it is being sent > > and/or is not an employee or the responsible agent for this information, > > this person is herein notified that any unauthorized dissemination, > > distribution or copying of the materials included in this facsimile is > > strictly prohibited. If you received this document by mistake please > > notify immediately to the subscriber and destroy the message. Any > > opinions contained in this e-mail are those of the author of the message > > and do not necessarily coincide with those of Radiomovil Dipsa, S.A. de > > C.V. or any of its control, controlled, affiliates and subsidiaries > > companies. No part of this message or attachments may be used or > > reproduced in any manner whatsoever. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh
well I see two way. First is to make a php script without end, which will run continuously. second way is to add refresh html tag, in your page, or a js script to reload automaticaly. I'm not seeing other solution in php. regards Le Thu, 14 Jul 2005 02:27:47 +0200, Miguel Guirao <[EMAIL PROTECTED]> a écrit: Hello people, I need to have a web page (PHP) that displays a status about electric facilities, this status is read from a database (MySQL), the thing is that these status may change from time to time in the DB so I need to re read the DB and display the according status on the web page. So, Is there a way to refresh or reload the page every 10 minutes automatically? Regards, --- Miguel Guirao Aguilera Logistica R8 TELCEL Tel. (999) 960.7994 Cel. 9931 600. Este mensaje es exclusivamente para el uso de la persona o entidad a quien esta dirigido; contiene informacion estrictamente confidencial y legalmente protegida, cuya divulgacion es sancionada por la ley. Si el lector de este mensaje no es a quien esta dirigido, ni se trata del empleado o agente responsable de esta informacion, se le notifica por medio del presente, que su reproduccion y distribucion, esta estrictamente prohibida. Si Usted recibio este comunicado por error, favor de notificarlo inmediatamente al remitente y destruir el mensaje. Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Radiomovil Dipsa, S.A. de C.V. o alguna de sus empresas controladas, controladoras, afiliadas y subsidiarias. Este mensaje intencionalmente no contiene acentos. This message is for the sole use of the person or entity to whom it is being sent. Therefore, it contains strictly confidential and legally protected material whose disclosure is subject to penalty by law. If the person reading this message is not the one to whom it is being sent and/or is not an employee or the responsible agent for this information, this person is herein notified that any unauthorized dissemination, distribution or copying of the materials included in this facsimile is strictly prohibited. If you received this document by mistake please notify immediately to the subscriber and destroy the message. Any opinions contained in this e-mail are those of the author of the message and do not necessarily coincide with those of Radiomovil Dipsa, S.A. de C.V. or any of its control, controlled, affiliates and subsidiaries companies. No part of this message or attachments may be used or reproduced in any manner whatsoever. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Refresh
Hello people, I need to have a web page (PHP) that displays a status about electric facilities, this status is read from a database (MySQL), the thing is that these status may change from time to time in the DB so I need to re read the DB and display the according status on the web page. So, Is there a way to refresh or reload the page every 10 minutes automatically? Regards, --- Miguel Guirao Aguilera Logistica R8 TELCEL Tel. (999) 960.7994 Cel. 9931 600. Este mensaje es exclusivamente para el uso de la persona o entidad a quien esta dirigido; contiene informacion estrictamente confidencial y legalmente protegida, cuya divulgacion es sancionada por la ley. Si el lector de este mensaje no es a quien esta dirigido, ni se trata del empleado o agente responsable de esta informacion, se le notifica por medio del presente, que su reproduccion y distribucion, esta estrictamente prohibida. Si Usted recibio este comunicado por error, favor de notificarlo inmediatamente al remitente y destruir el mensaje. Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Radiomovil Dipsa, S.A. de C.V. o alguna de sus empresas controladas, controladoras, afiliadas y subsidiarias. Este mensaje intencionalmente no contiene acentos. This message is for the sole use of the person or entity to whom it is being sent. Therefore, it contains strictly confidential and legally protected material whose disclosure is subject to penalty by law. If the person reading this message is not the one to whom it is being sent and/or is not an employee or the responsible agent for this information, this person is herein notified that any unauthorized dissemination, distribution or copying of the materials included in this facsimile is strictly prohibited. If you received this document by mistake please notify immediately to the subscriber and destroy the message. Any opinions contained in this e-mail are those of the author of the message and do not necessarily coincide with those of Radiomovil Dipsa, S.A. de C.V. or any of its control, controlled, affiliates and subsidiaries companies. No part of this message or attachments may be used or reproduced in any manner whatsoever. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh (F5) adds another SQL record.
I did something pretty similar to this but not with an MD5 hash. I used a table which had just two fields, one autoincrement and another one a boolean. When doing a form, I added one record to this table and the ID I got from it is the one I sent in the form, the other field served to indicate that the ID had been used, as you mention. Later on I read about redirecting out of the update page, as Marek Kilimajer replied above and never bothered to do it again. Satyam "Richard Lynch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tue, May 17, 2005 2:24 pm, Robert Meyer said: >> Hello, >> >> Scenario: >> 1) User is presented a blank form. > > with an MD5 hash which is stored in the database as "fresh" > >> 2) User fills in form. >> 3) User submits form. >> 4) Record is added to database. > > That particular MD5 has is marked as "used" > >> 5) Back to 1). >> All is fine to here. >> 6) User clicks refresh. >> 7) Another record is added, same data except auto-increment field. >> How do I prevent these last two steps, or at least prevent a record >> from being added when refresh is clicked? > > The used MD5 hash tells you they are re-submitting the exact same form. > > Now, if the real problem is that the user has a fresh new form, and fills > in the same data again by hand, then there are only two possibilities: > > 1. In the real world, they actually NEED two of the "same" thing in the > database, and your application should allow it. > > 2. In the real world, users are likely to lose track of where they are in > their data entry, and you need to provide them the context to help avoid > that. When you go back to 1) present a message like "added blah blah blah" > at the top of the screen. Now they *KNOW* they just did blah blah blah, > and can move on to blah blah bleh. Data entry is a sucky job. Make it > nicer for them, eh? You STILL need to code for the dual entry, and do > something intelligent when they mess up, but you can improve efficiency > and decrease errors (where 2 not-quite-the-same-but-really-are-the-same > entries pass your tests) if you make your application nicer to the user. > > -- > Like Music? > http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh (F5) adds another SQL record.
Aren't we oversimplifying the issue assuming that the records inserted cannot have everything duplicated but the autoincrement field? If you are taking an order and the customer says 'hey, add another of this', with the code below the system will reject it because it assumes that it is a refresh and not a new addition to the order. You are in the supermarket line and the teller is scaning your purchase for the barcodes. You wouldn't be able to buy more than one of each! (I know that you wouldn't use a browser in that environment, but for the purpose of the database analysis, it just shows the point) NO, some tables do have records which are basically duplicate of one another except for the autoincrement field, and those cannot be checked this way. And, besides, as mentioned elsewhere in this thread (myself included) there are easier ways which do not even involve database access. Satyam "Marcus Joyce" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Why dont you check that data isnt being duplicated? > > $query = "SELECT auto_col FROM table where col1 = $var1 & col2 = $var > 3."; > $call_query = mysql_query($query,... > $query_data = mysql_assoc($call_query); > > if(!$query_data) { do form } > > else echo "information already exists in database"; > > > Pierce > > Robert Meyer wrote: > >>Hello, >> >>Scenario: >>1) User is presented a blank form. >>2) User fills in form. >>3) User submits form. >>4) Record is added to database. >>5) Back to 1). >>All is fine to here. >>6) User clicks refresh. >>7) Another record is added, same data except auto-increment field. >>How do I prevent these last two steps, or at least prevent a record >>from being added when refresh is clicked? >> >>Regards, >> >>Robert >> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh (F5) adds another SQL record.
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Robert Meyer wrote: >> Hello, >> >> Scenario: >> 1) User is presented a blank form. >> 2) User fills in form. >> 3) User submits form. >> 4) Record is added to database. >> 5) Back to 1). > > Go really back to 1) - use redirect. After the record is added to the > database, use something like: > header('Location: http://yourserver.com/form.php'); > exit; > Or, in general, redirect to any page as soon as you made the insert. It can be back to the begining or to a confirmation page, so the user gets a feedback of what has just been done. The point is, don't show the confirmation or the new input form right in the same page as you did the insert, redirect to it in some way. I use to process my data in a single form per operation. I make each page like this: if ($_REQUEST['confirm'] == 'true') { // show the confirmation of the last operation } if ($_REQUEST['submit'] == 'Save') { // do the insert here header('Location: http://yourserver.com/form.php?confirm=true'); } // here, show the input form which will show either for the first time or after the confirmation // which ends with: You might add to the redirect header some more arguments to be more explicit about what is it that you are confirming. Anyway, the point is that the browser will store the redirected-to address with all its arguments, not the one with the form data, so, a refresh will give you the confirmation page, not the insert one. Satyam >> All is fine to here. >> 6) User clicks refresh. >> 7) Another record is added, same data except auto-increment field. >> How do I prevent these last two steps, or at least prevent a record >> from being added when refresh is clicked? > > You should see a message from your browser that data is being reposted. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh (F5) adds another SQL record.
Sorry for that., i miss read that.. sorry, thought he wanted a php function to refresh the browser. Assey. On Wed, 18 May 2005, M. Sokolewicz wrote: Next time, Mukasa, try reading... Robert clearly states that he'd like a PHP function which TELLS him if the page has been refreshed or not (thus, "resent"). There are headers sent out that indicate this, and thus a function like refreshed() would be a shortcut to getting to know if it has. He doesn't ask to FORCE a refresh, or to even execute PHP in a browser (what? how did you get to this...??) Mukasa Assey Alfred wrote: On Tue, 17 May 2005, Robert Meyer wrote: As a last resort, I may have to do that, but that is by no means the preferred method. I want to keep database access to a minimum. I thought by this time this problem would have had a standard solution. It would be nice if PHP had a function like refreshed() so one could do ... if (!refreshed()) { ... } ..., but I guess not. PHP is a server-side programming language, the problem you are facing is a client-side problem. PHP thus would not be able to do browser refreshes! sorry! Unless of course you have a PHP enabled browser :-) Your browser caches the information sent from the form and so long as the page is not reloaded..., the variables are still set and submition of data may continue indefinately. Two options, You may use the php header() funtion for redirection, or Resort to a client-side reload using a scripting language like javascript..., "document.location.href=''; Assey. Thanks for your input. Regards, Robert "Marcus Joyce" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Why dont you check that data isnt being duplicated? $query = "SELECT auto_col FROM table where col1 = $var1 & col2 = $var 3."; $call_query = mysql_query($query,... $query_data = mysql_assoc($call_query); if(!$query_data) { do form } else echo "information already exists in database"; Pierce Robert Meyer wrote: Hello, Scenario: 1) User is presented a blank form. 2) User fills in form. 3) User submits form. 4) Record is added to database. 5) Back to 1). All is fine to here. 6) User clicks refresh. 7) Another record is added, same data except auto-increment field. How do I prevent these last two steps, or at least prevent a record from being added when refresh is clicked? Regards, Robert -- 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] Refresh (F5) adds another SQL record.
Robert Meyer wrote: "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Robert Meyer wrote: Hello, Scenario: 1) User is presented a blank form. 2) User fills in form. 3) User submits form. 4) Record is added to database. 5) Back to 1). Go really back to 1) - use redirect. After the record is added to the database, use something like: header('Location: http://yourserver.com/form.php'); exit; Does this work for all browsers? yes. All is fine to here. 6) User clicks refresh. 7) Another record is added, same data except auto-increment field. How do I prevent these last two steps, or at least prevent a record from being added when refresh is clicked? You should see a message from your browser that data is being reposted. I looked for such a message and the only thing I can find is as follows: 1) _SERVER['HTTP_ACCEPT'] and _ENV['HTTP_ACCEPT'] and change to "*/*", but I don't know if that is the case for all browsers, do you know? 2) _SERVER['REDIRECT_UNIQUE_ID'] and _ENV['REDIRECT_UNIQUE_ID'], _SERVER['REMOTE_PORT'] and _ENV['REMOTE_PORT'], _SERVER['UNIQUE_ID'] and _ENV['UNIQUE_ID'] change, but I don't think the values are predictable, especially between browsers. Do you know of a specific message to look for and is that message the same for all browsers? that's a message the user (using the browser) gets from the browser. Unless you use GET method, but you should really use POST method for forms that change state on the server. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh (F5) adds another SQL record.
Next time, Mukasa, try reading... Robert clearly states that he'd like a PHP function which TELLS him if the page has been refreshed or not (thus, "resent"). There are headers sent out that indicate this, and thus a function like refreshed() would be a shortcut to getting to know if it has. He doesn't ask to FORCE a refresh, or to even execute PHP in a browser (what? how did you get to this...??) Mukasa Assey Alfred wrote: On Tue, 17 May 2005, Robert Meyer wrote: As a last resort, I may have to do that, but that is by no means the preferred method. I want to keep database access to a minimum. I thought by this time this problem would have had a standard solution. It would be nice if PHP had a function like refreshed() so one could do ... if (!refreshed()) { ... } ..., but I guess not. PHP is a server-side programming language, the problem you are facing is a client-side problem. PHP thus would not be able to do browser refreshes! sorry! Unless of course you have a PHP enabled browser :-) Your browser caches the information sent from the form and so long as the page is not reloaded..., the variables are still set and submition of data may continue indefinately. Two options, You may use the php header() funtion for redirection, or Resort to a client-side reload using a scripting language like javascript..., "document.location.href=''; Assey. Thanks for your input. Regards, Robert "Marcus Joyce" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Why dont you check that data isnt being duplicated? $query = "SELECT auto_col FROM table where col1 = $var1 & col2 = $var 3."; $call_query = mysql_query($query,... $query_data = mysql_assoc($call_query); if(!$query_data) { do form } else echo "information already exists in database"; Pierce Robert Meyer wrote: Hello, Scenario: 1) User is presented a blank form. 2) User fills in form. 3) User submits form. 4) Record is added to database. 5) Back to 1). All is fine to here. 6) User clicks refresh. 7) Another record is added, same data except auto-increment field. How do I prevent these last two steps, or at least prevent a record from being added when refresh is clicked? Regards, Robert -- 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] Refresh (F5) adds another SQL record.
On Tue, 17 May 2005, Robert Meyer wrote: As a last resort, I may have to do that, but that is by no means the preferred method. I want to keep database access to a minimum. I thought by this time this problem would have had a standard solution. It would be nice if PHP had a function like refreshed() so one could do ... if (!refreshed()) { ... } ..., but I guess not. PHP is a server-side programming language, the problem you are facing is a client-side problem. PHP thus would not be able to do browser refreshes! sorry! Unless of course you have a PHP enabled browser :-) Your browser caches the information sent from the form and so long as the page is not reloaded..., the variables are still set and submition of data may continue indefinately. Two options, You may use the php header() funtion for redirection, or Resort to a client-side reload using a scripting language like javascript..., "document.location.href=''; Assey. Thanks for your input. Regards, Robert "Marcus Joyce" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Why dont you check that data isnt being duplicated? $query = "SELECT auto_col FROM table where col1 = $var1 & col2 = $var 3."; $call_query = mysql_query($query,... $query_data = mysql_assoc($call_query); if(!$query_data) { do form } else echo "information already exists in database"; Pierce Robert Meyer wrote: Hello, Scenario: 1) User is presented a blank form. 2) User fills in form. 3) User submits form. 4) Record is added to database. 5) Back to 1). All is fine to here. 6) User clicks refresh. 7) Another record is added, same data except auto-increment field. How do I prevent these last two steps, or at least prevent a record from being added when refresh is clicked? Regards, Robert -- 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] Refresh (F5) adds another SQL record.
Force a reload of the document after step (4), you may use javascript to reload this document, ie... After step (4) add this line... print "document.location.href='';"; Assey. On Tue, 17 May 2005, Robert Meyer wrote: Hello, Scenario: 1) User is presented a blank form. 2) User fills in form. 3) User submits form. 4) Record is added to database. 5) Back to 1). All is fine to here. 6) User clicks refresh. 7) Another record is added, same data except auto-increment field. How do I prevent these last two steps, or at least prevent a record from being added when refresh is clicked? Regards, Robert -- 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] Refresh (F5) adds another SQL record.
On Tue, May 17, 2005 2:24 pm, Robert Meyer said: > Hello, > > Scenario: > 1) User is presented a blank form. with an MD5 hash which is stored in the database as "fresh" > 2) User fills in form. > 3) User submits form. > 4) Record is added to database. That particular MD5 has is marked as "used" > 5) Back to 1). > All is fine to here. > 6) User clicks refresh. > 7) Another record is added, same data except auto-increment field. > How do I prevent these last two steps, or at least prevent a record > from being added when refresh is clicked? The used MD5 hash tells you they are re-submitting the exact same form. Now, if the real problem is that the user has a fresh new form, and fills in the same data again by hand, then there are only two possibilities: 1. In the real world, they actually NEED two of the "same" thing in the database, and your application should allow it. 2. In the real world, users are likely to lose track of where they are in their data entry, and you need to provide them the context to help avoid that. When you go back to 1) present a message like "added blah blah blah" at the top of the screen. Now they *KNOW* they just did blah blah blah, and can move on to blah blah bleh. Data entry is a sucky job. Make it nicer for them, eh? You STILL need to code for the dual entry, and do something intelligent when they mess up, but you can improve efficiency and decrease errors (where 2 not-quite-the-same-but-really-are-the-same entries pass your tests) if you make your application nicer to the user. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh (F5) adds another SQL record.
As a last resort, I may have to do that, but that is by no means the preferred method. I want to keep database access to a minimum. I thought by this time this problem would have had a standard solution. It would be nice if PHP had a function like refreshed() so one could do ... if (!refreshed()) { ... } ..., but I guess not. Thanks for your input. Regards, Robert "Marcus Joyce" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Why dont you check that data isnt being duplicated? > > $query = "SELECT auto_col FROM table where col1 = $var1 & col2 = $var > 3."; > $call_query = mysql_query($query,... > $query_data = mysql_assoc($call_query); > > if(!$query_data) { do form } > > else echo "information already exists in database"; > > > Pierce > > Robert Meyer wrote: > >>Hello, >> >>Scenario: >>1) User is presented a blank form. >>2) User fills in form. >>3) User submits form. >>4) Record is added to database. >>5) Back to 1). >>All is fine to here. >>6) User clicks refresh. >>7) Another record is added, same data except auto-increment field. >>How do I prevent these last two steps, or at least prevent a record >>from being added when refresh is clicked? >> >>Regards, >> >>Robert >> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh (F5) adds another SQL record.
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Robert Meyer wrote: >> Hello, >> >> Scenario: >> 1) User is presented a blank form. >> 2) User fills in form. >> 3) User submits form. >> 4) Record is added to database. >> 5) Back to 1). > > Go really back to 1) - use redirect. After the record is added to the > database, use something like: > header('Location: http://yourserver.com/form.php'); > exit; Does this work for all browsers? >> All is fine to here. >> 6) User clicks refresh. >> 7) Another record is added, same data except auto-increment field. >> How do I prevent these last two steps, or at least prevent a record >> from being added when refresh is clicked? > > You should see a message from your browser that data is being reposted. I looked for such a message and the only thing I can find is as follows: 1) _SERVER['HTTP_ACCEPT'] and _ENV['HTTP_ACCEPT'] and change to "*/*", but I don't know if that is the case for all browsers, do you know? 2) _SERVER['REDIRECT_UNIQUE_ID'] and _ENV['REDIRECT_UNIQUE_ID'], _SERVER['REMOTE_PORT'] and _ENV['REMOTE_PORT'], _SERVER['UNIQUE_ID'] and _ENV['UNIQUE_ID'] change, but I don't think the values are predictable, especially between browsers. Do you know of a specific message to look for and is that message the same for all browsers? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh (F5) adds another SQL record.
Why dont you check that data isnt being duplicated? $query = "SELECT auto_col FROM table where col1 = $var1 & col2 = $var 3."; $call_query = mysql_query($query,... $query_data = mysql_assoc($call_query); if(!$query_data) { do form } else echo "information already exists in database"; Pierce Robert Meyer wrote: Hello, Scenario: 1) User is presented a blank form. 2) User fills in form. 3) User submits form. 4) Record is added to database. 5) Back to 1). All is fine to here. 6) User clicks refresh. 7) Another record is added, same data except auto-increment field. How do I prevent these last two steps, or at least prevent a record from being added when refresh is clicked? Regards, Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh (F5) adds another SQL record.
Robert Meyer wrote: Hello, Scenario: 1) User is presented a blank form. 2) User fills in form. 3) User submits form. 4) Record is added to database. 5) Back to 1). Go really back to 1) - use redirect. After the record is added to the database, use something like: header('Location: http://yourserver.com/form.php'); exit; All is fine to here. 6) User clicks refresh. 7) Another record is added, same data except auto-increment field. How do I prevent these last two steps, or at least prevent a record from being added when refresh is clicked? You should see a message from your browser that data is being reposted. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Refresh (F5) adds another SQL record.
[snip] 6) User clicks refresh. 7) Another record is added, same data except auto-increment field. How do I prevent these last two steps, or at least prevent a record from being added when refresh is clicked? [/snip] Test for the existence (SELECT statement with the variables therein) of the record even on the first try, if it exists, do not add (ever again), if it does not exist do the insert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Refresh (F5) adds another SQL record.
Hello, Scenario: 1) User is presented a blank form. 2) User fills in form. 3) User submits form. 4) Record is added to database. 5) Back to 1). All is fine to here. 6) User clicks refresh. 7) Another record is added, same data except auto-increment field. How do I prevent these last two steps, or at least prevent a record from being added when refresh is clicked? Regards, Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
AW: [PHP] Refresh Problem
After first authentification of the user i prefere session. I can be sure that this is the user who autht himself to me, caus the session is unique. -Ursprüngliche Nachricht- Von: Jose Angel Sanchez (Jone) [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 9. Februar 2005 14:49 An: php-general@lists.php.net Betreff: [PHP] Refresh Problem Hi First of all: I'm sorry for writing errors - I don't speak English too much (spanish) I'm building an application which works that way: I use url parameters to set zone (document location), actions and params. I've badly make security part so only registered people ($_session['USER'] <- which is set after check Login/pass form) can access different zones but my problem is on refreshing page that contains action i.e. http://www.mypage.com?index.php&zone=contact&action=newcontact&name=geor ge only registered/valid users can make this zone code runs my pseudocode basicly works this way: function contactzone (no params) get URL parameters (like $action=$_get['action'] switch ($action) case 'new' $html.= show form (on submit set action to 'newcontact' break; case 'newcontact' Insert on database On success -> $html Default Show simple $html } return $html My problem is on refresh or back events on navigator; the action will execute again. How do I prevent that? Session variables? Check a single table storing used hashes sent by form (generated with md5 or any) on all forms containing actions event for all tables? What do you think? Sorry again and thx for reading and helping :D j0n3 -- 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] Refresh Problem
Hi First of all: I'm sorry for writing errors - I don't speak English too much (spanish) I'm building an application which works that way: I use url parameters to set zone (document location), actions and params. I've badly make security part so only registered people ($_session['USER'] <- which is set after check Login/pass form) can access different zones but my problem is on refreshing page that contains action i.e. http://www.mypage.com?index.php&zone=contact&action=newcontact&name=geor ge only registered/valid users can make this zone code runs my pseudocode basicly works this way: function contactzone (no params) get URL parameters (like $action=$_get['action'] switch ($action) case 'new' $html.= show form (on submit set action to 'newcontact' break; case 'newcontact' Insert on database On success -> $html Default Show simple $html } return $html My problem is on refresh or back events on navigator; the action will execute again. How do I prevent that? Session variables? Check a single table storing used hashes sent by form (generated with md5 or any) on all forms containing actions event for all tables? What do you think? Sorry again and thx for reading and helping :D j0n3 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh page automaticly on PHP
or u can use this method from JS You could refresh the page in various ways 1- make a rerequest to the server to give u the same page again: using the PHP Header function. 2-using the html Header refresh tag 3-Java Script to reload the document Since the 1st and 2nd methods are discussed in the earlier posts I'll show another way of doing it by Javascript. This is useful if you're using a templated based markup rendering to replace ur Head JS tags or Body JS tags. Javascript redirection and reloading is done as the following: -if u want to reload the page after showing the page write this in body tag echo " location.reload();"; -if u want to reload the page the moment the page is requested then do this in the head tag echo " window.onload = location.reload(); "; Hope this is usefull. On Thu, 30 Sep 2004 09:32:50 -0700 (PDT), Chris Shiflett <[EMAIL PROTECTED]> wrote: > --- welly limston <[EMAIL PROTECTED]> wrote: > > how to make my page refresh automaticly? > > You can use a Refresh header: > > Refresh: 3; url=http://example.org/ > > > Can i use PHP function? > > http://www.php.net/header > > Hope that helps. > > Chris > > = > Chris Shiflett - http://shiflett.org/ > > PHP Security - O'Reilly HTTP Developer's Handbook - Sams > Coming December 2004http://httphandbook.org/ > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- M.Saleh.E.G Web Developer www.buzinessware.com 97150-4779817 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh page automaticly on PHP
--- welly limston <[EMAIL PROTECTED]> wrote: > how to make my page refresh automaticly? You can use a Refresh header: Refresh: 3; url=http://example.org/ > Can i use PHP function? http://www.php.net/header Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly HTTP Developer's Handbook - Sams Coming December 2004http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh page automaticly on PHP
As the others said, this isn't a function of php, php is a server-side script and a refresh is on the client side. A meta-refresh tag is fine depending on how reliable you want your refresh to be as it'll stop working after a day or so. If you need it to refresh forever you'll need to use javascript. On Thu, 30 Sep 2004 05:09:09 -0700 (PDT), welly limston <[EMAIL PROTECTED]> wrote: > how to make my page refresh automaticly? > Can i use PHP function? > what is it? > > > - > Do you Yahoo!? > vote.yahoo.com - Register online to vote today! > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh page automaticly on PHP
Try header(); On 30 Sep 2004, at 14:09, welly limston wrote: how to make my page refresh automaticly? Can i use PHP function? what is it? - Do you Yahoo!? vote.yahoo.com - Register online to vote today! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh page automaticly on PHP
Jay Blanchard wrote: [snip] how to make my page refresh automaticly? Can i use PHP function? what is it? [/snip] You cannot do it with PHP, you use a meta refresh tag (http://www.w3.org) Or header refresh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] refresh page automaticly on PHP
[snip] how to make my page refresh automaticly? Can i use PHP function? what is it? [/snip] You cannot do it with PHP, you use a meta refresh tag (http://www.w3.org) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] refresh page automaticly on PHP
how to make my page refresh automaticly? Can i use PHP function? what is it? - Do you Yahoo!? vote.yahoo.com - Register online to vote today!
Re: [PHP] Refresh page with frames...
so change parent to the name of the frame -- -->> Jasper Howard :: Database Administration ApexEleven Web Design 1.530.559.0107 http://www.ApexEleven.com/ <<-- "Andre" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I need to refresh the top frame and I am on the content frame (for example) and this code doesn't work for this <!-- location.refresh(true); //OR parent.document.location='LOCATION HERE'; //--> And I try whit this; -Original Message- From: Jasper Howard [mailto:[EMAIL PROTECTED] Sent: quarta-feira, 15 de Setembro de 2004 18:27 To: [EMAIL PROTECTED] Subject: Re: [PHP] Refresh page with frames... <!-- location.refresh(true); //OR parent.document.location='LOCATION HERE'; //--> -- -->> Jasper Howard :: Database Administration ApexEleven Web Design 1.530.559.0107 http://www.ApexEleven.com/ <<-- "John Nichel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Andre wrote: > > Hello > > How can I refresh a page with frames, I use the code below but don't it > > doesn't work > > You can't with PHP. But I'm betting that if you Google, you'll find > some info on JavaScript. > > -- > John C. Nichel > ÜberGeek > KegWorks.com > 716.856.9675 > [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: FW: [PHP] Refresh page with frames...
Andre wrote: This list is for PHP, not a JavaScript. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
FW: [PHP] Refresh page with frames...
I need to refresh the top frame and I am on the content frame (for example) and this code doesnt work for this <!-- location.refresh(true); //OR parent.document.location='LOCATION HERE'; //--> And I try whit this; -Original Message- From: Jasper Howard [mailto:[EMAIL PROTECTED] Sent: quarta-feira, 15 de Setembro de 2004 18:27 To: [EMAIL PROTECTED] Subject: Re: [PHP] Refresh page with frames... <!-- location.refresh(true); //OR parent.document.location='LOCATION HERE'; //--> -- -->> Jasper Howard :: Database Administration ApexEleven Web Design 1.530.559.0107 http://www.ApexEleven.com/ <<-- "John Nichel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Andre wrote: > > Hello > > How can I refresh a page with frames, I use the code below but don't it > > doesn't work > > You can't with PHP. But I'm betting that if you Google, you'll find > some info on JavaScript. > > -- > John C. Nichel > ÜberGeek > KegWorks.com > 716.856.9675 > [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh page with frames...
-- -->> Jasper Howard :: Database Administration ApexEleven Web Design 1.530.559.0107 http://www.ApexEleven.com/ <<-- "John Nichel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Andre wrote: > > Hello > > How can I refresh a page with frames, I use the code below but don't it > > doesn't work > > You can't with PHP. But I'm betting that if you Google, you'll find > some info on JavaScript. > > -- > John C. Nichel > ÜberGeek > KegWorks.com > 716.856.9675 > [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh page with frames...
Andre wrote: Hello How can I refresh a page with frames, I use the code below but don't it doesn't work You can't with PHP. But I'm betting that if you Google, you'll find some info on JavaScript. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh page with frames...
From: "Andre " <[EMAIL PROTECTED]> How can I refresh a page with frames, I use the code below but don't it doesn't work Right click -> Refresh Frame ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Refresh page with frames...
Hello How can I refresh a page with frames, I use the code below but don't it doesn't work Can I refresh a page with frames with this code? echo""; Thank's
[PHP] refresh withou erasing
Hi want to put information on a page without erasing the previous on(like for every 5 minutes), and I think I must do an arrays and a foreach loop...how can I do that? thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Refresh a frame?
I am in need of a way to reload a page within a frame as the other frames are used to modify the information. I have a 3-frame site now that I am using 1 frame as a list, another frame to add the information, and the 3rd frame to show the results of the 2nd frame. I know how to do the location: URL for the full page, but how do I do it for JUST a single page? Thanks, Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh Page
--- Mike Mapsnac <[EMAIL PROTECTED]> wrote: > I want to refresh page every 10 seconds, without clicking on > "Refresh" button. Use the Refresh header: header('Refresh: 10; url=http://example.org/foo.php'); Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming Fall 2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh Page
On Sat, 2004-06-05 at 10:20, Mike Mapsnac wrote: > I want to refresh page every 10 seconds, without clicking on "Refresh" > button. > Any ideas how this can be done? > > Thanks I think you want to include something like this in your pages header section: -- Scot L. Harris [EMAIL PROTECTED] It is so soon that I am done for, I wonder what I was begun for. -- Epitaph, Cheltenham Churchyard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh Page
Put inside the tags, this refreshed the page every 10 seconds. >>I want to refresh page every 10 seconds, without clicking on "Refresh" >>button. >>Any ideas how this can be done? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Refresh Page
I want to refresh page every 10 seconds, without clicking on "Refresh" button. Any ideas how this can be done? Thanks _ MSN 9 Dial-up Internet Access fights spam and pop-ups now 3 months FREE! http://join.msn.click-url.com/go/onm00200361ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh and retry when using back button on IE
Pieter from SA wrote: > I need to know if there is any code that can be used to get rid of the > refresh and retry when using the back button in internet explorer. > > Every time i get info from the database and display the result, and i use > the back button it says > > Warning: Page has Expired The page you requested was created using > information you submitted in a form. This page is no longer available. As a > security precaution, Internet Explorer does not automatically resubmit your > information for you. > > To resubmit your information and view this Web page, click the Refresh > button. > > and the when you refresh it says: > > The page cannot be refreshed without resending the information. Click retry > to send the information again, or click cancel to return to the page that > you were trying to view. > > This is very irritating. > > Can someone tell me how to resend the info automatically, please You can't resend it automatically otherwise you could post any arbitrary data for the users. The common solution for this is a "middle-man" technique. The middle-man is a PHP page that hanldes the form submission, sends the email, submits in the database, etc, and then forwards to another page using header(). Now, when Back is used, they're taken back to the form they filled out and not the page that processes the form; so there is no "re-post" request. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh and retry when using back button on IE
Pieter from SA wrote: Hi I need to know if there is any code that can be used to get rid of the refresh and retry when using the back button in internet explorer. Every time i get info from the database and display the result, and i use the back button it says Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you. To resubmit your information and view this Web page, click the Refresh button. and the when you refresh it says: The page cannot be refreshed without resending the information. Click retry to send the information again, or click cancel to return to the page that you were trying to view. This is very irritating. Can someone tell me how to resend the info automatically, please Use GET method instead of POST, but only in forms that don't change state on the server (i.e. search). Use POST method only for forms that for example insert new entry in the db. And you should redirect right after making the action, so the posted page does not stay in the browser's history. HTH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Refresh and retry when using back button on IE
Hi I need to know if there is any code that can be used to get rid of the refresh and retry when using the back button in internet explorer. Every time i get info from the database and display the result, and i use the back button it says Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you. To resubmit your information and view this Web page, click the Refresh button. and the when you refresh it says: The page cannot be refreshed without resending the information. Click retry to send the information again, or click cancel to return to the page that you were trying to view. This is very irritating. Can someone tell me how to resend the info automatically, please Thanks Pieter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh page
using meta instead php rgds amdm http://amadarum.e-tics.net/blogger - Original Message - From: "Mike Mapsnac" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 17, 2004 8:55 AM Subject: [PHP] refresh page > Hello > > I need to refresh page every 2 minutes. How that's can be done in PHP? > > THanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh page
On 16 Mar 2004 Jeff Oien wrote: > You have to basically go back and forth between two pages. The site you mentioned does, but it is easy to refresh to the same page -- just use your own URL. An empty URL also works -- I tried it in IE 6 and Mozilla 1.5; don't know if it works with other browsers. -- Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh page
--- Mike Mapsnac <[EMAIL PROTECTED]> wrote: > I need to refresh page every 2 minutes. How that's can be done in PHP? You can do this with a Refresh header: header('Refresh: 120; url=http://www.example.org/'); Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh page
Can you show the code? Thanks From: Jeff Oien <[EMAIL PROTECTED]> To: Mike Mapsnac <[EMAIL PROTECTED]> CC: [EMAIL PROTECTED] Subject: Re: [PHP] refresh page Date: Tue, 16 Mar 2004 20:11:49 -0600 Mike Mapsnac wrote: I need to refresh page every 2 minutes. How that's can be done in PHP? This would just be an HTML thing but if you want a user to specify a page I've done it here: http://www.ttrader.com/stockchat/refresh.html You have to basically go back and forth between two pages. Let me know if you want the code. Jeff Oien -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ FREE pop-up blocking with the new MSN Toolbar get it now! http://clk.atdmt.com/AVE/go/onm00200415ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh page
On 17 Mar 2004 Mike Mapsnac wrote: > I need to refresh page every 2 minutes. How that's can be done in > PHP? You can do it with a header. I think something this simple will work: header("Refresh: 120"); or in the area: print "\n"; If you want to refresh to an explicit URL: header("Refresh: 120; URL=http://...";); print "http://...\";>\n"; -- Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh page
Mike Mapsnac wrote: I need to refresh page every 2 minutes. How that's can be done in PHP? This would just be an HTML thing but if you want a user to specify a page I've done it here: http://www.ttrader.com/stockchat/refresh.html You have to basically go back and forth between two pages. Let me know if you want the code. Jeff Oien -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh page
Hello Hay una lista en español para php? THanks -Original Message- From: Richard Davey <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Date: Wed, 17 Mar 2004 01:59:52 + Subject: Re: [PHP] refresh page > Hello Mike, > > Wednesday, March 17, 2004, 1:55:51 AM, you wrote: > > MM> I need to refresh page every 2 minutes. How that's can be done in > PHP? > > PHP itself cannot do this. You can use PHP to output a meta refresh > tag however which could be set to refresh every 2 minutes, understand > it is the HTML that is refreshing the page though - not PHP. > > -- > Best regards, > Richard Davey > http://www.phpcommunity.org/wiki/296.html > > -- > 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] refresh page
Hello Mike, Wednesday, March 17, 2004, 1:55:51 AM, you wrote: MM> I need to refresh page every 2 minutes. How that's can be done in PHP? PHP itself cannot do this. You can use PHP to output a meta refresh tag however which could be set to refresh every 2 minutes, understand it is the HTML that is refreshing the page though - not PHP. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] refresh page
Hello I need to refresh page every 2 minutes. How that's can be done in PHP? THanks _ FREE pop-up blocking with the new MSN Toolbar get it now! http://clk.atdmt.com/AVE/go/onm00200415ave/direct/01/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] refresh parent window after submit of child
Hi, I have an "expiry_date" field on a webpage, if the client wants to edit it he clicks on the "Edit" link and a small window pops up with the current expiry date, after he changes it and hits submit its changing it properly in the DB...but the parent window still shows the old expiry date... I have seen many pages on the net where after the child window gets submitted the parent refreshes...any idea how this is done? is it with PHP headers or just javascript? or a combination? (Please note: I have found a pure javascript solution via google but want to know if this can be done in any other way) I would prefer a pure php solution as I dont know if JS will be on on the clients machine. Thanks, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh page (might be 0t)
On Sat, 2004-02-07 at 23:03, Ryan A wrote: > Heres what I am doing: > I give the client a control panel where he can add,edit and delete accounts, > after each of the actions I have a link back to > the index page of the contol panel...problem is, unless he presses the > refresh button it shows him the same cached content. > How do i force the browser to display the new updated accounts after and > edit or the new list of accounts after a delete? It sounds like you may want to set the page to not be cached. Here's what I use to prevent pages from being cached: function noCacheHeaders() { header('Expires: Tue, 1 Jan 1980 12:00:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0, no-transform'); header('Pragma: no-cache'); } This should prevent proxies, browsers, etc from caching your pages. -- Adam Bregenzer [EMAIL PROTECTED] http://adam.bregenzer.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] refresh page (might be 0t)
Hey, Have run into a little problem...any help appreciated. Heres what I am doing: I give the client a control panel where he can add,edit and delete accounts, after each of the actions I have a link back to the index page of the contol panel...problem is, unless he presses the refresh button it shows him the same cached content. How do i force the browser to display the new updated accounts after and edit or the new list of accounts after a delete? I KNOW php is server side and this is a browser issue...but maybe this can be done with headers or something? Thanks, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] refresh data
Hello BigMark, Wednesday, December 3, 2003, 6:04:03 AM, you wrote: B> At the moment this code accepts changes and deletes from the Db but when the B> submit button is pressed it echos- 'Record updated/edited' and i B> have to go back and refresh to view the updated list, how can i just have it B> refresh. When you open the file it shows the list but when editing it B> disappears. The problem is that you're only printing the list if there has been no editing of the database, when in actual fact you want to print the list regardless. Why not just remove this part? // this part happens if we don't press submit if (!$id) { -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] refresh data
At the moment this code accepts changes and deletes from the Db but when the submit button is pressed it echos- 'Record updated/edited' and i have to go back and refresh to view the updated list, how can i just have it refresh. When you open the file it shows the list but when editing it disappears. "; } elseif ($delete) { // delete a record $sql = "DELETE FROM employees WHERE id=$id"; $result = mysql_query($sql); echo "$sql Record deleted!"; } else { // this part happens if we don't press submit if (!$id) { // print the list if there is not editing $result = mysql_query("SELECT * FROM employees",$db); while ($myrow = mysql_fetch_array($result)) { printf("%s- V - %s..\n", $PHP_SELF, $myrow["id"], $myrow["first"],$myrow["last"]); printf("(DELETE)", $PHP_SELF, $myrow["id"]); } } ?> Team A: Team B: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Refresh php section
Consider 4 IFRAMEs on one page, with meta refreshes in each header which point to your php script with a get parameter of whichever 'section' you're dealing with. Regards Chris -Original Message- From: ascll [mailto:[EMAIL PROTECTED] Sent: 25 September 2003 08:48 To: [EMAIL PROTECTED] Subject: [PHP] Refresh php section = start Test.php = // Section-A // Section-B // Section-C // Section-D = end Test.php = Greetings, It that a way for me to reload Section-A's php codes every 1-second and Section-D's php codes every 5-second, that belongs to the SAME php file, say "test.php"? Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php If you are not the intended recipient of this e-mail, please preserve the confidentiality of it and advise the sender immediately of any error in transmission. Any disclosure, copying, distribution or action taken, or omitted to be taken, by an unauthorised recipient in reliance upon the contents of this e-mail is prohibited. Somerfield cannot accept liability for any damage which you may sustain as a result of software viruses so please carry out your own virus checks before opening an attachment. In replying to this e-mail you are granting the right for that reply to be forwarded to any other individual within the business and also to be read by others. Any views expressed by an individual within this message do not necessarily reflect the views of Somerfield. Somerfield reserves the right to intercept, monitor and record communications for lawful business purposes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Refresh php section
= start Test.php = // Section-A // Section-B // Section-C // Section-D = end Test.php = Greetings, It that a way for me to reload Section-A's php codes every 1-second and Section-D's php codes every 5-second, that belongs to the SAME php file, say "test.php"? Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh Error
Does your explorer ask you if you want to resend the information? It does. You post your form once again. If you don't want this to happen, use header("Location: http://yourserver/your_form_page.php";); redirect. Rex Brooks wrote: Okay, I'm displaying an entire table of numbers from my database. Using a form on the same page, you can enter an amount to add to the table and then click submit. I pass all of the information in $_POST back to the same page. Here is my code: if ($_POST["number"] != NULL) { if (is_numeric($_POST["number"]) || $_POST["number"] <= 0.0){ ... display stuff telling them they need to try again ... } else { ... do stuff that adds the number to the table ... $_POST["number"] = NULL; } } ...body of HTML document... Add Amount Everything seems to work fine, up until you click the refresh button, then it will add whatever you just added to the table again, even if you have nothing typed into the form and dont hit the submit button. So basically I can add 500 by typing it in and clicking the submit button, then continue to add an addition 500 every time I click the submit button. I want to be able to refresh the page, but I cant figure out what is going wrong. Any ideas? Rex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Refresh Error
Okay, I'm displaying an entire table of numbers from my database. Using a form on the same page, you can enter an amount to add to the table and then click submit. I pass all of the information in $_POST back to the same page. Here is my code: if ($_POST["number"] != NULL) { if (is_numeric($_POST["number"]) || $_POST["number"] <= 0.0){ ... display stuff telling them they need to try again ... } else { ... do stuff that adds the number to the table ... $_POST["number"] = NULL; } } ...body of HTML document... Add Amount Everything seems to work fine, up until you click the refresh button, then it will add whatever you just added to the table again, even if you have nothing typed into the form and dont hit the submit button. So basically I can add 500 by typing it in and clicking the submit button, then continue to add an addition 500 every time I click the submit button. I want to be able to refresh the page, but I cant figure out what is going wrong. Any ideas? Rex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh a frame based on a condition in another frame?
Hi, Thanks for the response, I'll try to explain better: I have 2 frames: a Menu and a Content frame. I have 2 menu's: one for support and one for sales If the content frame displays a support article, the support menu should be displayed. If the content frame displays a sales article, the sales menu should be displayed. If the sales menu is already displayed, I don't want it to be refreshed, because it's not necessary. It's already there! So, based on a condition in the Content frame (evaluated by content.php) I want to refresh (or not) the of the menu frame (controlled by menu.php). I hope this is more clear. Ronald "Raditha Dissanayake" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > Hi, > > It's not very clear from your message what you are trying to do. If you > are trying to just reload some of the frames instead of the whole > frameset look at the 'target' attribute for 'A' element in html. > > > Ronald van Raaphorst wrote: > > >Hi all, > > > >I have header, a menu and a content frame. > >The header should not be refreshed. > >The menu dislays a menu (menu.php?menuid=x) from a mysql menu database, and > >should be refreshed based on a condition. > >The content frame (content.php?[article=x | table=y]) displays either an > >article or some database content and should always be refreshed. > > > >Depending on a condition in the content (checked my content.php), I want the > >menu to be refreshed or not, i.e. I want the menu to select another topic. > > > >How do I do this? I don't want the complete page or the menu to be refreshed > >if it's not necessary, and on the other hand, when content.php notices > >another menu item should be selected, it has to be renewed... > > > >Any help is greatly appreciated > >Ronald > > > > > > > > > -- > http://www.raditha.com/php/progress.php > A progress bar for PHP file uploads. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh a frame based on a condition in another frame?
Hi, It's not very clear from your message what you are trying to do. If you are trying to just reload some of the frames instead of the whole frameset look at the 'target' attribute for 'A' element in html. Ronald van Raaphorst wrote: Hi all, I have header, a menu and a content frame. The header should not be refreshed. The menu dislays a menu (menu.php?menuid=x) from a mysql menu database, and should be refreshed based on a condition. The content frame (content.php?[article=x | table=y]) displays either an article or some database content and should always be refreshed. Depending on a condition in the content (checked my content.php), I want the menu to be refreshed or not, i.e. I want the menu to select another topic. How do I do this? I don't want the complete page or the menu to be refreshed if it's not necessary, and on the other hand, when content.php notices another menu item should be selected, it has to be renewed... Any help is greatly appreciated Ronald -- http://www.raditha.com/php/progress.php A progress bar for PHP file uploads. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Refresh a frame based on a condition in another frame?
Hi all, I have header, a menu and a content frame. The header should not be refreshed. The menu dislays a menu (menu.php?menuid=x) from a mysql menu database, and should be refreshed based on a condition. The content frame (content.php?[article=x | table=y]) displays either an article or some database content and should always be refreshed. Depending on a condition in the content (checked my content.php), I want the menu to be refreshed or not, i.e. I want the menu to select another topic. How do I do this? I don't want the complete page or the menu to be refreshed if it's not necessary, and on the other hand, when content.php notices another menu item should be selected, it has to be renewed... Any help is greatly appreciated Ronald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh a page in another frame
* Thus wrote Steve Fulleylove ([EMAIL PROTECTED]): > Hi all, > > I have a PHP web site that uses frames. I can use the header() function to > redirect the user to a new page, but can I use this function to load a page > into a different frame ? negative. you'll have to use some javascipt to refresh a different frame something like echo " javascript may not be correly syntaxed. Curt -- "I used to think I was indecisive, but now I'm not so sure." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Refresh a page in another frame
Hi all, I have a PHP web site that uses frames. I can use the header() function to redirect the user to a new page, but can I use this function to load a page into a different frame ? Thanks in advance, Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh PHP
PHP session functions and $_SESSION work kind of funny with Internet Explorer while this problem rarely happen in 3rd party browser due to the bad design of Internet Explorer... It's a microsoft problem. I have this similiar problem with Internet Explorer. The workaround to the problem I have is to eliminate the use of session_destroy(). Someone anyone login, a new session token will be created anyway. Shockingly, when going from one webpage to another, Internet Explorer sometime grab a wrong session token. "Mauricio" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ralph, > > Before anything, I would like to thank you for the time you are spending > with my problem! > > Ok. I changed using $_SESSION and the problem still happens. I printed both, > $_SESSION and $HTTP_SESSION_VARS and they are the same... not the current > user, but the last logged. It's funny that in the next page, after login, if > I print $_SESSION or $HTTP_SESSION_VARS they are right, but when I call > another page (using a link), like some report, it appears the wrong user. > All pages has the same header, setting no cache... > > any ideas? > > Thank you > > Mauricio Valente > > - Original Message - > From: "Ralph Guzman" <[EMAIL PROTECTED]> > To: "'Mauricio'" <[EMAIL PROTECTED]> > Sent: Tuesday, July 08, 2003 6:57 PM > Subject: RE: [PHP] Refresh PHP > > > > I though you were passing the variable through the url. If you have this > > stored in a session, then try replacing $_GET with $_SESSION > > > > -Original Message- > > From: Mauricio [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, July 08, 2003 1:56 PM > > To: 'PHP' > > Subject: Re: [PHP] Refresh PHP > > > > Doing this, it works. The variable 'url_variable' is changed when it > > pass > > over the if. But I don't want to use a get variable, it could be easily > > changed by the users... its my problem... > > > > Maurício Valente > > > > - Original Message - > > From: "Ralph Guzman" <[EMAIL PROTECTED]> > > To: "'Mauricio'" <[EMAIL PROTECTED]>; "'PHP'" > > <[EMAIL PROTECTED]> > > Sent: Tuesday, July 08, 2003 4:05 PM > > Subject: RE: [PHP] Refresh PHP > > > > > > > How about: > > > > > > if($_GET['url_variable'] != $url_variable){ > > >$url_variable = $_GET['url_variable']; > > >session_register('url_variable') > > > } > > > > > > > > > -Original Message- > > > From: Mauricio [mailto:[EMAIL PROTECTED] > > > Sent: Tuesday, July 08, 2003 11:14 AM > > > To: PHP > > > Subject: Re: [PHP] Refresh PHP > > > > > > Hello Ralph, > > > > > > Actually, after calling session_destroy() I reset those variables > > > assigning > > > an empty value like you said. But it still doesn't work. I did a test > > > after > > > destroying session variables, printing them. They are empty. > > > > > > Another weird thing is that when a login as "joao" them logoff, > > exclude > > > IE > > > cache, going in Tools >> Internet Option..., and login again with > > > another > > > user, this way the variable are printed correctly. > > > > > > It happens in any windows version (95,98,ME,2K,XP) using IE 6.0 and > > > Netscape > > > 7. > > > > > > > > > > > > - Original Message - > > > From: "Ralph Guzman" <[EMAIL PROTECTED]> > > > To: "'Mauricio'" <[EMAIL PROTECTED]> > > > Sent: Tuesday, July 08, 2003 2:11 PM > > > Subject: RE: [PHP] Refresh PHP > > > > > > > > > > Rather than using session_destroy() reset the session variable by > > > > assigning it an empty value. For example, lets say your url looks > > > > something like this: > > > > > > > > http://www.mydomain.com/?url_variable=Mauricio > > > > > > > > then do the following: > > > > > > > > if($_GET['url_variable'] != $url_variable){ > > > >$url_variable = ""; > > > >session_register('url_variable') > > > > } > > > > > > > > > > > > -Original Message- > > > > From: Mauricio [mailto:[EMAIL PROTECTED] > > > > Sent:
Re: [PHP] Refresh PHP
Ralph, Before anything, I would like to thank you for the time you are spending with my problem! Ok. I changed using $_SESSION and the problem still happens. I printed both, $_SESSION and $HTTP_SESSION_VARS and they are the same... not the current user, but the last logged. It's funny that in the next page, after login, if I print $_SESSION or $HTTP_SESSION_VARS they are right, but when I call another page (using a link), like some report, it appears the wrong user. All pages has the same header, setting no cache... any ideas? Thank you Mauricio Valente - Original Message - From: "Ralph Guzman" <[EMAIL PROTECTED]> To: "'Mauricio'" <[EMAIL PROTECTED]> Sent: Tuesday, July 08, 2003 6:57 PM Subject: RE: [PHP] Refresh PHP > I though you were passing the variable through the url. If you have this > stored in a session, then try replacing $_GET with $_SESSION > > -Original Message- > From: Mauricio [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 08, 2003 1:56 PM > To: 'PHP' > Subject: Re: [PHP] Refresh PHP > > Doing this, it works. The variable 'url_variable' is changed when it > pass > over the if. But I don't want to use a get variable, it could be easily > changed by the users... its my problem... > > Maurício Valente > > - Original Message - > From: "Ralph Guzman" <[EMAIL PROTECTED]> > To: "'Mauricio'" <[EMAIL PROTECTED]>; "'PHP'" > <[EMAIL PROTECTED]> > Sent: Tuesday, July 08, 2003 4:05 PM > Subject: RE: [PHP] Refresh PHP > > > > How about: > > > > if($_GET['url_variable'] != $url_variable){ > > $url_variable = $_GET['url_variable']; > >session_register('url_variable') > > } > > > > > > -Original Message- > > From: Mauricio [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, July 08, 2003 11:14 AM > > To: PHP > > Subject: Re: [PHP] Refresh PHP > > > > Hello Ralph, > > > > Actually, after calling session_destroy() I reset those variables > > assigning > > an empty value like you said. But it still doesn't work. I did a test > > after > > destroying session variables, printing them. They are empty. > > > > Another weird thing is that when a login as "joao" them logoff, > exclude > > IE > > cache, going in Tools >> Internet Option..., and login again with > > another > > user, this way the variable are printed correctly. > > > > It happens in any windows version (95,98,ME,2K,XP) using IE 6.0 and > > Netscape > > 7. > > > > > > > > - Original Message - > > From: "Ralph Guzman" <[EMAIL PROTECTED]> > > To: "'Mauricio'" <[EMAIL PROTECTED]> > > Sent: Tuesday, July 08, 2003 2:11 PM > > Subject: RE: [PHP] Refresh PHP > > > > > > > Rather than using session_destroy() reset the session variable by > > > assigning it an empty value. For example, lets say your url looks > > > something like this: > > > > > > http://www.mydomain.com/?url_variable=Mauricio > > > > > > then do the following: > > > > > > if($_GET['url_variable'] != $url_variable){ > > >$url_variable = ""; > > >session_register('url_variable') > > > } > > > > > > > > > -Original Message- > > > From: Mauricio [mailto:[EMAIL PROTECTED] > > > Sent: Tuesday, July 08, 2003 7:02 AM > > > To: PHP > > > Subject: [PHP] Refresh PHP > > > > > > Hi people! > > > > > > Did anyone get this situation? > > > > > > I'm creating a Site that uses 3 session variables. One of them I > > always > > > print at the top of the page, it's the name of the user. There is a > > link > > > that calls the function session_destroy(). Everytime that I follow > > this > > > link > > > and log in with another user, that session variable printed doesn't > > > change, > > > but if I press F5 in IE or Netscape them it brings the right user. I > > > can't > > > make the page return the current user login, it always came with the > > > last > > > user logged. I tried to add some headers to set no cache in all php > > > pages, > > > but it doesn't work. > > > > > > Anyone can help me??? > > > > > > Thanks > > > > > > PS: Sorry about my poor english... > > > > > > > > > Maurício Valente > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > PHP 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] Refresh PHP
Doing this, it works. The variable 'url_variable' is changed when it pass over the if. But I don't want to use a get variable, it could be easily changed by the users... its my problem... Maurício Valente - Original Message - From: "Ralph Guzman" <[EMAIL PROTECTED]> To: "'Mauricio'" <[EMAIL PROTECTED]>; "'PHP'" <[EMAIL PROTECTED]> Sent: Tuesday, July 08, 2003 4:05 PM Subject: RE: [PHP] Refresh PHP > How about: > > if($_GET['url_variable'] != $url_variable){ >$url_variable = $_GET['url_variable']; >session_register('url_variable') > } > > > -Original Message- > From: Mauricio [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 08, 2003 11:14 AM > To: PHP > Subject: Re: [PHP] Refresh PHP > > Hello Ralph, > > Actually, after calling session_destroy() I reset those variables > assigning > an empty value like you said. But it still doesn't work. I did a test > after > destroying session variables, printing them. They are empty. > > Another weird thing is that when a login as "joao" them logoff, exclude > IE > cache, going in Tools >> Internet Option..., and login again with > another > user, this way the variable are printed correctly. > > It happens in any windows version (95,98,ME,2K,XP) using IE 6.0 and > Netscape > 7. > > > > - Original Message - > From: "Ralph Guzman" <[EMAIL PROTECTED]> > To: "'Mauricio'" <[EMAIL PROTECTED]> > Sent: Tuesday, July 08, 2003 2:11 PM > Subject: RE: [PHP] Refresh PHP > > > > Rather than using session_destroy() reset the session variable by > > assigning it an empty value. For example, lets say your url looks > > something like this: > > > > http://www.mydomain.com/?url_variable=Mauricio > > > > then do the following: > > > > if($_GET['url_variable'] != $url_variable){ > >$url_variable = ""; > >session_register('url_variable') > > } > > > > > > -Original Message- > > From: Mauricio [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, July 08, 2003 7:02 AM > > To: PHP > > Subject: [PHP] Refresh PHP > > > > Hi people! > > > > Did anyone get this situation? > > > > I'm creating a Site that uses 3 session variables. One of them I > always > > print at the top of the page, it's the name of the user. There is a > link > > that calls the function session_destroy(). Everytime that I follow > this > > link > > and log in with another user, that session variable printed doesn't > > change, > > but if I press F5 in IE or Netscape them it brings the right user. I > > can't > > make the page return the current user login, it always came with the > > last > > user logged. I tried to add some headers to set no cache in all php > > pages, > > but it doesn't work. > > > > Anyone can help me??? > > > > Thanks > > > > PS: Sorry about my poor english... > > > > > > Maurício Valente > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Refresh PHP
How about: if($_GET['url_variable'] != $url_variable){ $url_variable = $_GET['url_variable']; session_register('url_variable') } -Original Message- From: Mauricio [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 11:14 AM To: PHP Subject: Re: [PHP] Refresh PHP Hello Ralph, Actually, after calling session_destroy() I reset those variables assigning an empty value like you said. But it still doesn't work. I did a test after destroying session variables, printing them. They are empty. Another weird thing is that when a login as "joao" them logoff, exclude IE cache, going in Tools >> Internet Option..., and login again with another user, this way the variable are printed correctly. It happens in any windows version (95,98,ME,2K,XP) using IE 6.0 and Netscape 7. - Original Message - From: "Ralph Guzman" <[EMAIL PROTECTED]> To: "'Mauricio'" <[EMAIL PROTECTED]> Sent: Tuesday, July 08, 2003 2:11 PM Subject: RE: [PHP] Refresh PHP > Rather than using session_destroy() reset the session variable by > assigning it an empty value. For example, lets say your url looks > something like this: > > http://www.mydomain.com/?url_variable=Mauricio > > then do the following: > > if($_GET['url_variable'] != $url_variable){ >$url_variable = ""; >session_register('url_variable') > } > > > -Original Message- > From: Mauricio [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 08, 2003 7:02 AM > To: PHP > Subject: [PHP] Refresh PHP > > Hi people! > > Did anyone get this situation? > > I'm creating a Site that uses 3 session variables. One of them I always > print at the top of the page, it's the name of the user. There is a link > that calls the function session_destroy(). Everytime that I follow this > link > and log in with another user, that session variable printed doesn't > change, > but if I press F5 in IE or Netscape them it brings the right user. I > can't > make the page return the current user login, it always came with the > last > user logged. I tried to add some headers to set no cache in all php > pages, > but it doesn't work. > > Anyone can help me??? > > Thanks > > PS: Sorry about my poor english... > > > Maurício Valente > > > > -- > 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] Refresh PHP
Hello Ralph, Actually, after calling session_destroy() I reset those variables assigning an empty value like you said. But it still doesn't work. I did a test after destroying session variables, printing them. They are empty. Another weird thing is that when a login as "joao" them logoff, exclude IE cache, going in Tools >> Internet Option..., and login again with another user, this way the variable are printed correctly. It happens in any windows version (95,98,ME,2K,XP) using IE 6.0 and Netscape 7. - Original Message - From: "Ralph Guzman" <[EMAIL PROTECTED]> To: "'Mauricio'" <[EMAIL PROTECTED]> Sent: Tuesday, July 08, 2003 2:11 PM Subject: RE: [PHP] Refresh PHP > Rather than using session_destroy() reset the session variable by > assigning it an empty value. For example, lets say your url looks > something like this: > > http://www.mydomain.com/?url_variable=Mauricio > > then do the following: > > if($_GET['url_variable'] != $url_variable){ >$url_variable = ""; >session_register('url_variable') > } > > > -Original Message- > From: Mauricio [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 08, 2003 7:02 AM > To: PHP > Subject: [PHP] Refresh PHP > > Hi people! > > Did anyone get this situation? > > I'm creating a Site that uses 3 session variables. One of them I always > print at the top of the page, it's the name of the user. There is a link > that calls the function session_destroy(). Everytime that I follow this > link > and log in with another user, that session variable printed doesn't > change, > but if I press F5 in IE or Netscape them it brings the right user. I > can't > make the page return the current user login, it always came with the > last > user logged. I tried to add some headers to set no cache in all php > pages, > but it doesn't work. > > Anyone can help me??? > > Thanks > > PS: Sorry about my poor english... > > > Maurício Valente > > > > -- > 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] Refresh PHP
Try adding a random number to the end of your URL.index.php?$randomnumber -Original Message- From: Mauricio [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 10:02 AM To: PHP Subject: [PHP] Refresh PHP Hi people! Did anyone get this situation? I'm creating a Site that uses 3 session variables. One of them I always print at the top of the page, it's the name of the user. There is a link that calls the function session_destroy(). Everytime that I follow this link and log in with another user, that session variable printed doesn't change, but if I press F5 in IE or Netscape them it brings the right user. I can't make the page return the current user login, it always came with the last user logged. I tried to add some headers to set no cache in all php pages, but it doesn't work. Anyone can help me??? Thanks PS: Sorry about my poor english... Maurício Valente -- 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] Refresh PHP
Hi people! Did anyone get this situation? I'm creating a Site that uses 3 session variables. One of them I always print at the top of the page, it's the name of the user. There is a link that calls the function session_destroy(). Everytime that I follow this link and log in with another user, that session variable printed doesn't change, but if I press F5 in IE or Netscape them it brings the right user. I can't make the page return the current user login, it always came with the last user logged. I tried to add some headers to set no cache in all php pages, but it doesn't work. Anyone can help me??? Thanks PS: Sorry about my poor english... Maurício Valente -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Refresh in PHP [solved]
Yeah I found that out eventually. Thanks :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh in PHP
> My user has reported a problem when he loads a page. The page grabs data > from MSSQL and displays this on the screen. However, it is not updated. > Is there any way in getting the page to automatically refresh itself > ONCE when it is loaded, without ending up in a loop? Javascript will do that. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Refresh in PHP
Hi Everyone, My user has reported a problem when he loads a page. The page grabs data from MSSQL and displays this on the screen. However, it is not updated. Is there any way in getting the page to automatically refresh itself ONCE when it is loaded, without ending up in a loop? Many thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Refresh in PHP
Hi Everyone, My user has reported a problem when he loads a page. The page grabs data from MSSQL and displays this on the screen. However, it is not updated. Is there any way in getting the page to automatically refresh itself once when it is loaded? Many thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] refresh
http://www.google.com/search?q=meta+refresh+html+code Google is your friend. Cheers Brendon -Original Message- From: Shaun [mailto:johan@;novtel.co.za] Sent: Monday, November 11, 2002 9:24 PM To: [EMAIL PROTECTED] Subject: [PHP] refresh hi, How do you refresh a page in php? If i cannot wat is the code or meta(i think) to do so? Thanks Shaun -- 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] refresh
hi, How do you refresh a page in php? If i cannot wat is the code or meta(i think) to do so? Thanks Shaun -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Refresh my Memory
I though PHP had an element that got that information from the user... - Original Message - From: "Timothy J Hitchens" <[EMAIL PROTECTED]> Newsgroups: php.general To: "'PHP List'" <[EMAIL PROTECTED]> Sent: Thursday, October 10, 2002 5:06 PM Subject: RE: [PHP] Refresh my Memory > You will need to use Javascript... NOT PHP.. > > > Timothy Hitchens (HITCHO) > [EMAIL PROTECTED] > > HITCHO has Spoken! > > > > > > > -Original Message- > From: Stephen [mailto:[EMAIL PROTECTED]] > Sent: Friday, 11 October 2002 8:05 AM > To: PHP List > Subject: [PHP] Refresh my Memory > > > Hello, > > I forget exactly how to do this so I'm turning to you all for some help. > How can I make it so that if a user does not have a resolution of > atleast 1024x768, it sends them to another page or recomends that they > up their screen size before viewing the page? Any help will be great. > Thanks! > > Thanks, > Stephen Craton > http://www.melchior.us > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Refresh my Memory
You will need to use Javascript... NOT PHP.. Timothy Hitchens (HITCHO) [EMAIL PROTECTED] HITCHO has Spoken! -Original Message- From: Stephen [mailto:[EMAIL PROTECTED]] Sent: Friday, 11 October 2002 8:05 AM To: PHP List Subject: [PHP] Refresh my Memory Hello, I forget exactly how to do this so I'm turning to you all for some help. How can I make it so that if a user does not have a resolution of atleast 1024x768, it sends them to another page or recomends that they up their screen size before viewing the page? Any help will be great. Thanks! Thanks, Stephen Craton http://www.melchior.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php