Jump to content

form submission help


Ismz

Recommended Posts

Thanks alot dave, but the problem i am having is with the redirecting part, in the html it submits the info to orderform.php, but after i hit the submit button it goes to the orderform.php page that is blank and had the default message on it, i want it to stay on the website but show a specific thank you message in one table on that page here is the php script and part of html im using

 

Html code

<form method="post" action="orderform.php">

<input type="hidden" name="recipient" value="123@yoursite">

<input type="hidden" name="subject" value="Online Survey...!!!!!!!">

<input type="hidden" name="redirect" value="http://www.yoursite.com/thankyou.html">

 

and this is the php script

 

FormMail.php v5.0

Copyright 2000-2004 Ai Graphics and Joe Lumbroso © All rights reserved.

Created 07/06/2000  Last Modified 10/28/2003

Joseph Lumbroso, http://www.aigraphics.com, http://www.dtheatre.com

http://www.dtheatre.com/scripts/

 

I tried posting the script here but it says i dont have permission to access index.php on this server  ???

Link to comment
Share on other sites

Please clarify what you are trying to achieve. Are you trying to make it so that when they submit the form it processes the query but shows a different page?

 

Basically this is what is happening:

 

(Your Page With Forms) -- User Submits ---> (orderform.php)

 

orderform.php then processes the form data using whatever PHP you have coded into it. If you want it to display a message you can do a simple:

 

print( "My Message!" ); or echo( "My Message!" ); on the form before or after the data. Alternatively, if you want to process the data then display another page you can do:

 

header( "location: myPage.php" );

 

The above will then redirect your page to myPage.php (providing you've not displayed any messages using print; or echo;. If you have printed any text from the PHP script you will receive a header error)

Link to comment
Share on other sites

Hmmm, i am using that php script i got online, what im trying to do is have the php script submit the form info to an email and then after that i want it to redirect the to a thank you message right there on the same page they submitted the info from. does that makes sense?

Link to comment
Share on other sites

ok i've been doing some reading on a google search, and it seems like i forgot to mention i am using an html page with the redirect command, the thing is the html page submits the form info to a php file which send that info to an email. i am also using the same orderform.php for more than form page, do i need to make multiple ordrform php pages for each html page with a form on it? i am so lost here  ???

Link to comment
Share on other sites

Hi Ismz,

 

You dont need a unique orderform.php from what I can see.  Although the script you have will not give you what you want - it seems it expects a redirect page as you supply in the hidden fields which after finishing processing and sending of the data it redirects to the page designated.

 

If you want to be able to display messages on the original form that the user fills in you will have to make that form a .php file its self so you can handle the requests and build the page dynamically.

 

Try building the page from scratch rather than using that script - it would be a lot easier.

 

Dave

 

 

Link to comment
Share on other sites

yea i kinda figured it was something along that line, thing is dave i really dont know php, and the pages on my site are all html i just found that php script n thought id give it a go, are u suggesting that i make my html pages in php? and in that case would each page be redirected after the form submits its info to the email?

Link to comment
Share on other sites

Yes it should redirect to the page you specify in the hidden fields (if that is not working that is an issue with the script itself!)

 

If your site is big it could be a big re-write - depends how badly you want that info on the same page as the form..

 

you can do it 2 ways as i see it..

 

1)  Form.html -> orderform.php -> static redirect.html (can have as many of these as you need). You dont get info on same page

 

2)  Form.php -> orderform.php -> form.php (handle response from orderform.php to build dynamic response). Big rewrite?!?

 

If you choose the php route then just google php forms or something of that nature its not overly complicated.

 

Good Luck!

 

Dave

 

 

 

 

Link to comment
Share on other sites

Thanks alot for your time dave i really appreciate it, lets say i wanna go with the static redirect.html what do u mean by i can have as many of these as i can? i have only 3 or 4 forms on the site total, and what do u mean i dont get info on the same page?

Link to comment
Share on other sites

No worries,

 

From the way the script works it takes its redirect page from the form itself so for example if you had

 

Form 1 =  Registration form

Hidden redirect = "reg_form_redirect.html"

 

Form 2 =  Forum form

Hidden redirect = "forum_form_redirect.html"

 

Form 3 =  Misc Form

Hidden redirect = "misc_redirect.html"

 

That way you can tailor what the website returns after a certain form is submitted.  Still you dont get your update on the same page deal though!

 

Dave

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.