php- auto submitForm?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
coolin
Forum Newbie
Posts: 21
Joined: Sun Mar 16, 2008 1:44 pm

php- auto submitForm?

Post by coolin »

I am trying to make a php application submit a form from within a script & have tried as following code shows but am just getting a blank page afterwards

Code: Select all

 
$this->body .="<br /><input type=\"submit\" name=\"z\" ";
//$this->body .= 
"onclick=\"return checksubmit(this)\"";
// added here//
if($amount==0)return submitForm;
// added end//  
(I've also tried adding- if($amount==0)return submitForm(); but this gives an unexpected Tvariable message & then- if($amount==0) $this->body .="return submitForm()\n"; this allows the script to carry on but makes no difference)
Any ideas as to how to go please would be much appreciated
anto91
Forum Commoner
Posts: 58
Joined: Mon Mar 10, 2008 10:59 am
Location: Sweden

Re: php- auto submitForm?

Post by anto91 »

Have you added a form tag with an action & method attribute
coolin
Forum Newbie
Posts: 21
Joined: Sun Mar 16, 2008 1:44 pm

Re: php- auto submitForm?

Post by coolin »

Thanks, yep it's all part of a large application, this being a user's final approval form , I've found it reads as:

Code: Select all

    $this->body .= "<form onsubmit=\"this.z.disabled=true\" action=\"";
            $this->body .= $this->db->get_site_setting('classifieds_file_name')."?a=1&b=final_accepted\" method=\"post\">\n";
       
Post Reply