Re: [PHP-DB] Redirect upon successful form submission
On Tue, Dec 15, 2009 at 1:25 PM, Vinay Kannan wrote: > Yep, that would work, but then if the user is not a member, then the link to > the membership should be printed on the form that has the validation and not > the one that has the form? > > On Tue, Dec 15, 2009 at 10:21 AM, Christoph Rosse wrote: >> >> you could also validate the form in a seperate php file with no output and >> then redirect to the "error" and the "another page" ? >> >> >> Bastien Koert schrieb: >>> >>> On Tue, Dec 15, 2009 at 12:48 PM, Vinay Kannan wrote: >>> Hi, I have 2 pages on php, the first page has a small form to accept a membership number from the user, which checks for membership number in the DB, if the membership no does not exist, gives an error saying 'you are not a member click here to become a member now', this bit works fine. The problem is the following bit 'if the user is a member, i want the user to be directed to another page. this is what i did to get the result since header("Location:") wont work, as already the form has been printed on the page. echo''; but the problem is that this takes couple of seconds, till then the page is very much visible which doesnt look good. Any help on this is much appreciated. Thanks, Vinay. >>> >>> What about holding the form in the buffer, and then dealing with the >>> buffer before sending the form? >>> >>> >>> >> >> >> -- >> PHP Database Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> > > When you look at it like that all together, I find its easier to functionalize the whole process 0) { echo''; } else { if($not_member==0) { echo 'Our records indicate that you are not a member yet, Click here to become a member now'; } } }//end function processForm function showForm(){ ?> REFERENCE FOR MEMBERSHIP TO INFINITY LEARNERS CLUB In order to be able to refer members to Infinity LMRC, you need to be a registered member with us, Please enter your membership number below and start referring. Membership Number This gives way more control over the whole flow -- Bastien Cat, the other other white meat -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Redirect upon successful form submission
Yep, that would work, but then if the user is not a member, then the link to the membership should be printed on the form that has the validation and not the one that has the form? On Tue, Dec 15, 2009 at 10:21 AM, Christoph Rosse wrote: > you could also validate the form in a seperate php file with no output and > then redirect to the "error" and the "another page" ? > > > Bastien Koert schrieb: > > On Tue, Dec 15, 2009 at 12:48 PM, Vinay Kannan wrote: >> >> >>> Hi, >>> >>> I have 2 pages on php, the first page has a small form to accept a >>> membership number from the user, which checks for membership number in >>> the >>> DB, if the membership no does not exist, gives an error saying 'you are >>> not >>> a member click here to become a member now', this bit works fine. >>> >>> The problem is the following bit 'if the user is a member, i want the >>> user >>> to be directed to another page. >>> >>> this is what i did to get the result since header("Location:") wont >>> work, as already the form has been printed on the page. >>> >>> echo''; but the >>> problem is that this takes couple of seconds, till then the page is very >>> much visible which doesnt look good. >>> >>> Any help on this is much appreciated. >>> >>> Thanks, >>> Vinay. >>> >>> >>> >> >> What about holding the form in the buffer, and then dealing with the >> buffer before sending the form? >> >> >> >> > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP-DB] Redirect upon successful form submission
you could also validate the form in a seperate php file with no output and then redirect to the "error" and the "another page" ? Bastien Koert schrieb: On Tue, Dec 15, 2009 at 12:48 PM, Vinay Kannan wrote: Hi, I have 2 pages on php, the first page has a small form to accept a membership number from the user, which checks for membership number in the DB, if the membership no does not exist, gives an error saying 'you are not a member click here to become a member now', this bit works fine. The problem is the following bit 'if the user is a member, i want the user to be directed to another page. this is what i did to get the result since header("Location:") wont work, as already the form has been printed on the page. echo''; but the problem is that this takes couple of seconds, till then the page is very much visible which doesnt look good. Any help on this is much appreciated. Thanks, Vinay. What about holding the form in the buffer, and then dealing with the buffer before sending the form? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Redirect upon successful form submission
Thanks Bastien, To be honest I have no clue as to how to hold the form in the buffer. I've copied the code below, that might help I guess. 0) { echo''; } else { $not_member=0; } } ?> REFERENCE FOR MEMBERSHIP TO INFINITY LEARNERS CLUB In order to be able to refer members to Infinity LMRC, you need to be a registered member with us, Please enter your membership number below and start referring. Membership Number Click here to become a member now'; }?> On Tue, Dec 15, 2009 at 10:09 AM, Bastien Koert wrote: > On Tue, Dec 15, 2009 at 12:48 PM, Vinay Kannan wrote: > > Hi, > > > > I have 2 pages on php, the first page has a small form to accept a > > membership number from the user, which checks for membership number in > the > > DB, if the membership no does not exist, gives an error saying 'you are > not > > a member click here to become a member now', this bit works fine. > > > > The problem is the following bit 'if the user is a member, i want the > user > > to be directed to another page. > > > > this is what i did to get the result since header("Location:") wont > > work, as already the form has been printed on the page. > > > > echo''; but the > > problem is that this takes couple of seconds, till then the page is very > > much visible which doesnt look good. > > > > Any help on this is much appreciated. > > > > Thanks, > > Vinay. > > > > What about holding the form in the buffer, and then dealing with the > buffer before sending the form? > > > -- > > Bastien > > Cat, the other other white meat >
Re: [PHP-DB] Redirect upon successful form submission
On Tue, Dec 15, 2009 at 12:48 PM, Vinay Kannan wrote: > Hi, > > I have 2 pages on php, the first page has a small form to accept a > membership number from the user, which checks for membership number in the > DB, if the membership no does not exist, gives an error saying 'you are not > a member click here to become a member now', this bit works fine. > > The problem is the following bit 'if the user is a member, i want the user > to be directed to another page. > > this is what i did to get the result since header("Location:") wont > work, as already the form has been printed on the page. > > echo''; but the > problem is that this takes couple of seconds, till then the page is very > much visible which doesnt look good. > > Any help on this is much appreciated. > > Thanks, > Vinay. > What about holding the form in the buffer, and then dealing with the buffer before sending the form? -- Bastien Cat, the other other white meat -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Redirect.
Don't know if I fully understand your question, but, in general, you can handle redirects with the header() function, e.g., header("Location: http://www.yoursite.com/yourscript.php?msg=0&storyID=".$newstory."";); As you can see, you can include variable=value pairs at the end of the URL as well (msg and storyID in the example above). Check for the header() function in the documentation on php.net for additional information. PHP-GENERAL, as suggested by another user, is the most appropriate and possibly more helpful mailing list for your particular question. HTH, Rich > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 02, 2003 6:19 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Redirect. > Importance: High > > > Hi all, > I have a problem.How can I redirect from a PHP script to > another script in asp, php or a HTML page? > This script redirect to another script in function of the > values of a variable. > Thanks in advance > Francesco > [EMAIL PROTECTED] > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Redirect.
header( "Location: http://..."; ) ; _ - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 02, 2003 12:18 Subject: [PHP-DB] Redirect. Hi all, I have a problem.How can I redirect from a PHP script to another script in asp, php or a HTML page? This script redirect to another script in function of the values of a variable. Thanks in advance Francesco [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Redirect.
Hello gfmb, Tuesday, December 2, 2003, 11:18:40 AM, you wrote: gli> I have a problem.How can I redirect from a PHP script to gli> another script in asp, php or a HTML page? gli> This script redirect to another script in function of the values of a variable. This isn't really a database related question, is it? See PHP-General. -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] redirect
Wrong list to ask on -- you are looking for an Apache mailing list. http://apache.org/ read the manual page on mod_rewrite On Mon, 27 Oct 2003, Dan Liu wrote: > Hi all, > Has anyone used 'Module mod_rewrite URL Rewriting Engine'? > I need to do a redirect from > http://url1/cgi-bin/mapserv?&map=/dir1/county.map > to > http://url2/cgi-bin/mapserv?&map=/dir2/county.map > > But it is not working. Does somebody know why? > Thanks in Advance. > Dan > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > --- Peter Beckman Internet Guy [EMAIL PROTECTED] http://www.purplecow.com/ --- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] redirect
Dan Liu wrote: Hi all, Has anyone used 'Module mod_rewrite URL Rewriting Engine'? I need to do a redirect from http://url1/cgi-bin/mapserv?&map=/dir1/county.map to http://url2/cgi-bin/mapserv?&map=/dir2/county.map But it is not working. Does somebody know why? Thanks in Advance. Dan Dan - without seeing the rewrite code.. its sorta hard to tell why it wouldn't be working!!! simply put, if your host allows you to use a .htaccess and mod_rewrite.. in the .htaccess RewriteEngine On RewriteRule /usage.html /usage/index.html Where /usage.html is the file that was requested, and /usage/index.html is the file that it needs to go to. Rolf Brusletto www.phpExamples.net -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] redirect
At 04:33 PM 3/1/2003 -0500, Jeremi Bergman wrote: www.php.net/round find the answer there, you will :-) ~kurth Nevermind, I found the answer, and why it wasn't working. Now I was wondering how I can format a number to be a currency? Like if $totalprice = 14.343 have it print 14.34. thanks -Original Message- From: Jeremi Bergman [mailto:[EMAIL PROTECTED] Sent: Saturday, March 01, 2003 2:13 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] redirect How can I redirect a user to a specific page if they are already "authenticated"? if ($SESSION_Authenticated) { //code here to redirect; } thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] redirect
> Nevermind, I found the answer, and why it wasn't working. Now I was > wondering how I can format a number to be a currency? Like if > $totalprice = 14.343 have it print 14.34. Number_format() or printf() ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] redirect
Nevermind, I found the answer, and why it wasn't working. Now I was wondering how I can format a number to be a currency? Like if $totalprice = 14.343 have it print 14.34. thanks -Original Message- From: Jeremi Bergman [mailto:[EMAIL PROTECTED] Sent: Saturday, March 01, 2003 2:13 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] redirect How can I redirect a user to a specific page if they are already "authenticated"? if ($SESSION_Authenticated) { //code here to redirect; } thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] redirect a page
If you really want to redirect and not just display a message that no records were found, then this will work: $num = mysql_numrows($result); if ($num == 0) { header("Location: sorry.php"); exit; } ELSE { while ... --- "Rankin, Randy" <[EMAIL PROTECTED]> wrote: > Nato, > > Try something like this: > > $num = mysql_numrows($result); > if ($num == 0) > > { > echo "There were no records found."; > } > else > while ... > > -Original Message- > From: Natividad Castro [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 24, 2002 11:01 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] redirect a page > > > Hi to all, > I have a search form where users can search for a specific record; > up to now > is working fine, but what I would like to do is: if the record is > not found, > redirect them to another page that says that record was not found. > Can > anybody tell me how to do this? I already tried using this > statement > if ( !mysql_fetch_array($result) ) { > include file // this the page that I want to redirect them, but it > doen't > work > } > > I would like to execute the first statement it's false: > e.g if name doesn't match with anything in the table, redirect to > another > page > else execute the whole query. > >$query = mysql_query("SELECT * from 150bk where trim(NAME) like > '%" . > $legal_name . "%'"); > >while($query_data = mysql_fetch_array($query)) >{ > $id = trim($query_data[ID]); > $name = trim($query_data[NAME]); > $tracking_num = trim($query_data[TRACKING_NUMBER]); > $census = trim($query_data[CENSUS_NUM]); > $name_dba = trim($query_data[NAME_DBA]); > } > > Any help, it's greatly appreciate > Thanks > Nato > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > __ Do You Yahoo!? Yahoo! Games - play chess, backgammon, pool and more http://games.yahoo.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] redirect a page
Nato, Try something like this: $num = mysql_numrows($result); if ($num == 0) { echo "There were no records found."; } else while ... -Original Message- From: Natividad Castro [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 24, 2002 11:01 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] redirect a page Hi to all, I have a search form where users can search for a specific record; up to now is working fine, but what I would like to do is: if the record is not found, redirect them to another page that says that record was not found. Can anybody tell me how to do this? I already tried using this statement if ( !mysql_fetch_array($result) ) { include file // this the page that I want to redirect them, but it doen't work } I would like to execute the first statement it's false: e.g if name doesn't match with anything in the table, redirect to another page else execute the whole query. $query = mysql_query("SELECT * from 150bk where trim(NAME) like '%" . $legal_name . "%'"); while($query_data = mysql_fetch_array($query)) { $id = trim($query_data[ID]); $name = trim($query_data[NAME]); $tracking_num = trim($query_data[TRACKING_NUMBER]); $census = trim($query_data[CENSUS_NUM]); $name_dba = trim($query_data[NAME_DBA]); } Any help, it's greatly appreciate Thanks Nato -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Redirect command?
if ( $x==true) { print "\n"; print "window.open('b.php','_self');\n"; print "\n"; die; } > -Original Message- > From: Julio Cuz, Jr. [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 22, 2001 3:23 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Redirect command? > > > Hi-- > > I've been looking for a "redirect" command (basically > redirect from page a > to page b if something happens)... > > Julio Cuz, Jr. > Riverside Community College > [EMAIL PROTECTED] > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Redirect command?
header ("Location: http://www.php.net"); /* Redirect browser -Original Message- From: Julio Cuz, Jr. [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 22, 2001 4:23 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Redirect command? Hi-- I've been looking for a "redirect" command (basically redirect from page a to page b if something happens)... Julio Cuz, Jr. Riverside Community College [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]