Solved

Hidden frame used to process form data

Posted on 2006-11-27
3
204 Views
Last Modified: 2010-04-06
Hi there

I am using a hidden frame to run a PHP page that processes some of the data on the page.

It works perfectly with firefox (and i used firefox to design an test it) but now when its live, I realise that this does not work with Explorer. When I click the button in explorer, it just does nothing. I made the frame bigger to see if the php was actually been sent there when I clicked the button, it does when Im using firefox, but not when Im using explorer.

As the system is already live, i would appreciate it if we could solve this quickly, so any ideas appreciated.

Thanks in advance

the frame:
<iframe id="hiddenframe" width="0" height="0"></iframe>

the button:
<td class="input_label"></td><td align="left"><input type = "button" value = "Email Smoothie" onclick="EmailSmoothie(<?=$myrow['id']?>)"></td>

the script:
function EmailSmoothie(contactid) {

  var name=confirm("Are you sure you want to email this Smoothie?")
            
  if (name==true)
  {
      hiddenframe.src = "email_contact.php?contactid=" + contactid;
  }
  else
  {
      return false;
  }


}

and finally, the PHP:
<?
include('connect.php');
$sql = "UPDATE contact set packageStatus = 4 where id = ".$contactid;
$result = mysql_query($sql) or die(mysql_error());
echo "done";
?>
0
Comment
Question by:AndriesKeun
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 500 total points
ID: 18018808
EITHER use
window.frames["hiddenframe"].location="email_contact.php?contactid=" + contactid;

and add NAME="hiddenframe" to the iframe
OR use the DOM:
document.getElementById('hiddenframe").src="email_contact.php?contactid=" + contactid;

0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 18018815
0
 

Author Comment

by:AndriesKeun
ID: 18018997
it works. thanks, really appreciate it.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now