Form Submit Problem

As I mentioned before, you’re showing two files.

Confused !?!? How am I showing two files ??

The link you have at the top goes to /construction/construction_site_G.php

However, when you submit the form, it goes to /construction/construction_sited.php

The HTML code you are showing is for construction_sited.php (I’m guessing). However, that page just reloads itself. construction_site_G.php also goes to construction_sited.php.

What is the file name that you got your PHP from?

The link you have at the top goes to /construction/construction_site_G.php

However, when you submit the form, it goes to /construction/construction_sited.php

The HTML code you are showing is for construction_sited.php (I’m guessing). However, that page just reloads itself. construction_site_G.php also goes to construction_sited.php.

Ahh I see now :slight_smile: It’s Fixed :slight_smile: Now the page just reloads back to the form, nothing is displaying that the form was sent.

Okay, good.

Now, the second part: the file you gave us has no PHP. If it’s going to load itself, that PHP needs to be in the form file.

Put the PHP code you posted at the very top of the HTML file you posted, save that, upload it, and test it again.

Some more progress was made, as it’s now looking for a HTML thank you page :slight_smile: I’m assuming I place this HTML page within a nested DIV or how can I have it be loaded on the same ID ?

I’d like the page to show the thank you page for 3-4 seconds then redirect to another ID on the same page.

You don’t need to change anything else in your construction page now.

Create a separate file called thank-you.html and put it in the same folder as your construction file.

If you want it to redirect, add:


<meta http-equiv="refresh" content="4;url=http://www.mysite.com/mypage.html">

somewhere within the <head></head> elements on the thank-you.html page. Then replace 4 with the number of seconds you want to wait, and replace the URL with the URL of the page you want to redirect to.

If I wanted to place the thank-you.html within a ID I assume the code would be as follows:

<meta http-equiv=“refresh” content="4;.thankyou>

Page Updated ! Causing Error!

Not quite.

The page you go to for the thank you is specified in your PHP, specifically this line:


Location('thank-you.html');

If you want to go to a different page, change that URL.

If you want to go to your thank-you page and then redirect to another, you’d set that page in your meta redirect. You need the whole filename (preferably including the domain).

How come the page doesn’t load, odd ?

There is no way to have the thankyou page load within a class?

There is, but it’s much easier to put it in a separate file…

I want it within a class within an ID on my page, but stumped on how it works. When I create the class the page doesn’t load. I created a class called .thankyou with a simple H1 tag.

The thing you put in your meta is the FILE it’s in.

How is the server going to know which class it is on your server if it doesn’t know where to look?

Also, you can’t reference a class like that, only IDs.

The thing you put in your meta is the FILE it’s in.

I know the HTML file is in the meta !?!?

How is the server going to know which class it is on your server if it doesn’t know where to look?

The class is on the same page ?

Also, you can’t reference a class like that, only IDs.

Oh ok I’ll change it to an ID.

Change the class to an ID and you can add #id-name at the end of HTML in the refresh, so you get something like:
http://www.mysite.com/mypage.html#my-id

It worked, but it didn’t load within the ID I specified.

Sam, adding the ID after the HTML is not working in the Location ?

header('Location: thank-you.html#Contact');

Does it redirect you to the page at all?

Are you sure the ID is set on what you are trying to go to (and that it’s not a class or something)?

It redirects me to the HTML page but it doesn’t place the HTML page within the ID which is correctly placed !