[PHP] Re: Submit Using An Image Form Processing

2011-06-18 Thread Geoff Lane
On Saturday, June 18, 2011, Ron Piggott wrote:

 I am not getting anything.  Is there a correct way of passing a
 variable through an image?  The value in this above example is the
 auto_increment value of the product.  From this I could remove the
 item from the shopping cart.

An image causes two variables (name_x and name_y) to be set where
these give the coordinates of the point on the image where the user
clicked. So, the corresponding x and y $_GET or $_POST variables will
be set and using your example, if you had:

form action='adjust_cart.php' method='post'
INPUT TYPE=image 
SRC=http://www.theverseoftheday.info/store-images/trash_can.png;
  WIDTH=20  HEIGHT=20 style=float: right;border:0;
  alt=Remove Product From Shopping Cart name=remove_product /
/form

Then in the called script, you could use:

if (isset($_POST['remove_product_x'])){
  // do stuff to remove product from cart
}

HTH,

-- 
Geoff


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Submit Using An Image Form Processing

2011-06-18 Thread Ashley Sheridan


Geoff Lane ge...@gjctech.co.uk wrote:

On Saturday, June 18, 2011, Ron Piggott wrote:

 I am not getting anything.  Is there a correct way of passing a
 variable through an image?  The value in this above example is the
 auto_increment value of the product.  From this I could remove the
 item from the shopping cart.

An image causes two variables (name_x and name_y) to be set where
these give the coordinates of the point on the image where the user
clicked. So, the corresponding x and y $_GET or $_POST variables will
be set and using your example, if you had:

form action='adjust_cart.php' method='post'
INPUT TYPE=image
SRC=http://www.theverseoftheday.info/store-images/trash_can.png;
  WIDTH=20  HEIGHT=20 style=float: right;border:0;
  alt=Remove Product From Shopping Cart name=remove_product /
/form

Then in the called script, you could use:

if (isset($_POST['remove_product_x'])){
  // do stuff to remove product from cart
}

HTH,

--
Geoff


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


What browser did you test your original script on, because IE has problems 
with image buttons on forms. Better to use a regular submit button and style it.

Don't use links. They might work fine, but search engines follow them, and can 
cause pains with scripts that don't take them into consideration.

Ashley Sheridan
http://www.ashleysheridan.co.uk
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 2 submit buttons.

2011-02-15 Thread Floyd Resler

On Feb 14, 2011, at 5:24 PM, Paul M Foster wrote:

 On Mon, Feb 14, 2011 at 05:15:11PM -0500, Floyd Resler wrote:
 
 
 On Feb 14, 2011, at 4:18 PM, Paul M Foster wrote:
 
 On Mon, Feb 14, 2011 at 03:35:02PM -0400, Paul Halliday wrote:
 
 I have 2 buttons on a page:
 
 if (isset($_POST['botton1'])) {dothing1();} if
 (isset($_POST['button2'])) {dothing2();}
 
 They both work as intended when I click on them. If however I click
 within a text box and hit enter, they both fire.
 
 Is there a way to stop this?
 
 Check your code. My experience has been that forms with multiple
 submits will fire the *first* submit in the form when you hit Enter
 in a text field or whatever. I just tested this and found it to be
 true.
 
 Now, I'm doing this in Firefox on Linux. I suppose there could be
 differences among browsers, but I suspect that the specs for HTML
 mandate the behavior I describe.
 
 Paul
 
 
 If you don't mind using a little JavaScript you can test for which
 button should fire when enter is pressed.  How I would do it is to
 first add a hidden field and call it buttonClicked.  Now, in the
 text field where you would like a button to fire if enter is pressed,
 at this to the tag: onkeyup=checkKey(this,event).  For the
 JavaScript portion of it, do this:
 
 Yeah, but you don't even have to go that far. Just put a print_r($_POST)
 at the beginning of the file, and you'll see which button gets pressed.
 It will show up in the POST array.
 
 Paul
 
 -- 

Yeah, except that the original question was about controlling which button 
fires when the enter key is pressed. :)

Thanks!
Floyd


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 2 submit buttons.

2011-02-15 Thread Steve Staples
On Tue, 2011-02-15 at 08:07 -0500, Floyd Resler wrote:
 On Feb 14, 2011, at 5:24 PM, Paul M Foster wrote:
 
  On Mon, Feb 14, 2011 at 05:15:11PM -0500, Floyd Resler wrote:
  
  
  On Feb 14, 2011, at 4:18 PM, Paul M Foster wrote:
  
  On Mon, Feb 14, 2011 at 03:35:02PM -0400, Paul Halliday wrote:
  
  I have 2 buttons on a page:
  
  if (isset($_POST['botton1'])) {dothing1();} if
  (isset($_POST['button2'])) {dothing2();}
  
  They both work as intended when I click on them. If however I click
  within a text box and hit enter, they both fire.
  
  Is there a way to stop this?
  
  Check your code. My experience has been that forms with multiple
  submits will fire the *first* submit in the form when you hit Enter
  in a text field or whatever. I just tested this and found it to be
  true.
  
  Now, I'm doing this in Firefox on Linux. I suppose there could be
  differences among browsers, but I suspect that the specs for HTML
  mandate the behavior I describe.
  
  Paul
  
  
  If you don't mind using a little JavaScript you can test for which
  button should fire when enter is pressed.  How I would do it is to
  first add a hidden field and call it buttonClicked.  Now, in the
  text field where you would like a button to fire if enter is pressed,
  at this to the tag: onkeyup=checkKey(this,event).  For the
  JavaScript portion of it, do this:
  
  Yeah, but you don't even have to go that far. Just put a print_r($_POST)
  at the beginning of the file, and you'll see which button gets pressed.
  It will show up in the POST array.
  
  Paul
  
  -- 
 
 Yeah, except that the original question was about controlling which button 
 fires when the enter key is pressed. :)
 
 Thanks!
 Floyd
 
 

I think if you have more than 1 submit button, then you need to disable
the enter to submit functionality.  This would force people/users to
click on either of the submit buttons...

Or better yet, if you have a default submit button, have a hidden text
value with your default submit value, and then on the submit onclick
event of the other submit button, replace the text value of the hidden
field to something else.   Then finally in your postback check, check
the value of the hidden field to determine what you're going to do.

Personally, I do a combination of both.  I disable the ability to submit
on key press, and require you to submit via my submit methods, and
onclick of the submit button sets a value to the hidden text field, and
then do a switch() case:... on that hidden value.   But that is my way
of doing it (which will prolly get ripped apart by someone here, which
is good/constructive criticism for me)

steve


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] 2 submit buttons.

2011-02-14 Thread Paul Halliday
I have 2 buttons on a page:

if (isset($_POST['botton1'])) {dothing1();}
if (isset($_POST['button2'])) {dothing2();}

They both work as intended when I click on them. If however I click
within a text box and hit enter, they both fire.

Is there a way to stop this?

Thanks.

-- 
Paul Halliday
http://www.pintumbler.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 2 submit buttons.

2011-02-14 Thread Paul M Foster
On Mon, Feb 14, 2011 at 03:35:02PM -0400, Paul Halliday wrote:

 I have 2 buttons on a page:
 
 if (isset($_POST['botton1'])) {dothing1();}
 if (isset($_POST['button2'])) {dothing2();}
 
 They both work as intended when I click on them. If however I click
 within a text box and hit enter, they both fire.
 
 Is there a way to stop this?

Check your code. My experience has been that forms with multiple submits
will fire the *first* submit in the form when you hit Enter in a text
field or whatever. I just tested this and found it to be true.

Now, I'm doing this in Firefox on Linux. I suppose there could be
differences among browsers, but I suspect that the specs for HTML
mandate the behavior I describe.

Paul

-- 
Paul M. Foster
http://noferblatz.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 2 submit buttons.

2011-02-14 Thread Floyd Resler

On Feb 14, 2011, at 4:18 PM, Paul M Foster wrote:

 On Mon, Feb 14, 2011 at 03:35:02PM -0400, Paul Halliday wrote:
 
 I have 2 buttons on a page:
 
 if (isset($_POST['botton1'])) {dothing1();}
 if (isset($_POST['button2'])) {dothing2();}
 
 They both work as intended when I click on them. If however I click
 within a text box and hit enter, they both fire.
 
 Is there a way to stop this?
 
 Check your code. My experience has been that forms with multiple submits
 will fire the *first* submit in the form when you hit Enter in a text
 field or whatever. I just tested this and found it to be true.
 
 Now, I'm doing this in Firefox on Linux. I suppose there could be
 differences among browsers, but I suspect that the specs for HTML
 mandate the behavior I describe.
 
 Paul
 

If you don't mind using a little JavaScript you can test for which button 
should fire when enter is pressed.  How I would do it is to first add a hidden 
field and call it buttonClicked.  Now, in the text field where you would like 
a button to fire if enter is pressed, at this to the tag: 
onkeyup=checkKey(this,event).  For the JavaScript portion of it, do this:

function checkKey(element,evt) {
var buttonClicked=

if(evt.keyCode=13) {
if(element.name=field1) {
buttonClicked=button1
} else if(element.name==field2) {
buttonClicked=button2
}
if(buttonClicked) {
document.formName.buttonClicked.value=buttonClicked
document.formName.submit()
}
}
}

Hope that helps!

Take care,
Floyd


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 2 submit buttons.

2011-02-14 Thread Paul M Foster
On Mon, Feb 14, 2011 at 05:15:11PM -0500, Floyd Resler wrote:

 
 On Feb 14, 2011, at 4:18 PM, Paul M Foster wrote:
 
  On Mon, Feb 14, 2011 at 03:35:02PM -0400, Paul Halliday wrote:
  
  I have 2 buttons on a page:
  
  if (isset($_POST['botton1'])) {dothing1();} if
  (isset($_POST['button2'])) {dothing2();}
  
  They both work as intended when I click on them. If however I click
  within a text box and hit enter, they both fire.
  
  Is there a way to stop this?
  
  Check your code. My experience has been that forms with multiple
  submits will fire the *first* submit in the form when you hit Enter
  in a text field or whatever. I just tested this and found it to be
  true.
  
  Now, I'm doing this in Firefox on Linux. I suppose there could be
  differences among browsers, but I suspect that the specs for HTML
  mandate the behavior I describe.
  
  Paul
  
 
 If you don't mind using a little JavaScript you can test for which
 button should fire when enter is pressed.  How I would do it is to
 first add a hidden field and call it buttonClicked.  Now, in the
 text field where you would like a button to fire if enter is pressed,
 at this to the tag: onkeyup=checkKey(this,event).  For the
 JavaScript portion of it, do this:

Yeah, but you don't even have to go that far. Just put a print_r($_POST)
at the beginning of the file, and you'll see which button gets pressed.
It will show up in the POST array.

Paul

-- 
Paul M. Foster
http://noferblatz.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 2 submit buttons.

2011-02-14 Thread tolga

15.02.2011 00:24, Paul M Foster yazmış:

On Mon, Feb 14, 2011 at 05:15:11PM -0500, Floyd Resler wrote:


On Feb 14, 2011, at 4:18 PM, Paul M Foster wrote:


On Mon, Feb 14, 2011 at 03:35:02PM -0400, Paul Halliday wrote:


I have 2 buttons on a page:

if (isset($_POST['botton1'])) {dothing1();} if
(isset($_POST['button2'])) {dothing2();}

They both work as intended when I click on them. If however I click
within a text box and hit enter, they both fire.

Is there a way to stop this?

Check your code. My experience has been that forms with multiple
submits will fire the *first* submit in the form when you hit Enter
in a text field or whatever. I just tested this and found it to be
true.

Now, I'm doing this in Firefox on Linux. I suppose there could be
differences among browsers, but I suspect that the specs for HTML
mandate the behavior I describe.

Paul


If you don't mind using a little JavaScript you can test for which
button should fire when enter is pressed.  How I would do it is to
first add a hidden field and call it buttonClicked.  Now, in the
text field where you would like a button to fire if enter is pressed,
at this to the tag: onkeyup=checkKey(this,event).  For the
JavaScript portion of it, do this:

Yeah, but you don't even have to go that far. Just put a print_r($_POST)
at the beginning of the file, and you'll see which button gets pressed.
It will show up in the POST array.

Paul


this could also work;
JS:
function send ( selectedtype )
{
document.formname.postingvalue.value = selectedtype ;
document.formname.submit() ;
}
html:
form name=formname
input type=hidden name=postingvalue /
a href=javascript:send('1')Button 1/a/td
a href=javascript:send('2')Button 2/a/td
a href=javascript:send('3')Button 3/a/td
php:
if($_POST['postingvalue']==1)
{ code here } elseif ($_POST['postingvalue']==1)
{ code 2 here } bla bla

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 2 submit buttons.

2011-02-14 Thread Dmitrii Varvashenia
2011/2/14 Paul Halliday paul.halli...@gmail.com:
 if (isset($_POST['botton1'])) {dothing1();}
 if (isset($_POST['button2'])) {dothing2();}

Hello.

in html:
input type=submit value=Update name=op
input type=submit value=Checkout name=op

in PHP
if(isset($_POST['op'])){
 switch($_POST['op']){
  case 'Update':
   dothing1();
  break;

  case 'Checkout':
   dothing2();
  break;

  default:
   dohatehackersfunction(':)');
  break;
 }
}

PS: Don't use multiple input type=image buttons - all IE's don't
send value attribute in POST - use CSS


-- 
WBR, Dmitrii
+375 29 60-LINUX, 25-LINUX, 40-LINUX
icq: 193-74-771
www.varvashenia.ru, www.seoder.ru

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 2 submit buttons.

2011-02-14 Thread Dmitrii Varvashenia
oh - I forgot - the first the submit will be the default

2011/2/15 Dmitrii Varvashenia varvashe...@gmail.com:


-- 
WBR, Dmitrii
+375 29 60-LINUX, 25-LINUX, 40-LINUX
icq: 193-74-771
www.varvashenia.ru, www.seoder.ru

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Multiple Submit

2007-02-27 Thread Richard Lynch
Once you submit the form, it's a done deal, and you're going to get a
response back...

Maybe you want some kind of AJAX-y thing somewhere?

On Mon, February 26, 2007 10:23 am, Dan Shirah wrote:
 Hello all,

 I have a page that has multiple submits on it.  One submit is within
 my
 javascriptfor form checking, the other submit is a button used to
 populate
 all customer information if an order ID is entered.

 Problem:  I cannot get the two to coincide at the same time.  They
 both use
 the submit function to send the data to the same page instead of their
 unique individual pages.

 Code:  Below are the code snipets.


 ?php echo ?xml version=\1.0\ encoding=\iso-8859-1\?.; ?
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml;
 HEAD
 script language=JavaScript
 !--

 function closeThis() {
  if (window.confirm(Are you sure you want to cancel the payment
 request?))

   this.window.close();
 }

 *function checkForm() {*

  // ** START **
   if (inputForm.cc_phone_number.value == ) {
 alert( Please enter a phone number. );
 inputForm.cc_phone_number.focus();
 return;
   }

if (inputForm.receipt.value == ) {
 alert( Please select whether or not a receipt was requested. );
 inputForm.phone_number.focus();
 return;
   }

   if (inputForm.cc_first_name.value == ) {
 alert( Please enter a first name. );
 inputForm.cc_first_name.focus();
 return;
   }

   if (inputForm.cc_last_name.value == ) {
 alert( Please enter a last name. );
 inputForm.cc_last_name.focus();
 return;
   }

   if (!(document.inputForm.cc_comments.value ==)) {
   if (document.inputForm.cc_comments.value.length  250)
   {
 alert(The Comments must be less than 250 characters.\nIt is
 currently 
 + document.inputForm.window_name.value.length +  characters.);
document.inputForm.window_name.focus();
return;
   }
  }
 * document.inputForm.submit();*
 }

 //--
 /script
 LINK rel=stylesheet type=text/css
 href=../../CSS/background.css
 /head
 body
 *form name=inputForm action=save.php method=post
 enctype=multipart/form-data*
 table align=center border=0 cellpadding=0 cellspacing=0
 width=680
  tr
 td height=13 align=center class=tblheadstrongCredit Card
 Information/strong/td
  /tr

 *// LOTS OF FORM DATA REMOVED FOR EMAIL LENGTH*

 table align=center border=0 cellpadding=0 cellspacing=0
 width=680
 tr
 *This is the other submit that I need to go a page other than the one
 specified in the form*
 *td width=62a href=DeferredPayment3.phpinput type=submit
 name=retrieve value=Retrieve/a/td*
   td width=8/td
 /tr
 /table
 br /
 br /
 table align=center border=0 cellpadding=0 cellspacing=0
 width=680
  tr
 *Call to the javascript checkForm function*
  *td width=64 align=lefta href=javascript:checkForm()
 title=SaveSave/a/td
 * td width=616 align=lefta href=javascript:closeThis()
 title=CloseClose/a/td
  /tr
 /table
 /form
 /body
 /html



-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Multiple Submit

2007-02-27 Thread Richard Lynch
On Mon, February 26, 2007 1:14 pm, David Giragosian wrote:
 However, since I have a form within a form, it is giving me
 problems.

You simply cannot nest one form inside another, if that's what you are
doing...

Don't do that.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Multiple Submit

2007-02-26 Thread Dan Shirah

Hello all,

I have a page that has multiple submits on it.  One submit is within my
javascriptfor form checking, the other submit is a button used to populate
all customer information if an order ID is entered.

Problem:  I cannot get the two to coincide at the same time.  They both use
the submit function to send the data to the same page instead of their
unique individual pages.

Code:  Below are the code snipets.


?php echo ?xml version=\1.0\ encoding=\iso-8859-1\?.; ?
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
HEAD
script language=JavaScript
!--

function closeThis() {
if (window.confirm(Are you sure you want to cancel the payment request?))

 this.window.close();
}

*function checkForm() {*

// ** START **
 if (inputForm.cc_phone_number.value == ) {
   alert( Please enter a phone number. );
   inputForm.cc_phone_number.focus();
   return;
 }

  if (inputForm.receipt.value == ) {
   alert( Please select whether or not a receipt was requested. );
   inputForm.phone_number.focus();
   return;
 }

 if (inputForm.cc_first_name.value == ) {
   alert( Please enter a first name. );
   inputForm.cc_first_name.focus();
   return;
 }

 if (inputForm.cc_last_name.value == ) {
   alert( Please enter a last name. );
   inputForm.cc_last_name.focus();
   return;
 }

 if (!(document.inputForm.cc_comments.value ==)) {
 if (document.inputForm.cc_comments.value.length  250)
 {
   alert(The Comments must be less than 250 characters.\nIt is currently 
+ document.inputForm.window_name.value.length +  characters.);
  document.inputForm.window_name.focus();
  return;
 }
}
* document.inputForm.submit();*
}

//--
/script
LINK rel=stylesheet type=text/css href=../../CSS/background.css
/head
body
*form name=inputForm action=save.php method=post
enctype=multipart/form-data*
table align=center border=0 cellpadding=0 cellspacing=0
width=680
tr
   td height=13 align=center class=tblheadstrongCredit Card
Information/strong/td
/tr

*// LOTS OF FORM DATA REMOVED FOR EMAIL LENGTH*

table align=center border=0 cellpadding=0 cellspacing=0
width=680
tr
*This is the other submit that I need to go a page other than the one
specified in the form*
*td width=62a href=DeferredPayment3.phpinput type=submit
name=retrieve value=Retrieve/a/td*
 td width=8/td
/tr
/table
br /
br /
table align=center border=0 cellpadding=0 cellspacing=0
width=680
tr
*Call to the javascript checkForm function*
*td width=64 align=lefta href=javascript:checkForm()
title=SaveSave/a/td
* td width=616 align=lefta href=javascript:closeThis()
title=CloseClose/a/td
/tr
/table
/form
/body
/html


Re: [PHP] Multiple Submit

2007-02-26 Thread Németh Zoltán
2007. 02. 26, hétfő keltezéssel 11.23-kor Dan Shirah ezt írta:
 Hello all,
 
 I have a page that has multiple submits on it.  One submit is within my
 javascriptfor form checking, the other submit is a button used to populate
 all customer information if an order ID is entered.
 
 Problem:  I cannot get the two to coincide at the same time.  They both use
 the submit function to send the data to the same page instead of their
 unique individual pages.
 
 Code:  Below are the code snipets.
 
 
 ?php echo ?xml version=\1.0\ encoding=\iso-8859-1\?.; ?
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml;
 HEAD
 script language=JavaScript
 !--
 
 function closeThis() {
  if (window.confirm(Are you sure you want to cancel the payment request?))
 
   this.window.close();
 }
 
 *function checkForm() {*
 
  // ** START **
   if (inputForm.cc_phone_number.value == ) {
 alert( Please enter a phone number. );
 inputForm.cc_phone_number.focus();
 return;
   }
 
if (inputForm.receipt.value == ) {
 alert( Please select whether or not a receipt was requested. );
 inputForm.phone_number.focus();
 return;
   }
 
   if (inputForm.cc_first_name.value == ) {
 alert( Please enter a first name. );
 inputForm.cc_first_name.focus();
 return;
   }
 
   if (inputForm.cc_last_name.value == ) {
 alert( Please enter a last name. );
 inputForm.cc_last_name.focus();
 return;
   }
 
   if (!(document.inputForm.cc_comments.value ==)) {
   if (document.inputForm.cc_comments.value.length  250)
   {
 alert(The Comments must be less than 250 characters.\nIt is currently 
 + document.inputForm.window_name.value.length +  characters.);
document.inputForm.window_name.focus();
return;
   }
  }
 * document.inputForm.submit();*
 }
 
 //--
 /script
 LINK rel=stylesheet type=text/css href=../../CSS/background.css
 /head
 body
 *form name=inputForm action=save.php method=post
 enctype=multipart/form-data*
 table align=center border=0 cellpadding=0 cellspacing=0
 width=680
  tr
 td height=13 align=center class=tblheadstrongCredit Card
 Information/strong/td
  /tr
 
 *// LOTS OF FORM DATA REMOVED FOR EMAIL LENGTH*
 
 table align=center border=0 cellpadding=0 cellspacing=0
 width=680
 tr
 *This is the other submit that I need to go a page other than the one
 specified in the form*
 *td width=62a href=DeferredPayment3.phpinput type=submit
 name=retrieve value=Retrieve/a/td*
   td width=8/td

AFAIK an input within an a tag will not work ever
why don't you do it the way you do the other submit button? (with
javascript submit();)

greets
Zoltán Németh

 /tr
 /table
 br /
 br /
 table align=center border=0 cellpadding=0 cellspacing=0
 width=680
  tr
 *Call to the javascript checkForm function*
  *td width=64 align=lefta href=javascript:checkForm()
 title=SaveSave/a/td
 * td width=616 align=lefta href=javascript:closeThis()
 title=CloseClose/a/td
  /tr
 /table
 /form
 /body
 /html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Multiple Submit

2007-02-26 Thread tedd

At 11:23 AM -0500 2/26/07, Dan Shirah wrote:

Hello all,

I have a page that has multiple submits on it.  One submit is within my
javascriptfor form checking, the other submit is a button used to populate
all customer information if an order ID is entered.

Problem:  I cannot get the two to coincide at the same time.  They both use
the submit function to send the data to the same page instead of their
unique individual pages.


Nothing wrong with putting two forms on the same page and each with 
their own action and submit button.


You can always add an attribute value (value=1) with each submit 
button so that you can determine later which page to redirect your 
attention.


tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Multiple Submit

2007-02-26 Thread Dan Shirah

When I click on save at the bottom, I want it to check my form and submit
all the values.  When I click on the Retrieve button I want it to submit
my order number to another page, and also carry over the $_POST value of any
field that may have had info entered into it.

However, since I have a form within a form, it is giving me problems.


On 2/26/07, tedd [EMAIL PROTECTED] wrote:


At 11:23 AM -0500 2/26/07, Dan Shirah wrote:
Hello all,

I have a page that has multiple submits on it.  One submit is within my
javascriptfor form checking, the other submit is a button used to
populate
all customer information if an order ID is entered.

Problem:  I cannot get the two to coincide at the same time.  They both
use
the submit function to send the data to the same page instead of their
unique individual pages.

Nothing wrong with putting two forms on the same page and each with
their own action and submit button.

You can always add an attribute value (value=1) with each submit
button so that you can determine later which page to redirect your
attention.

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com



Re: [PHP] Multiple Submit

2007-02-26 Thread David Giragosian

I always use :

onClick=\this.form.action='SomeOtherPage.php'; \

inside the button tag.

Seems to work just fine.

David

On 2/26/07, Dan Shirah [EMAIL PROTECTED] wrote:


When I click on save at the bottom, I want it to check my form and
submit
all the values.  When I click on the Retrieve button I want it to submit
my order number to another page, and also carry over the $_POST value of
any
field that may have had info entered into it.

However, since I have a form within a form, it is giving me problems.


On 2/26/07, tedd [EMAIL PROTECTED] wrote:

 At 11:23 AM -0500 2/26/07, Dan Shirah wrote:
 Hello all,
 
 I have a page that has multiple submits on it.  One submit is within my
 javascriptfor form checking, the other submit is a button used to
 populate
 all customer information if an order ID is entered.
 
 Problem:  I cannot get the two to coincide at the same time.  They both
 use
 the submit function to send the data to the same page instead of their
 unique individual pages.

 Nothing wrong with putting two forms on the same page and each with
 their own action and submit button.

 You can always add an attribute value (value=1) with each submit
 button so that you can determine later which page to redirect your
 attention.

 tedd
 --
 ---
 http://sperling.com  http://ancientstones.com  http://earthstones.com




Re: [PHP] Multiple Submit

2007-02-26 Thread Jim Lucas

Dan Shirah wrote:

Hello all,

I have a page that has multiple submits on it.  One submit is within my
javascriptfor form checking, the other submit is a button used to populate
all customer information if an order ID is entered.

Problem:  I cannot get the two to coincide at the same time.  They both use
the submit function to send the data to the same page instead of their
unique individual pages.

Code:  Below are the code snipets.


?php echo ?xml version=\1.0\ encoding=\iso-8859-1\?.; ?
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
HEAD
script language=JavaScript
!--

function closeThis() {
if (window.confirm(Are you sure you want to cancel the payment request?))

 this.window.close();
}

*function checkForm() {*

// ** START **
 if (inputForm.cc_phone_number.value == ) {
   alert( Please enter a phone number. );
   inputForm.cc_phone_number.focus();
   return;
 }

  if (inputForm.receipt.value == ) {
   alert( Please select whether or not a receipt was requested. );
   inputForm.phone_number.focus();
   return;
 }

 if (inputForm.cc_first_name.value == ) {
   alert( Please enter a first name. );
   inputForm.cc_first_name.focus();
   return;
 }

 if (inputForm.cc_last_name.value == ) {
   alert( Please enter a last name. );
   inputForm.cc_last_name.focus();
   return;
 }

 if (!(document.inputForm.cc_comments.value ==)) {
 if (document.inputForm.cc_comments.value.length  250)
 {
   alert(The Comments must be less than 250 characters.\nIt is currently 
+ document.inputForm.window_name.value.length +  characters.);
  document.inputForm.window_name.focus();
  return;
 }
}
* document.inputForm.submit();*
}

//--
/script
LINK rel=stylesheet type=text/css href=../../CSS/background.css
/head
body
*form name=inputForm action=save.php method=post
enctype=multipart/form-data*
table align=center border=0 cellpadding=0 cellspacing=0
width=680
tr
   td height=13 align=center class=tblheadstrongCredit Card
Information/strong/td
/tr

*// LOTS OF FORM DATA REMOVED FOR EMAIL LENGTH*

table align=center border=0 cellpadding=0 cellspacing=0
width=680
tr
*This is the other submit that I need to go a page other than the one
specified in the form*
*td width=62a href=DeferredPayment3.phpinput type=submit
name=retrieve value=Retrieve/a/td*
 td width=8/td
/tr
/table
br /
br /
table align=center border=0 cellpadding=0 cellspacing=0
width=680
tr
*Call to the javascript checkForm function*
*td width=64 align=lefta href=javascript:checkForm()
title=SaveSave/a/td
* td width=616 align=lefta href=javascript:closeThis()
title=CloseClose/a/td
/tr
/table
/form
/body
/html

I see a few things now that are wrong with this.  I thought they were 
comments but now that you have explained that it was a nested for, it 
make a little more sense.  You cannot nest forms.


if you want to have the for submitted to a different location, then you 
have to use one form, with function that modify the action value and 
change it to the correct url and then submit the form.


Try this:

form action=original.php method=get onsubmit=return false; 
input type=submit
onclick=  alert(Original:+this.form.action);
this.form.action = 'new.php';
alert(New:+this.form.action);  /
/form



--
Enjoy,

Jim Lucas

Different eyes see different things. Different hearts beat on different 
strings. But there are times for you and me when all such things agree.


- Rush

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Multiple Submit

2007-02-26 Thread Jim Lucas

Dan Shirah wrote:

Okay, I partially figured it out!  YAY!

I only needed to have one form object.

*form name=inputForm action= method=post
enctype=multipart/form-data*

Instead of putting an action in the form, leave it blankand then 
specify

the forms action based on which button is clicked.

*input type=submit name=retrieve value=Retrieve onclick=
this.form.action='CSPayment3.php'; /*

And this will $_POST all your entered values as it should.

Now all I have to figure out is how to have:

*a href=javascript:checkForm() title=SaveSave/a*

Run through all my form checks and then $_POST to my save.php page.



On 2/26/07, Jim Lucas [EMAIL PROTECTED] wrote:


Dan Shirah wrote:
 Hello all,

 I have a page that has multiple submits on it.  One submit is within my
 javascriptfor form checking, the other submit is a button used to
populate
 all customer information if an order ID is entered.

 Problem:  I cannot get the two to coincide at the same time.  They both
use
 the submit function to send the data to the same page instead of their
 unique individual pages.

 Code:  Below are the code snipets.


 ?php echo ?xml version=\1.0\ encoding=\iso-8859-1\?.; ?
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml;
 HEAD
 script language=JavaScript
 !--

 function closeThis() {
 if (window.confirm(Are you sure you want to cancel the payment
request?))

  this.window.close();
 }

 *function checkForm() {*

 // ** START **
  if (inputForm.cc_phone_number.value == ) {
alert( Please enter a phone number. );
inputForm.cc_phone_number.focus();
return;
  }

   if (inputForm.receipt.value == ) {
alert( Please select whether or not a receipt was requested. );
inputForm.phone_number.focus();
return;
  }

  if (inputForm.cc_first_name.value == ) {
alert( Please enter a first name. );
inputForm.cc_first_name.focus();
return;
  }

  if (inputForm.cc_last_name.value == ) {
alert( Please enter a last name. );
inputForm.cc_last_name.focus();
return;
  }

  if (!(document.inputForm.cc_comments.value ==)) {
  if (document.inputForm.cc_comments.value.length  250)
  {
alert(The Comments must be less than 250 characters.\nIt is
currently 
 + document.inputForm.window_name.value.length +  characters.);
   document.inputForm.window_name.focus();
   return;
  }
 }
 * document.inputForm.submit();*
 }

 //--
 /script
 LINK rel=stylesheet type=text/css href=../../CSS/background.css
 /head
 body
 *form name=inputForm action=save.php method=post
 enctype=multipart/form-data*
 table align=center border=0 cellpadding=0 cellspacing=0
 width=680
 tr
td height=13 align=center class=tblheadstrongCredit Card
 Information/strong/td
 /tr

 *// LOTS OF FORM DATA REMOVED FOR EMAIL LENGTH*

 table align=center border=0 cellpadding=0 cellspacing=0
 width=680
 tr
 *This is the other submit that I need to go a page other than the one
 specified in the form*
 *td width=62a href=DeferredPayment3.phpinput type=submit
 name=retrieve value=Retrieve/a/td*
  td width=8/td
 /tr
 /table
 br /
 br /
 table align=center border=0 cellpadding=0 cellspacing=0
 width=680
 tr
 *Call to the javascript checkForm function*
 *td width=64 align=lefta href=javascript:checkForm()
 title=SaveSave/a/td
 * td width=616 align=lefta href=javascript:closeThis()
 title=CloseClose/a/td
 /tr
 /table
 /form
 /body
 /html

I see a few things now that are wrong with this.  I thought they were
comments but now that you have explained that it was a nested for, it
make a little more sense.  You cannot nest forms.

if you want to have the for submitted to a different location, then you
have to use one form, with function that modify the action value and
change it to the correct url and then submit the form.

Try this:

form action=original.php method=get onsubmit=return false; 
input type=submit
   onclick=   alert(Original:+this.form.action);
   this.form.action = 'new.php';
   alert(New:+this.form.action);  /
/form



--
Enjoy,

Jim Lucas

Different eyes see different things. Different hearts beat on different
strings. But there are times for you and me when all such things agree.

- Rush








Change this line:
a href=javascript:checkForm() title=SaveSave/a*
to this
input type=button value=Save /

and then in the form ... tag add: onsubmit=checkForm();

I would also run through your checkForm() function and make sure that it 
is returning true or false always.



--
Enjoy,

Jim Lucas

Different eyes see different things. Different hearts beat on different 
strings. But there are times for you and me when all such things agree.


- Rush

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Image submit with mouse over

2006-07-17 Thread Chris W. Parker
Skip Evans mailto:[EMAIL PROTECTED]
on Friday, July 14, 2006 4:33 PM said:

 My apologies to all. I assumed that JS questions
 would be entertained as the application is within
 a PHP app.

No need to apologize. My off-list email wasn't meant to berate but
merely let you know what the purpose of this list is.

But perhaps we should also field questions about how to repair
motherboards since, after all, PHP runs on servers, and servers use
motherboards. Or how about this one? My can't keeps walking on my
keyboard while I'm trying to write a PHP page. What should I do?


Thank you, you're beautiful. I'll be here all week folks.

Chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Image submit with mouse over

2006-07-17 Thread Chris W. Parker
Chris W. Parker 
on Monday, July 17, 2006 10:23 AM said:

 motherboards. Or how about this one? My can't keeps walking on my
 keyboard while I'm trying to write a PHP page. What should I do?

Okay that should be CAT, not can't.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Image submit with mouse over

2006-07-17 Thread Robert Cummings
On Mon, 2006-07-17 at 13:27, Chris W. Parker wrote:
 Chris W. Parker 
 on Monday, July 17, 2006 10:23 AM said:
 
  motherboards. Or how about this one? My can't keeps walking on my
  keyboard while I'm trying to write a PHP page. What should I do?
 
 Okay that should be CAT, not can't.

So you're recanting the original?



-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Image submit with mouse over

2006-07-17 Thread Skip Evans

Chris W. Parker wrote:

Thank you, you're beautiful. I'll be here all week folks.


You forgot, Enjoy the buffet.
--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Image submit with mouse over

2006-07-17 Thread Jochem Maas
Chris W. Parker wrote:
 Chris W. Parker 
 on Monday, July 17, 2006 10:23 AM said:
 
 motherboards. Or how about this one? My can't keeps walking on my
 keyboard while I'm trying to write a PHP page. What should I do?
 
 Okay that should be CAT, not can't.

I thought the can't walking all over the keyboard was rather Kafka-esque ;-)

 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Image submit with mouse over

2006-07-17 Thread Jay Blanchard
[snip]
I thought the can't walking all over the keyboard was rather
Kafka-esque ;-)
[/snip]

In a rather existential sort of way.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Image submit with mouse over

2006-07-15 Thread Stut
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Skip Evans wrote:
 Brand new to the list, so here's my question. I am  implementing a bunch
 of Dreamweaver templates a designer has built into a PHP app, and one
 thing she did is create a submit button (image) that uses mouse over JS:
 
 a href=user.php?req=login target=_top
 onMouseOver=MM_swapImage('signin','','/theme/images/admin/button_signin2.gif',1)
 onMouseOut=MM_swapImgRestore()img
 src=/theme/images/admin/button_signin.gif alt=Sign In name=signin
 width=86 height=20 border=0/a
 
 But notice this is an href, and it also needs to submit $_POST data
 through a couple of form fields that appear above. So what I tried to do
 in order to be able to retrieve the POST data on the receiving end was
 convert it to the following:
 
 input type=image src=/theme/images/admin/button_signin.gif
 onfocus=MM_swapImage('signin','','/theme/images/admin/button_signin2.gif',1)
 
 onblur=MM_swapImgRestore()
 
 ...However, the onfocus and onblur are not swapping out the images, as I
 had hoped. (Against all odds, maybe I should add.)

Ok, so you've already had the this is not a JS list reply, so I won't
bother with that, but... Have you ever considered the possibility that
onmouseover and onmouseout work in an input element? Have you tried
looking up the purpose of onfocus and onblur which would have told you
it's not what you need?

This has been your RTFM reply. We hope you enjoyed your PHP-General
experience.

- -Stut
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEuL5n2WdB7L+YMm4RAr0oAJ9idoS/qkUF0oKdFasajKu20kNkTACcC1o6
47vilFoD+XJ99AjT6zA96Bo=
=cWJK
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Image submit with mouse over

2006-07-14 Thread Skip Evans

Hi all,

Brand new to the list, so here's my question. I am 
 implementing a bunch of Dreamweaver templates a 
designer has built into a PHP app, and one thing 
she did is create a submit button (image) that 
uses mouse over JS:


a href=user.php?req=login target=_top 
onMouseOver=MM_swapImage('signin','','/theme/images/admin/button_signin2.gif',1) 
onMouseOut=MM_swapImgRestore()img 
src=/theme/images/admin/button_signin.gif 
alt=Sign In name=signin width=86 height=20 
border=0/a


But notice this is an href, and it also needs to 
submit $_POST data through a couple of form fields 
that appear above. So what I tried to do in order 
to be able to retrieve the POST data on the 
receiving end was convert it to the following:


input type=image 
src=/theme/images/admin/button_signin.gif 
onfocus=MM_swapImage('signin','','/theme/images/admin/button_signin2.gif',1)

onblur=MM_swapImgRestore()

...However, the onfocus and onblur are not 
swapping out the images, as I had hoped. (Against 
all odds, maybe I should add.)


I know the client will pout and sniffle if they 
don't get their mouse over affect, so I am hoping 
for a solution.


Any suggestions would be greatly appreciated.

Thanks!
--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Image submit with mouse over

2006-07-14 Thread Skip Evans
My apologies to all. I assumed that JS questions 
would be entertained as the application is within 
a PHP app.


Sorry,
Skip

Chris W. Parker wrote:

Skip Evans mailto:[EMAIL PROTECTED]
on Friday, July 14, 2006 4:13 PM said:



Hi all,



Hey.



Brand new to the list, so here's my question.



[snip]



...However, the onfocus and onblur are not
swapping out the images, as I had hoped. (Against
all odds, maybe I should add.)



[snip]



Any suggestions would be greatly appreciated.



Being new to list is possibly why you're confused. This is a PHP list.
You should look for a Javascript mailing list or web forum.


Good luck!
Chris.




--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Image submit with mouse over

2006-07-14 Thread Tom Rogers
Hi,

Saturday, July 15, 2006, 9:13:04 AM, you wrote:
SE Hi all,

SE Brand new to the list, so here's my question. I am 
SE   implementing a bunch of Dreamweaver templates a 
SE designer has built into a PHP app, and one thing 
SE she did is create a submit button (image) that 
SE uses mouse over JS:

SE a href=user.php?req=login target=_top 
SE 
onMouseOver=MM_swapImage('signin','','/theme/images/admin/button_signin2.gif',1)
SE onMouseOut=MM_swapImgRestore()img 
SE src=/theme/images/admin/button_signin.gif 
SE alt=Sign In name=signin width=86 height=20 
border=0/a

SE But notice this is an href, and it also needs to 
SE submit $_POST data through a couple of form fields 
SE that appear above. So what I tried to do in order 
SE to be able to retrieve the POST data on the 
SE receiving end was convert it to the following:

SE input type=image 
SE src=/theme/images/admin/button_signin.gif 
SE 
onfocus=MM_swapImage('signin','','/theme/images/admin/button_signin2.gif',1)
SE onblur=MM_swapImgRestore()

SE ...However, the onfocus and onblur are not 
SE swapping out the images, as I had hoped. (Against 
SE all odds, maybe I should add.)

SE I know the client will pout and sniffle if they 
SE don't get their mouse over affect, so I am hoping 
SE for a solution.

SE Any suggestions would be greatly appreciated.

SE Thanks!
SE -- 
SE Skip Evans
SE Big Sky Penguin, LLC
SE 61 W Broadway
SE Butte, Montana 59701
SE 406-782-2240


to the href add onClick=formname.submit();return false;

or something like that.

-- 
regards,
Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Submit Form Values To Parent

2005-12-02 Thread Matt Monaco
form  target=_parent is valid just as with any other link.



Shaun [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 How can I get the form values submitted from an iframe where the target is
 the parent window?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Submit Form Values To Parent

2005-12-01 Thread DvDmanDT
Like you do it if the target was the same window? PHP doesn't know which 
window is the target..

-- 

// DvDmanDT
mail: dvdmandt¤telia.com
msn: dvdmandt¤hotmail.com
Shaun [EMAIL PROTECTED] skrev i meddelandet 
news:[EMAIL PROTECTED]
 Hi,

 How can I get the form values submitted from an iframe where the target is 
 the parent window? 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] auto-submit

2004-06-28 Thread Jim Rainville
Hi - 

I'm writing a multi-page php script that keeps track of state with a hidden variable 
in the html forms. It's all working well except I would like to know how to auto 
submit a form and change the state. For example when I'm in state 2 and the user 
enters some data and hits a submit button I want the script to change to state 3 - 
process some data in that state then go back to state 1. I want the transition to go 
back to state 1 without the user having to hit a submit button - i.e. I want the form 
to auto-submit. Is there a way to do this?


Thanks for any help you can give.
Jim

[PHP] Re: Submit button as image

2004-05-12 Thread Justin Patrin
Sam wrote:

What do you do with this?
Submit.x=22Submit.y=13
if($_GET['Submit.x']  0) ???

Is there some smarter way of dealing with an image as a submit button?

input name=Submit type=image value=doesNOTseemTOmatter

Thanks
Well, it comes through as an image map in most browsers. I've found that 
you can't rely on the value of a submit button anyway as it is usually 
possible to just hit enter in a form to submit it, which, in most 
browsers, doesn't send the submit button. Use a hidden or ohter field to 
check for submission.

--
paperCrane Justin Patrin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] using submit button and PHP-HELP

2003-09-22 Thread Angelo Zanetti
Hi,

I have a form that has a submit button in it, when the button is pressed I
want it to reload the same page, with the same URL, however when I click on
the submit button, the URL that it produces is http://whatever.php? then the
name of my submit button = value for example:

form action=?php echo($PHP_SELF); ? type=post


input  type=checkbox value= . $ID .  name=
Request this abstract!
input  type=submit value=Request  name=reqPaper
/form

this gives a URL of:

http://localhost/ebLatest/indpaper.php?reqPaper=Request

instead of the previous URL that was .php?ID=110

What I want to know is why the name and value of the submit button are being
displayed in the URL?
also why doesnt the ?php echo($PHP_SELF); work???

thanx in advance.
Angelo

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] using submit button and PHP-HELP

2003-09-22 Thread Marek Kilimajer
Angelo Zanetti wrote:

Hi,

I have a form that has a submit button in it, when the button is pressed I
want it to reload the same page, with the same URL, however when I click on
the submit button, the URL that it produces is http://whatever.php? then the
name of my submit button = value for example:
form action=?php echo($PHP_SELF); ? type=post
   ^   
register_globals --+   |
use $_SERVER['PHP_SELF'] instead   |
   |
should be method +


input  type=checkbox value= . $ID .  name=
^^^  ^^
where is this variable set? +|
 |
empty name --+
Request this abstract!
input  type=submit value=Request  name=reqPaper
/form
this gives a URL of:

http://localhost/ebLatest/indpaper.php?reqPaper=Request

instead of the previous URL that was .php?ID=110

What I want to know is why the name and value of the submit button are being
displayed in the URL?
Because when the submit button is clicked, the button becomes 
succesfull (official term) and the name/value pair is sent in the request.

also why doesnt the ?php echo($PHP_SELF); work???

thanx in advance.
Angelo
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] using submit button and PHP-HELP

2003-09-22 Thread Angelo Zanetti
thanx for your help, Ive got flu and all these small things seem to be
escaping my eyes. I just want to ask you a small question:

If i want this page to submit to itself and I want to test for it, would I
go about it like this:

?
if (Request == $reqPaper)
{



}
?

if my submit button code looks like this:

input  type=submit  name=reqPaper  value=Request

or is there a better way of testing this?

-Original Message-
From: Mark Walker [mailto:[EMAIL PROTECTED]
Sent: Monday, September 22, 2003 4:54 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] using submit button and PHP-HELP


Hi

You might like to try something like $REQUEST_URI rather than $PHP_SELF, if
you want to keep the existing parameters.  However, in forms, it's better to
redeclare them, so in your case, you'd want to add an input type=hidden
name=ID value=\$ID\

HTH

Mark

- Original Message -
From: Angelo Zanetti [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Sent: Monday, September 22, 2003 4:18 PM
Subject: [PHP] using submit button and PHP-HELP


 Hi,

 I have a form that has a submit button in it, when the button is pressed I
 want it to reload the same page, with the same URL, however when I click
on
 the submit button, the URL that it produces is http://whatever.php? then
the
 name of my submit button = value for example:

 form action=?php echo($PHP_SELF); ? type=post


 input  type=checkbox value= . $ID .  name=
 Request this abstract!
 input  type=submit value=Request  name=reqPaper
 /form

 this gives a URL of:

 http://localhost/ebLatest/indpaper.php?reqPaper=Request

 instead of the previous URL that was .php?ID=110

 What I want to know is why the name and value of the submit button are
being
 displayed in the URL?
 also why doesnt the ?php echo($PHP_SELF); work???

 thanx in advance.
 Angelo

 --
 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] Re: submit button

2003-03-07 Thread Foong
can i have a peek on your diki.php?

I didn't see any attachment.

Foong


Diksha Neel [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 hi everybody,

 i have a PHP script by name registration.php
 in which i have a submit button at the bottom.
 the form in this script is sent to p.php by GET.
 but on clicking the submit button, nothing happens
 attaching registration.php.

 p.php has only the following:
 ?php
 echo hi how are u;
 ?

 please help,
 diksha.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: submit button

2003-03-07 Thread Foong
sorry, I really didn't seen any attachment in any of your post.

can you paste it in your next post?

foong


Diksha Neel [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 hi everybody,

 i have a PHP script by name registration.php
 in which i have a submit button at the bottom.
 the form in this script is sent to p.php by GET.
 but on clicking the submit button, nothing happens
 attaching registration.php.

 p.php has only the following:
 ?php
 echo hi how are u;
 ?

 please help,
 diksha.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: SUBMIT

2003-03-07 Thread Foong
OK sorry i miss this post.

looking at you code.
I guess there are mismatch of opening and closing form tags.

In HTML double slashes // is not a comment. when you do something like
//form
The tag wont get commented
use:
!-- form --
to comment a html tag out side php scope.

Foong



Diksha Neel [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 dear all,

 hi!
 i have a php page by name diki.php which i have pasted below.
 i have removed the irrelevant code because of the size limit of
 the email.
 in this page is a submit button at the end. the form in
 which this button is placed is by get sent to p.php which
 has only the following contents:

 ?php
 echo hi;
 ?

 but when i click on submit button i am not getting
 connected to p.php.
 strange!

 any help would be greatly appreciated.
 thanks!
 best wishes from India.
 diksha.

 html
 head
 meta http-equiv=Content-Type content=text/html;
 charset=windows-1252
 meta name=GENERATOR content=Microsoft FrontPage 4.0
 meta name=ProgId content=FrontPage.Editor.Document
 titleRegistration Form/title
 script language=JavaScript
 function allow()
 {
 if(document.f1.ocity.value!=Others)
 document.f1.city1.blur();
 }
 function allow1()
 {
 if(document.f1.orcity.value!=Others)
 document.f1.rcity1.blur();
 }
 function rallow()
 {
 if(document.f1.ostate.value!=Others)
 document.f1.state1.blur();
 }
 function rallow1()
 {
 if(document.f1.orstate.value!=Others)
 document.f1.rstate1.blur();
 }
 function adjust()
 {
 pbus1=document.f1.pbus.options[document.f1.pbus.selectedIndex].value;
 if(pbus1==accounting)
{
 document.f1.interest1.checked=true;
 }
 if(pbus1==advertising)
{
 document.f1.interest2.checked=true;
 }
 if(pbus1==agriculture)
{
 document.f1.interest3.checked=true;
 }
 if(pbus1==arts)
{
 document.f1.interest4.checked=true;
 }


 }
 function check(na)
 {
  var st=na;st1=st.length;
  for(i=0;ist1;i++)
 {
   if((st.charCodeAt(i)48)||(st.charCodeAt(i)57))
{ return false;
break; }
   }
 }
 function checke(id)
 {
 r1=id; r2=r1.indexOf('@',0);r3=r1.indexOf('.',0);
 r4=r2+1; r6=r1.length -1;
   rlen1=r1.length;
rcont=0;
 rstart=0;
 while(rstartrlen1)
  {
rpos=r1.indexOf(@,rstart);
if(rpos==-1)
  break;
rcont=rcont+1;
rstart=rpos+1;
  }
if(rcont1)
 {
 return false;
 }


 r5=r1.indexOf(null,r6);

if((r1.indexOf('@',1)==-1)||(r2r3)||(r3==r4)||(r3==r6)||(r1.indexOf(@,0)=
=-1)

 ||(r1.indexOf(.,0)==-1))
{ return false;}
 }
 function validation()
 {
 if(document.f1.yname.value==)
 {
  alert(Please enter your
 name);document.f1.yname.focus();return false;
 }
   if(document.f1.cname.value==)
  {
   alert(Please enter company
 name);document.f1.cname.focus();return false;
   }
 if(document.f1.cat.value==- -Select a Category- -)
 {
  alert(Please select Category );document.f1.cat.focus();
 return false;
  }
 if(document.f1.pbus.value==- -Select Primary Business- -)
 {
  alert(Please select Primary Business
 );document.f1.pbus.focus();return

 false;
  }
   if(document.f1.bemail.value==)
   {
 alert(Please enter business
 email);document.f1.bemail.focus();return

 false;
   }
   else
 {
  cbemail=checke(document.f1.bemail.value);
   if(cbemail==false)
   {
   alert(Enter correct Business  Email

 Address);document.f1.bemail.focus();return false;
 }
  }
 if(document.f1.pemail.value==)
{
alert(Please enter personal
 email);document.f1.pemail.focus();return

 false;
}
 else
   {
cpemail=checke(document.f1.pemail.value);
if(cpemail==false)
  {
  alert(Enter correct Personal Email

 Address);document.f1.pemail.focus();return false;
   }
  }
 if(document.f1.pass.value==)
{
 alert(Please enter
 password);document.f1.pass.focus();return false;
}
else
   {
  if(document.f1.pass.value.length4)
{
   alert(Password should contain 4

 characters);document.f1.pass.focus();return false;
  }
 }
 if(document.f1.badd1.value==)
 {
   alert(Please enter business
 address);document.f1.badd1.focus(); return

 false;
   }
 if(document.f1.area.value==)
 {
  alert(Please enter Area); document.f1.area.focus();return
 false;
  }
 if(document.f1.ocity.value==- -Select a City- -)
 {
  alert(Please select a City ); document.f1.ocity.focus();
 return false;
  }
 if(document.f1.ostate.value==- -Select a State- -)
 {
  alert(Please select a State ); document.f1.ostate.focus();
 return false;
  }


 if(document.f1.ocity.value!=Others)
   document.f1.city.value=document.f1.ocity.value;
 else
document.f1.city.value=document.f1.city1.value;

 if(document.f1.orcity.value!=Others)

[PHP] form submit oddities?

2003-03-04 Thread Ray
i have posted the question to phpMyAdmin user list already and after talking 
with someone about my problem, it looks like its not in the phpMyAdmin, but 
in my settings for php, but they seemed to have no clue as to what.

anyways, with a clean install of phpMyAdmin 2.4.0 we can't query the database 
through any form that has a file upload

when we disable file upload totally it works (minus the file uploading)

i tacked
echo pre;
print_r(get_defined_vars());
echo /pre;
at the begining of the file that the form submits to and when the form has 
enctype=multipart/form-data in it
the page outputs

Array
(
[HTTP_POST_VARS] = Array
(
)

[_POST] = Array
(
)

[HTTP_GET_VARS] = Array
(
)

[_GET] = Array
(
)

at the top, and when there isn't the enctype attribute on the form tag 
there is post information available.

Array
(
[HTTP_RAW_POST_DATA] = 
is_js_confirmed=0lang=en-iso-8859-1server=5db=mysqltable=dbpos=0goto=tbl_properties.phpzero_rows=Your+SQL-query+has+been+executed+successfullyprev_sql_query=dummy=Hostsql_query=SELECT+*+FROM+%60db%60+WHERE+1show_query=1sql_file=sql_file_compression=text%2FplainSQL=Go
[HTTP_POST_VARS] = Array
(
[is_js_confirmed] = 0
[lang] = en-iso-8859-1
[server] = 5
[db] = mysql
[table] = db
[pos] = 0
[goto] = tbl_properties.php
[zero_rows] = Your SQL-query has been executed successfully
[prev_sql_query] = 
[dummy] = Host
[sql_query] = SELECT * FROM `db` WHERE 1
[show_query] = 1
[sql_file] = 
[sql_file_compression] = text/plain
[SQL] = Go
)

[_POST] = Array
(
[is_js_confirmed] = 0
[lang] = en-iso-8859-1
[server] = 5
[db] = mysql
[table] = db
[pos] = 0
[goto] = tbl_properties.php
[zero_rows] = Your SQL-query has been executed successfully
[prev_sql_query] = 
[dummy] = Host
[sql_query] = SELECT * FROM `db` WHERE 1
[show_query] = 1
[sql_file] = 
[sql_file_compression] = text/plain
[SQL] = Go
)

[HTTP_GET_VARS] = Array
(
)

[_GET] = Array
(
)


server: win2k, apache 1.3.27, php 4.2.2

clients: 
linux galeon
winxp ie6
win2k ie5  

so, what is most likely wrong with my config/setup?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Get variable from PHP before submit

2003-03-02 Thread Lars Espelid
I could use anchor's like shown underneath, but then the user will have to
click the link Last position each time a button is submitted. I would like
the page to scroll down automatically. Is that possible, to have the link
executed without clicking help from the user?

body onLoad=mScroll()
?php echo p Ykoordinat:  . $yKoord . p;
echo Teller:  . $teller;
?
a href=#form?php echo $teller; ? target=_self Last position /a
!-- *New line --
?php
for($i=0; $i150; $i++) {
 echo 'br';
}
for($teller=0; $teller2; $teller++) {
?
 a name=form?php echo $teller; ?/a
!-- *New line --
 form action=test3.php name=form?php echo $teller; ? onsubmit=return
hentKoordinat()
  input type=hidden name=teller value=?php echo $teller; ?
  input type=hidden name=yKoord
  input name=button1 type=submit value=Send input
 /form
 ?php $teller++; ?
?php
} //for($teller=0; $i2; $i++) {
?
/body


Rich Gray [EMAIL PROTECTED] skrev i melding
news:[EMAIL PROTECTED]
  I'm trying to implement the following functionality into the file
  test.php:
 
  When I scroll down the page and then hit a button, the page
  should remember
  the scrolled position, refresh the page and then scroll down to the
  remembered position. I've almost managed to make this work, but
  only almost.
 
  The first time I click one of the buttons, the page won't scroll,
  but after
  that it works fine. I think the reason for this is that the function
  hentKoordinat() gets called before $teller is set. hentKoordinat() uses
  $teller.
 
  Anyone know a way to make this work?
 
  Thanks alot!
 
  Lars

 I've probably misunderstood but can you not use an HTML anchor...?
 Rich




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Get variable from PHP before submit

2003-03-02 Thread Lars Espelid
Hope this will help your gamma-epsilon-psycho telepathy beamer :-)

 When someone hits a button in one of the form-schemas the following
happens:
1) hentKoordinat() is executed. The form-schemas hidden field named yKoord
gets the value: the amunt of pixels scrolled in y-direction.
2)the page is refreshed and $teller is set to a number whisch says which
form is submitted and $yKoord is set to the amunt of pixels scrolled in
y-direction.
3)onload in body calls the function mScroll which scrolls the page to where
it was when someone clicked the button.

Tried to explain the code:

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
http://www.w3.org/TR/html4/loose.dtd;
html
head
titleUntitled Document/title
script language=JavaScript type=text/javascript
!--

function getPageScroll(){

//this function returns scrollX and scrollY as probertys of
getPageScroll. ScrollX and scrollY
//contains the amount of pixels the page has been scrolled in x and y
direction.

var X, Y;
if(typeof window.pageXOffset == 'number'){
X = window.pageXOffset;
Y = window.pageYOffset;
}else{
if((window.document.compatMode)
  (window.document.compatMode == 'CSS1Compat')){
X = window.document.documentElement.scrollLeft;
Y = window.document.documentElement.scrollTop;
}else{
X = window.document.body.scrollLeft;
Y = window.document.body.scrollTop;
}
}
return {scrollX:X,scrollY:Y};
}
function hentKoordinat() {

// this function uses getPageScroll() to find pixels scrolled in y-direction
and inserts this value into the hidden-form-value named yKoord in the form
schema which holds the button clicked (form?php echo $teller; ?).


 //*Here the problem arises. The first time you click a button, $teller
is not set. This method is executed before the page is refreshed. The value
$teller is set when the page is refreshed.*

document.form?php echo $teller; ?.yKoord.value = getPageScroll().scrollY
}

function mScroll() {

//this function scrolls the page so many pixels that $yKoord holds in the
y-direction.
//to avoid error messages I set $yKoord like 0 if it is empty (scrolls
nothing).

 ?php if(!isset($yKoord)) $yKoord=0; ?
 ?php if($yKoord=='') $yKoord=0; ?
 self.scrollTo(0,?php echo $yKoord; ?)
}

//--
/script
/head

body onLoad=mScroll()
?php echo p Ykoordinat:  . $yKoord . p;
echo Teller:  . $teller;

for($i=0; $i150; $i++) {
//prints 150 line breaks so that the page gets scrollable (the content does
not fit the monitor-area)
 echo 'br';
}
for($teller=0; $teller2; $teller++) {
//prints two form-schemas. Later on I will print a varying amount of
form-schemas (depends on the amunt of
//data in a MySQL-table)
//The form name includes $teller so that each form-schema gets a unike name
and I know which
//$yKoord to update in hentKoordinat(). $teller and $yKoord is passed on as
variables when the page refreshes,
//so that I know which form's button1 is submitted and how many pixels there
are to scroll when onload=mScroll()
// in body is called (uses $yKoord).
?
 form action=test.php name=form?php echo $teller; ? onsubmit=return
hentKoordinat()
  input type=hidden name=teller value=?php echo $teller; ?
  input type=hidden name=yKoord
  input name=button1 type=submit value=Send input
 /form
 ?php $teller++; ?
?php
} //for($teller=0; $i2; $i++) {
?
/body
/html


Chris Hayes [EMAIL PROTECTED] skrev i melding
news:[EMAIL PROTECTED]
 I am putting my gamma-epsilon-psycho telepathy beamer to the maximum but
 there are too many coders inbetween us, i cannot receive you.

 Please give a little hint on what these functions are and what value comes
 from where and goes where.

 At 04:00 1-3-2003, you wrote:
 I'm trying to implement the following functionality into the file
test.php:
 
 When I scroll down the page and then hit a button, the page should
remember
 the scrolled position, refresh the page and then scroll down to the
 remembered position. I've almost managed to make this work, but only
almost.
 
 The first time I click one of the buttons, the page won't scroll, but
after
 that it works fine. I think the reason for this is that the function
 hentKoordinat() gets called before $teller is set. hentKoordinat() uses
 $teller.
 
 Anyone know a way to make this work?
 
 Thanks alot!
 
 Lars
 
 
 File test.php:
 
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
 http://www.w3.org/TR/html4/loose.dtd;
 ?php echo 
 
 Ykoordinat:  . $yKoord . 
 
 ; echo Teller:  . $teller; for($i=0; $i150; $i++) { echo '
 '; } for($teller=0; $teller2; $teller++) { ? ?php $teller++; ?
?php }
 //for($teller=0; $i2; $i++) { ?
 
 
 --
 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] Get variable from PHP before submit

2003-03-01 Thread Chris Hayes
I am putting my gamma-epsilon-psycho telepathy beamer to the maximum but 
there are too many coders inbetween us, i cannot receive you.

Please give a little hint on what these functions are and what value comes 
from where and goes where.

At 04:00 1-3-2003, you wrote:
I'm trying to implement the following functionality into the file test.php:

When I scroll down the page and then hit a button, the page should remember
the scrolled position, refresh the page and then scroll down to the
remembered position. I've almost managed to make this work, but only almost.
The first time I click one of the buttons, the page won't scroll, but after
that it works fine. I think the reason for this is that the function
hentKoordinat() gets called before $teller is set. hentKoordinat() uses
$teller.
Anyone know a way to make this work?

Thanks alot!

Lars

File test.php:

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
http://www.w3.org/TR/html4/loose.dtd;
?php echo 
Ykoordinat:  . $yKoord . 

; echo Teller:  . $teller; for($i=0; $i150; $i++) { echo '
'; } for($teller=0; $teller2; $teller++) { ? ?php $teller++; ? ?php } 
//for($teller=0; $i2; $i++) { ?

--
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] Get variable from PHP before submit

2003-03-01 Thread Rich Gray
 I'm trying to implement the following functionality into the file 
 test.php:
 
 When I scroll down the page and then hit a button, the page 
 should remember
 the scrolled position, refresh the page and then scroll down to the
 remembered position. I've almost managed to make this work, but 
 only almost.
 
 The first time I click one of the buttons, the page won't scroll, 
 but after
 that it works fine. I think the reason for this is that the function
 hentKoordinat() gets called before $teller is set. hentKoordinat() uses
 $teller.
 
 Anyone know a way to make this work?
 
 Thanks alot!
 
 Lars

I've probably misunderstood but can you not use an HTML anchor...?
Rich


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Get variable from PHP before submit

2003-02-28 Thread Lars Espelid
I'm trying to implement the following functionality into the file test.php:

When I scroll down the page and then hit a button, the page should remember
the scrolled position, refresh the page and then scroll down to the
remembered position. I've almost managed to make this work, but only almost.

The first time I click one of the buttons, the page won't scroll, but after
that it works fine. I think the reason for this is that the function
hentKoordinat() gets called before $teller is set. hentKoordinat() uses
$teller.

Anyone know a way to make this work?

Thanks alot!

Lars


File test.php:

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
http://www.w3.org/TR/html4/loose.dtd;
html
head
titleUntitled Document/title
script language=JavaScript type=text/javascript
!--

function getPageScroll(){
var X, Y;
if(typeof window.pageXOffset == 'number'){
X = window.pageXOffset;
Y = window.pageYOffset;
}else{
if((window.document.compatMode)
  (window.document.compatMode == 'CSS1Compat')){
X = window.document.documentElement.scrollLeft;
Y = window.document.documentElement.scrollTop;
}else{
X = window.document.body.scrollLeft;
Y = window.document.body.scrollTop;
}
}
return {scrollX:X,scrollY:Y};
}
function hentKoordinat()
{
?php
 //*Here the problem arises. The first time you click a button $teller
is not set.*
document.form?php echo $teller; ?.yKoord.value = getPageScroll().scrollY
}
function mScroll() {
 ?php if(!isset($yKoord)) $yKoord=0; ?
 ?php if($yKoord=='') $yKoord=0; ?
 self.scrollTo(0,?php echo $yKoord; ?)
}

//--
/script
/head

body onLoad=mScroll()
?php echo p Ykoordinat:  . $yKoord . p;
echo Teller:  . $teller;

for($i=0; $i150; $i++) {
 echo 'br';
}
for($teller=0; $teller2; $teller++) {
?
 form action=test.php name=form?php echo $teller; ? onsubmit=return
hentKoordinat()
  input type=hidden name=teller value=?php echo $teller; ?
  input type=hidden name=yKoord
  input name=button1 type=submit value=Send input
 /form
 ?php $teller++; ?
?php
} //for($teller=0; $i2; $i++) {
?
/body
/html



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Submit buttons

2003-02-25 Thread Oliver Witt
Greg schrieb:

 Is there any way that I can have a form submit to different pages depending
 on the submit button that is pressed?  Thanks!

dont use submit buttons, but buttons... (type=button) calling a script that
submits the form to whatever page you want it to.
Olli


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Submit buttons

2003-02-25 Thread Greg
I'm horrible at javascript, does anyone have a script that will do this?
Thanks again!!

Oliver Witt [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Greg schrieb:

  Is there any way that I can have a form submit to different pages
depending
  on the submit button that is pressed?  Thanks!

 dont use submit buttons, but buttons... (type=button) calling a script
that
 submits the form to whatever page you want it to.
 Olli




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: Submit buttons

2003-02-25 Thread Bryan Lipscy
HTML:
input type=button value=Text Displayed name=ButtonName
onclick=DoThis()

JS:
Function DoThis(){
frmMain.method = POST;
frmMain.action = admin.php;
frmMain.submit();
}

Where frmMain is the name for the FORM:
form name=frmMain

Read all about it in: http://www.oreilly.com/catalog/jscript4/

Bryan

-Original Message-
From: Greg [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 25, 2003 12:22 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Submit buttons


I'm horrible at javascript, does anyone have a script that will do this?
Thanks again!!

Oliver Witt [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Greg schrieb:

  Is there any way that I can have a form submit to different pages
depending
  on the submit button that is pressed?  Thanks!

 dont use submit buttons, but buttons... (type=button) calling a 
 script
that
 submits the form to whatever page you want it to.
 Olli




-- 
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] Re: Submit Form

2003-01-09 Thread DreamRiver

Steven (cc list),
The sticky part is: ---User comes back next day, clicks load

For that functionality you will need to remember the user, the last project they were 
using and the form they were 'on'. How? 

You can have the user log in to their last saved state (which you will save when they 
log out), or set cookies on their machine or ... either way you need a unique way to 
identify the user, their work and their last form. 

When you decide how to maintain/save this 'state' information then your work is laid 
out for you ...

You can also see some commented and working code for db inserts, cookies, logins, 
prefilling form data fields, javascript form validation etc. - what you refer to - by 
downloading a FREE application called phpyellow Lite Edition here:

http://www.dreamriver.com/phpcheckout/showcase.php?productnumber=1

After unzipping take a look at loginResult.php which may have some code you will need. 
You can skip the install and go right to the code, because a working demo of the code 
is here:
http://phpyellow.com/phpyellow/index.php

This won't answer all your questions, but at least it's a start... the key decision 
you need to make is how you will save your 'state' information.

richard.
http://www.dreamriver.com

Stephen wrote:
__
Message-ID: 001101c2b762$b8624080$0200a8c0@melchior
From: Stephen [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Date: Wed, 8 Jan 2003 17:10:13 -0500
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary==_NextPart_000_000D_01C2B738.CEFB1C10
Subject: Submit Form

Hello,

I have a question. First of all, I want to save the data a user has typed in a form 
into a MySQL database so they can load it up for later use but, I need to first submit 
all the form vars on the current page from a link. This may be Javascript, but either 
way, I'm not sure how to do it. Any ideas? Here's a graph kinda...

-User enters form and submits the first page
--User taken to second form
---User fills out the first two fields
User clicks a Save Progress link and all form fields submitted
(I can do beyond this part but just so you get the idea of what I mean)
-PHP saves current form vars to a MySQL database
--User told information saved and he leaves
---User comes back next day, clicks load
User select his current project
-User taken to the last form he was on, fields filled in

Thanks,
Stephen Craton
http://www.melchior.us

What's the point in appearance if your true love, doesn't care about it? -- 
http://www.melchior.us
_




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] image submit buttons

2002-11-04 Thread John Meyer
(isset($_POST[Submit])) is this the way to check a submission image to see
if it's been set?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] image submit buttons

2002-11-04 Thread John W. Holmes
 (isset($_POST[Submit])) is this the way to check a submission image
to
 see
 if it's been set?

Nope. Try the manual:

IMAGE SUBMIT variable names
When submitting a form, it is possible to use an image instead of the
standard submit button with a tag like: 

input type=image src=image.gif name=sub
 
When the user clicks somewhere on the image, the accompanying form will
be transmitted to the server with two additional variables, sub_x and
sub_y. These contain the coordinates of the user click within the image.
The experienced may note that the actual variable names sent by the
browser contains a period rather than an underscore, but PHP converts
the period to an underscore automatically.

So you'll have $_POST['Submit_x'] and $_POST['Submit_y'] and you can
check for either to see if the image was clicked.

---John Holmes...



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] two submit buttons redirecting to two scripts

2002-10-14 Thread Sonal Patel

Hello,

I am very new to this group.

I have a very simple question.
Please look at this form,
http://antriksh.com/resources/2_submit_button_form.shtml

here I want to change the echo statement in the script action.php to 
redirect it to another script.

ie, I want to change the form action dynamically.  How can I modify 
this form to do so?

I tried few PHP tricks that did not work for me.  So I am asking this 
questions to anyone who may be able to help.

Thank you ,
Sonal


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Getting PHP to submit a form to google

2002-08-16 Thread lallous

by simple ways, you can do that:

$query = urlencode(your query string)
$result_string = join('', file(http://www.google.com/search?q=$query));


Elias

Henry [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi all

 I would like to be able to get the result of a search from google. Namely
I
 would like to write a PHP script that will generate and submit a form
 (internally i.e. on the server) using the GET method to
 http://www.google.com/search setting the field q to the search words. It
 should then parse the results so that I can feed them back to the user in
a
 form that I choose.

 How should/can I go about this?

 TIA.

 Henry.





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Re: Getting PHP to submit a form to google

2002-08-16 Thread Michael Geier

a more OO approach might be to use the Snoopy PHP class
(http://snoopy.sourceforge.net)

This will allow you to do GET/POST method requests on
URLS with query variables, ie:

POST
$snoopy = new Snoopy;
$submit_vars[q] = [ form variables ];
$submit_url   = http://www.google.com/search;;

$snoopy-submit($submit_url,$submit_vars);
$result = $snoopy-results;

GET
$snoopy = new Snoopy;
$submit_url   = http://www.google.com/search?q=;.[ form variables ];

$snoopy-fetch($submit_url);
  $result = $snoopy-results;   

Then simply parse through $result;

 -Original Message-
 From: lallous [mailto:[EMAIL PROTECTED]]
 Sent: Friday, August 16, 2002 4:24 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: Getting PHP to submit a form to google
 
 
 by simple ways, you can do that:
 
 $query = urlencode(your query string)
 $result_string = join('', file(http://www.google.com/search?q=$query));
 
 
 Elias
 
 Henry [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi all
 
  I would like to be able to get the result of a search from 
 google. Namely
 I
  would like to write a PHP script that will generate and submit a form
  (internally i.e. on the server) using the GET method to
  http://www.google.com/search setting the field q to the 
 search words. It
  should then parse the results so that I can feed them back to 
 the user in
 a
  form that I choose.
 
  How should/can I go about this?
 
  TIA.
 
  Henry.
 
 
 
 
 
 -- 
 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] Getting PHP to submit a form to google

2002-08-15 Thread Henry

Hi all

I would like to be able to get the result of a search from google. Namely I
would like to write a PHP script that will generate and submit a form
(internally i.e. on the server) using the GET method to
http://www.google.com/search setting the field q to the search words. It
should then parse the results so that I can feed them back to the user in a
form that I choose.

How should/can I go about this?

TIA.

Henry.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Getting PHP to submit a form to google

2002-08-15 Thread David Piasecki

Use the google API...
http://www.google.com/apis/


- David


-Original Message-
From: Henry [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 15, 2002 12:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Getting PHP to submit a form to google

Hi all

I would like to be able to get the result of a search from google.
Namely I
would like to write a PHP script that will generate and submit a form
(internally i.e. on the server) using the GET method to
http://www.google.com/search setting the field q to the search words.
It
should then parse the results so that I can feed them back to the user
in a
form that I choose.

How should/can I go about this?

TIA.

Henry.



-- 
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] Re: Submit code

2002-07-16 Thread Martin Thoma

 I am looking for PHP code that will submit (post) a form automaically to a
 ANOTHER php page.  I do not want to press a submit button.  I have found a
 class at PHPClasses but it is too complicated for my needs.  What is the
 simplest way of doing this?  What is the theoretical approach?

I think the only way to submit a form automatically is with JavaScript.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Submit code

2002-07-16 Thread Kondwani Spike Mkandawire

Algorithmically:

//in php
1)  create a counter that will keep count of the # of variables that have
 been set
2)  if all your variables have been set spit out the relevant JavaScript
 that runs the AutoSubmit function...  (There are a couple onLine)...
...

It can follow the following Skeleton...
if((isset($var1))(isset($var2))
echo The JavaScript...  Could Taget write it to another file as
opposed to spitting out HTML run the function onLoad..

Mindhunter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I am looking for PHP code that will submit (post) a form automaically to a
 ANOTHER php page.  I do not want to press a submit button.  I have found a
 class at PHPClasses but it is too complicated for my needs.  What is the
 simplest way of doing this?  What is the theoretical approach?

 The reason I need this is that I have a table output from a database after
 one submits 'n list of variables (form inputs).  I want to update a graph
in
 another Iframe automatically without clicking on another submit button.

 Tx
 MH





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Submit code

2002-07-16 Thread Lee Doolan



here's an excerpt from a script in which I do something like that:

$pdArgs=
 demo= . urlencode($argAry['demo']) .  .
 first_name= . urlencode($argAry['first_name']) .  .
 last_name= . urlencode($argAry['last_name']) .  .

   [. . .]


$URL= https://HOST.DOMAIN/SCRIPT.php;;
exec(/usr/bin/curl -m 120 -d \$pdArgs\ $URL -L, $httpResponse, $exitCode);
if ($exitCode != 0) {
header (Location: error.php?code= . urlencode(https: failure.  Exit code is 
$exitCode));
exit;
}

--
When the birdcage is open,   | donate to causes I care about:
the selfish bird flies away, |http://svcs.affero.net/rm.php?r=leed_25
but the virtuous one stays.  |

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] auto submit

2002-04-03 Thread Martin Kampherbeek

Is the folowing possible to do?

I fill in a form and press submit.
Then I read a record from a database. With this data it submits to the read submits 
url. After 10 seconds, it reads the next record and submits that data. etc etc

So I don't have to push submit each time I want to submit. After 10 seconds it read 
the next record and submits again.

Could this be done? So yes, how?





Re: [PHP] auto submit

2002-04-03 Thread heinisch

At 03.04.2002  11:22, you wrote:

Is the folowing possible to do?

I fill in a form and press submit.
Then I read a record from a database. With this data it submits to the 
read submits url. After 10 seconds, it reads the next record and submits 
that data. etc etc

So I don't have to push submit each time I want to submit. After 10 
seconds it read the next record and submits again.

Could this be done? So yes, how?


You can do this, if your clients browser has JavaScript enabled.
Then you could use JavaScript - www.javascript.com.

And again, PHP is on your server and is not able to push something to your 
client
except he/she asked for it (that´s why you have to use JavaScript).

To get your page refreshed (thi only askes about a new copy of your page)
you could use header() or a metatag  like
meta http-equiv=refresh content=10; URL=yourpage
You can place this meta anywhere in your code (BUT that´s not html-conform, 
but works on the main
browsers, (don´t know about NS 6 and mozilla))
HTH Oliver


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] auto submit

2002-04-03 Thread Maxim Maletsky

Yes,
An idea I'd love to throw up here would be not letting the user know
you're spying him:

Make a Java Script function (yes, you will need JavaScript for that)
that has timeout every 10 seconds. Use JS unction escape() and read the
field values of your form assigning them to the JS variables after what,
load a graphic with the JS vars passed in the IMG SRC link each 10
seconds passed.

Your graphic will actually be a PHP script that records the data and
does all kind of grows things, yet outputs just some silly image
headers. This sway user has no clue (or almost) that what he's typing in
your form you're already being collecting, even so he pressed no submit
buttons yet.

I made an intranet editor that had this failure-free feature similar to
MS Word.


Sincerely,

Maxim Maletsky
Founder, Chief Developer

PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com



 -Original Message-
 From: Martin Kampherbeek [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 03, 2002 11:23 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] auto submit
 
 Is the folowing possible to do?
 
 I fill in a form and press submit.
 Then I read a record from a database. With this data it submits to the
read submits
 url. After 10 seconds, it reads the next record and submits that data.
etc etc
 
 So I don't have to push submit each time I want to submit. After 10
seconds it read
 the next record and submits again.
 
 Could this be done? So yes, how?
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: pass javascript variable to php without submit or reload

2001-11-12 Thread Mike Harvey

If you are trying to collect things like monitor size or other user data you
could try putting the JS in the head and then put a meta refresh tag with
time period of 0. I haven't actually tried this but it might work.

--
 Mike
~~~
   MICHAEL R. HARVEY Sculptor
   Web Creation - http://vestudiohost.com
   Internet Business Tools - http://ibiz-tools.com
   Sculpture, Craft, Jewelry - http://sculpture-by-mrh.com
http://jewelry-by-mrh.com http://craft-by-mrh.com
   New Product Innovations and Development. Ph: 845-279-8295
Phieu Huynh [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...

 script language=javascript
 function changebuilding (which) {
  sel_var = which.selectedIndex
  ?
$sql_query = select distinct room
  from general.room_info
  where building='$variable' group by level asc;

$sql_result = mysql_query($sql_query) or die ( Can't execute the
 query);

$i=0;
while ($row = mysql_fetch_array($result_sec_level))
  print (ar[.$i++.] = \.$row[0].\;\n);
  ?
 for (i=0; i  ar.length; i++) {
 option = new Option(ar[i])
 document.myform.room.options[i]=option
}
 }
 /script
 body
 form name=myform
 Building :   select name=building onchange=changebuilding(this) 
  option1/option
 option2/option
   option3/option
  /select
 Room :   select name=room 
  /select
 /form
 /body


 I can pass the variable in building to $variable by submit button
 but I want to pass the sel_var variable to $variable and dynamic update
 the content in room.

 --

 phil



-- 
PHP General 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] Multiple SUBMIT Buttons and Default

2001-11-08 Thread Tom Rogers

Hi
I use java script like this:
head
script language=javascript
function highlight() {
 document.options.continue.focus();
}
/script
/head
body onload=highlight()
form name=options action=whatever.php method=post
input type=submit name=cancel value=Cancel
input type =submit name=continue value=Continue
/form
/body


Tom


At 07:51 AM 9/11/01, Jason Caldwell wrote:
On some of my forms I have multiple Submit buttons;

for example
Button1 = Cancel, and
Button2 = Continue

Is there a way to make one of them the *default* button so that when a user
presses their Return / Enter Key, *that default* button will be processed?

Thanks.
Jason
[EMAIL PROTECTED]



--
PHP General 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 General 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] Newbie! Submit Form needs reload the page to show results the first time]

2001-10-01 Thread Karina Gómez Salgado


Hi all, please help me with this problem i'm desperate...

I have a problem with form submits.

I have an access control form that my users fill to enter to a private
web page, this access page saves 2 session variables and shows the
result page that it's an php page with several queries to several
tables. Well, when i submit my access control form, i get a blank page,
if i check the source code in the browser, it shows Data missing...
form post operation.. bla bla, so i need to reload the web page for
showing the correct  query results.

This is very inconvenient for my users, Any help will be greatly
appreciated.

Thanks..

Please Help.

Karina Gomez




-- 
PHP General 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 General 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 General 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] multiple submit buttons

2001-08-29 Thread Justin French

Hi all,

I noticed this chunk of code in a site the other day:

input type=Submit name=btn value=Yes
input type=Submit name=btn value=No


My GUESS is that if i click the Yes button, I magically 
get $btn = Yes as a var is the receieving PHP script.  
I was just about to test this, when I realised that (from 
what I can tell) multiple submits are not supported by CGI 
spec.

So, even if it works on my browser/platform/server/php 
combination, can I be sure it'll work faithfully on all 
environments?

Should I be worried about what the browser sends, or what 
PHP does with it, etc etc?


Has anyone doen some serious testing on this?  Good or bad 
stories?


Justin French

-- 
PHP General 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] Re: submit form problem

2001-08-12 Thread Inércia Sensorial

  I haven't found a way to disable the Enter key to submit the form, as I
believe it does exists, but, found a way so when Enter is pressed works like
Tab, moving to the next form field.

  Here:

http://www.faqts.com/knowledge_base/view.phtml/aid/6793/fid/129

  Google search used:

http://www.google.com/search?q=javascript+disable+enter+formsourceid=opera;
num=0

  Sadly, it is Javascript, so an user can disable, but for those mistake key
presses, should work.

--


  Julio Nobrega.

2B||!BB - That's the question.

Ivo Stoykov [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 Well, here's the problem I faced.

 I've a script accepting four different forms depending on the user choice.
 Some of the forms have two submit buttons forcking actions accordingly to
 the pressed button.

 The problem is: $HTTP_POST_VARS[submit] is not set if the user press
ENTER
 instead of clicking the button and the scripts cannot return a response
for
 it is not clear which button has been pressed.

 Hidden field cannot works with two submit buttons for I'll have two
values,
 but again cannot cach the user choice in case of ENTER press.

 Any help? Thank you

 Ivo





-- 
PHP General 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] Re: submit form problem

2001-08-12 Thread Richard Lynch

 I've a script accepting four different forms depending on the user choice.
 Some of the forms have two submit buttons forcking actions accordingly to
 the pressed button.

 The problem is: $HTTP_POST_VARS[submit] is not set if the user press
ENTER
 instead of clicking the button and the scripts cannot return a response
for
 it is not clear which button has been pressed.

 Hidden field cannot works with two submit buttons for I'll have two
values,
 but again cannot cach the user choice in case of ENTER press.

Either explicitly state a default action, or analyze the actual data
coming in to decide what the user must have meant.

I *thought* enter was only supposed to work in a text field when there's
only one SUBMIT...  But it wouldn't shock me if some browser broke that.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General 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] if(!$submit)

2001-08-07 Thread Tarrant Costelloe

When using if (!$submit)  I get an error saying:
Warning: Undefined variable: submit in C:\Inetpub\webpub\default.php on line
1
Fair enough, so then I add if (isset(!$submit)) and I then get an error;
Parse error: parse error, expecting `T_VARIABLE' or `'$'' 
Could someone please tell me the more than likely simple sollution.

Thanks

Taz

-- 
PHP General 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] if(!$submit)

2001-08-07 Thread Wagner Tomy

 Fair enough, so then I add if (isset(!$submit)) and I then get an error;
   
try

  if(!isset($submit))

instead

Tomy Wagner
Web Developer
Editus S.A.
- Original Message -
From: Tarrant Costelloe [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 07, 2001 4:47 PM
Subject: [PHP] if(!$submit)


 When using if (!$submit)  I get an error saying:
 Warning: Undefined variable: submit in C:\Inetpub\webpub\default.php on
line
 1
 Fair enough, so then I add if (isset(!$submit)) and I then get an error;
 Parse error: parse error, expecting `T_VARIABLE' or `'$''
 Could someone please tell me the more than likely simple sollution.

 Thanks

 Taz

 --
 PHP General 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 General 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] if(!$submit)

2001-08-07 Thread Chris Cocuzzo

try.

if(isset($submit))
{
}

chris


- Original Message -
From: Tarrant Costelloe [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 07, 2001 10:47 AM
Subject: [PHP] if(!$submit)


 When using if (!$submit)  I get an error saying:
 Warning: Undefined variable: submit in C:\Inetpub\webpub\default.php on
line
 1
 Fair enough, so then I add if (isset(!$submit)) and I then get an error;
 Parse error: parse error, expecting `T_VARIABLE' or `'$''
 Could someone please tell me the more than likely simple sollution.

 Thanks

 Taz

 --
 PHP General 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 General 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] if(!$submit)

2001-08-07 Thread mike cullerton

if (!isset($submit))

:)

on 8/7/01 8:47 AM, Tarrant Costelloe at [EMAIL PROTECTED] wrote:

 When using if (!$submit)  I get an error saying:
 Warning: Undefined variable: submit in C:\Inetpub\webpub\default.php on line
 1
 Fair enough, so then I add if (isset(!$submit)) and I then get an error;
 Parse error: parse error, expecting `T_VARIABLE' or `'$''
 Could someone please tell me the more than likely simple sollution.
 
 Thanks
 
 Taz


-- mike cullerton



-- 
PHP General 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] Auto submit form, How?

2001-06-30 Thread Fates

How do I auto load or auto submit a form on the same page?  I don't want
to have to press the submit button instead just click on a value in the
drop down form and it loads (I am lazy).  

Using php4.something

--
This email was sent using w3mail.


-- 
PHP General 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] Auto submit form, How?

2001-06-30 Thread Peter Dudley

http://www.devguru.com/Technologies/ecmascript/quickref/select.html

Javascript.  Use onBlur or onChange and call document.formname.submit().

Pete.

Fates [EMAIL PROTECTED] wrote in message
20010629125135.ELXV13240.femail10.sdc1.sfba.home.com@localhost">news:20010629125135.ELXV13240.femail10.sdc1.sfba.home.com@localhost...
 How do I auto load or auto submit a form on the same page?  I don't want
 to have to press the submit button instead just click on a value in the
 drop down form and it loads (I am lazy).

 Using php4.something

 --
 This email was sent using w3mail.


 --
 PHP General 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 General 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] Auto submit form

2001-06-30 Thread David

How do I autoload a selection from a drop down menu form based on the
selection without having to click a submit button?




-- 
PHP General 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] Auto submit form

2001-06-30 Thread Justin French

David wrote:

 How do I autoload a selection from a drop down menu form based on the
 selection without having to click a submit button?

Everything to do with forms is either to do with hitting a submit button
(call to a server) or without (which means that the browser/client is
handling it), so anything you want to do (like auto-submits, dynamic
pop-ups, etc etc) is done via the browser -- Javascript would be the
obvious one.

I Suggest looking at onChange and onBlur attributes of FORM elements
for more info.


As per usual, you'll probably be able to learn quite a bit by looking at
the HTML/JavaScript source code of a page that already does it.


It's not really PHP related, try to think of it as a HTML / browser /
client side issue.  Also, be aware that you shoudl still prolly include
a submit button, so that people with stone age browsers, or worse still,
javascript turned off, can still submit the form and use your site.


I saw an e-commerce site once that ignored this basic little rule, thus
preventing sales to those without javascript.  I don't think any online
store is doing well enough yet to start excluding customers :)


Justin French
Creative Director
Indent.com.au

-- 
PHP General 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] Auto submit form, How?

2001-06-30 Thread Henrik Hansen

Fates [EMAIL PROTECTED] wrote:

  How do I auto load or auto submit a form on the same page?  I don't want
  to have to press the submit button instead just click on a value in the
  drop down form and it loads (I am lazy).  
  

use javascript, to find you answer look here

http://www.developer.irt.org/script/script.htm

-- 
Henrik Hansen


-- 
PHP General 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] if $submit

2001-05-21 Thread Tarrant Costelloe

Whenever I use  the ? if ($submit) ? statement in a php page it always
comes up with:

Warning: Undefined variable
Until the submit has been hit, and then it continue on with the rest of the
script fine ( ifelse).

How do you stop this warning message?

Thanks in advance!

Tarrant Costelloe
Web Developer
InsurE-com Ltd.

Office Tel:  +44 (0)1273 852014
Mobile: +44 07714087114
[EMAIL PROTECTED]
http://www.insur-e.net


-- 
PHP General 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] if $submit

2001-05-21 Thread Sandeep Hundal

i always use such statements like :

if ($submit) { then do this }

else { render the page

}

and it works fine...
-Original Message-
From: Tarrant Costelloe [mailto:[EMAIL PROTECTED]]
Sent: 21 May 2001 15:16
To: Php (E-mail)
Subject: [PHP] if $submit


Whenever I use  the ? if ($submit) ? statement in a php page it always
comes up with:

Warning: Undefined variable
Until the submit has been hit, and then it continue on with the rest of the
script fine ( ifelse).

How do you stop this warning message?

Thanks in advance!

Tarrant Costelloe
Web Developer
InsurE-com Ltd.

Office Tel:  +44 (0)1273 852014
Mobile: +44 07714087114
[EMAIL PROTECTED]
http://www.insur-e.net


-- 
PHP General 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 General 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] if $submit

2001-05-21 Thread Plutarck

error_reporting (E_ALL ^ E_NOTICE);

http://www.php.net/manual/en/function.error-reporting.php

I personally change my php.ini setting to:

error_reporting  =  E_ALL  ~E_NOTICE

Then at the top of my scripts which I want to debug I add the line:

error_reporting(E_ALL);



Plutarck

Tarrant Costelloe [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Whenever I use  the ? if ($submit) ? statement in a php page it always
 comes up with:

 Warning: Undefined variable
 Until the submit has been hit, and then it continue on with the rest of
the
 script fine ( ifelse).

 How do you stop this warning message?

 Thanks in advance!

 Tarrant Costelloe
 Web Developer
 InsurE-com Ltd.
 
 Office Tel:  +44 (0)1273 852014
 Mobile: +44 07714087114
 [EMAIL PROTECTED]
 http://www.insur-e.net


 --
 PHP General 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 General 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] if $submit

2001-05-21 Thread Plutarck

For the sake of completeness, whenever PHP encounters a reference to a
variable which has not been set it will throw a warning.

The reason most people don't see that behavior is that their version of PHP
uses the default setting of show all errors but don't mention the
warnings. If they use:

error_reporting(E_ALL);

...they'll probably see a whole bunch of ugly little warnings. Useful for
debugging, annoying as all heck for production code.


Plutarck

Tarrant Costelloe [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Whenever I use  the ? if ($submit) ? statement in a php page it always
 comes up with:

 Warning: Undefined variable
 Until the submit has been hit, and then it continue on with the rest of
the
 script fine ( ifelse).

 How do you stop this warning message?

 Thanks in advance!

 Tarrant Costelloe
 Web Developer
 InsurE-com Ltd.
 
 Office Tel:  +44 (0)1273 852014
 Mobile: +44 07714087114
 [EMAIL PROTECTED]
 http://www.insur-e.net


 --
 PHP General 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 General 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] if $submit

2001-05-21 Thread Markus Fischer

On Mon, May 21, 2001 at 03:15:37PM +0100, Tarrant Costelloe wrote : 
 Whenever I use  the ? if ($submit) ? statement in a php page it always
 comes up with:
 
 Warning: Undefined variable
 Until the submit has been hit, and then it continue on with the rest of the
 script fine ( ifelse).
 
 How do you stop this warning message?

1) set new error level: error_reporting( E_ALL ^ E_NOTICE);

2) use isset()

if( isset( $submit)) { ...

3) or use @ in front of the variable

if( @$submit) { ...

- Markus

-- 
PHP General 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] If (!$submit)

2001-05-17 Thread Tarrant Costelloe

When using:

?php if (!$submit)
{
// First html page containing login form
}
else
{
// Results of login form, including login failed or successful print()
}
?

I get an error on line one, due to it at first not recognising the variable
$submit. If I ignore this and continue to fill in the form, on the clicking
the submit button I am then delivered to the same page of which it shows the
results.

So the only problem being, is when you first go to the page you get:

Warning: Undefined variable: submit in C:\Documents and Settings\Tarrant
Costelloe\Desktop\locahost\default.php on line 1

then the form, on which being filled in and submitted brings you back to the
page without the message and a print() of whether login successful or not.
How do I get rid of the original error?

Tarrant Costelloe
Web Developer
InsurE-com Ltd.

Office Tel:  +44 (0)1273 852014
Mobile: +44 07714087114
[EMAIL PROTECTED]
http://www.insur-e.net


-- 
PHP General 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] If (!$submit)

2001-05-17 Thread bill

Two suggestions:

Use

if (!isset($submit))

OR

change the order around

?php

if ($submit)
{
// Results of login form, including login failed or successful print()
}
else
{
// First html page containing login form
}

?

kind regards,

bill hollett


Tarrant Costelloe wrote:

 When using:

 ?php if (!$submit)
 {
 // First html page containing login form
 }
 else
 {
 // Results of login form, including login failed or successful print()
 }
 ?

 I get an error on line one, due to it at first not recognising the variable
 $submit. If I ignore this and continue to fill in the form, on the clicking
 the submit button I am then delivered to the same page of which it shows the
 results.

 So the only problem being, is when you first go to the page you get:

 Warning: Undefined variable: submit in C:\Documents and Settings\Tarrant
 Costelloe\Desktop\locahost\default.php on line 1

 then the form, on which being filled in and submitted brings you back to the
 page without the message and a print() of whether login successful or not.
 How do I get rid of the original error?

 Tarrant Costelloe
 Web Developer
 InsurE-com Ltd.
 
 Office Tel:  +44 (0)1273 852014
 Mobile: +44 07714087114
 [EMAIL PROTECTED]
 http://www.insur-e.net

 --
 PHP General 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 General 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] If (!$submit)

2001-05-17 Thread Plutarck

The reason you're getting the undefined variable warning level is because
your error reporting level which is set in php.ini or explicitly in your
code is set to spit out warning, so you'll want to change that before doing
anything other than just testing.


Plutarck

Tarrant Costelloe [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 When using:

 ?php if (!$submit)
 {
 // First html page containing login form
 }
 else
 {
 // Results of login form, including login failed or successful print()
 }
 ?

 I get an error on line one, due to it at first not recognising the
variable
 $submit. If I ignore this and continue to fill in the form, on the
clicking
 the submit button I am then delivered to the same page of which it shows
the
 results.

 So the only problem being, is when you first go to the page you get:

 Warning: Undefined variable: submit in C:\Documents and Settings\Tarrant
 Costelloe\Desktop\locahost\default.php on line 1

 then the form, on which being filled in and submitted brings you back to
the
 page without the message and a print() of whether login successful or not.
 How do I get rid of the original error?

 Tarrant Costelloe
 Web Developer
 InsurE-com Ltd.
 
 Office Tel:  +44 (0)1273 852014
 Mobile: +44 07714087114
 [EMAIL PROTECTED]
 http://www.insur-e.net


 --
 PHP General 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 General 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]