/    Sign up×
Community /Pin to ProfileBookmark

php product tracker/enquiry – clear form?

Hi
I have a great php script which adds selected products to a tracker.php form whilst a visitor browses the site. Once they are ready, they click on ‘prepare to send’ and the collected info is sent to an enquiry.php page where they complete their contact details and send the form.

All works fine, except when using this with IE7, after submitting an enquiry – if you then go back in to enquire about other products – ie, start from scratch again – the previous products enquired about are still in the form (even after submitting).

This is clearly a form_clear problem… but it doesn’t happen in Firefox/Safari and I wondered if anyone has any idea what I need to add/change in the code to get IE to clear down properly?

The code in the tracker.php is this:

[CODE]<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);

session_start();

if (get_magic_quotes_gpc()) {
foreach ($_POST as $k => $v)
$_POST[$k] = stripslashes($v);

foreach ($_GET as $k => $v)
$_GET[$k] = stripslashes($v);
}

// “Clear Enquiry”
if ($_GET[‘clear’] != ”) {
$_SESSION[‘mk_enquiry’] = “”;
session_write_close();
?>[/CODE]

NB: this is just the code from the top of the page – if I posted it all here it would go on forever…. almost ?

Help?!
LP

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@lochgoOct 14.2008 — Make sure IE is not storing form data. I don't think this is a code issue. For example, I couldn't figure out why one page I had written kept displaying the password when I wasn't populating the field. Took me a while to realize that I had told FF to save the password for the page.
Copy linkTweet thisAlerts:
@LouPhiauthorOct 15.2008 — Hmmmm... I don't think that's it. I have another almost identical feature on another website, which DOES clear the form down after submitting (in ALL browsers), admittedly its on a different platform than the one i'm having problems with... the OK one is on a Microsoft 2003 server, the problem one is on a Linux.... Could this be it??
×

Success!

Help @LouPhi spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...