Jump to content
Larry Ullman's Book Forums
Paul

$_Post Form Action Not Loading Correct File

Recommended Posts

Hi everyone,
Hope you're all well. Have a look at the following seemingly very straightforward code from a file called 'orders/customer_details.php'.

<form action="customer_details.php" method="post" />

<input type="hidden" value="TRUE" name="submitted" />

<input type="submit" value="Place your order" />
</form>

Unless I've been misunderstanding for years when I click on 'Place your order' the page should direct to 'customer_details.php' (itself) where there will eventually be other form fields, validation etc.

 

However it redirects to 'orders/basket.php'. I have no idea why? I've looked through every line of code in 'customer_details.php' and the only time the word basket is mentioned is in comments or HTML. There is no redirection code to 'basket.php'. There is  file called 'basket/basket.php' but it's in a seperate directory to this redirection which is to orders/basket.php.

 

I've tried everything I can think off. I've deleted the file and typed everything in manually. I've copied the code through Notepad in case there's anything odd in the bckground. I've bypassed Dreamweaver (because sometimes that has a mind of its own) and ran the url manually through XAMPP. Nothing seems to work. I can't believe something so easy doesn't work. I've loads of other forms on this site with exactly the same code and they work. Bizarre.

 

Any help would be greatly appreciated before I go crackers!

 

Cheers

Paul

 

Share this post


Link to post
Share on other sites

Hi again,

Ignore this post, I've worked it out.

 

I was looking for redirects but what I've just noticed is that I've left some form action code on one of the include files that should have been deleted. Delete it and it works OK. Learnt something today.

 

My apologies for bothering everyone.

 

Cheers

Paul

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...

×
×
  • Create New...