close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Confirm Page - Security?

Thread began 2/15/2010 2:05 pm by codamedia | Last modified 2/15/2010 3:14 pm by codamedia | 529 views | 1 replies |

codamedia

Confirm Page - Security?

The confirmation page is acting rather strangely, and I cannot trace the problem.

Here is my scenerio.

1: My confirm page simply drops the data in a database, no payment gateway at this time.
2: By the time I reach my confirm page, I have a couple of GET Variables in the URL.
3: Confirm submits to "PHP Self" which strips the GET Variables - I still need those :)
4: I replace the "PHP Self" with the appropriate "REQUEST_URI" which now retains all the GET variables. It submits to itself, but with the GET variables in tact.

HOWEVER - now the page will just land back on "confirm.php?blah=blah" but won't process the database insert(s) and won't redirect when done (likely because it doesn't finish successfully).

After looking at the code, I cannot figure out what is stopping it from processing. Is there some security added to this page, like checking for the PHP Self or something? I'm at a loss and any help would be appreciated.

EDIT 1/2 hour later - I believe the problem is in this line:

if (($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST)) // Trigger



Since I am posting to "REQUEST URI" rather than "SELF" I have even tried to change that line to:

if (($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"])) > 0) && isset($_POST)) // Trigger



But I still cannot get it to process!

Sign in to reply to this post

codamedia

Yes - that line of code was causing the problem. Both SELF and REQUEST_URI include the file name that is being called. I always hide the file name when it is index!

EG: If my URL was
"http://www.mysite.com/?page=confirm"

The requests were adding the file name so they looked like:
"http://www.mysite.com/index.php?page=confirm"

Since the matches were not being made - the page would not continue.
Easy fix for me. I'm not a fan or securing a page by referer in the first place, so I put my own custom check in place to act as the trigger. Works like a charm.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...