Solved

Hidden frame used to process form data

Posted on 2006-11-27
3
202 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

708 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

12 Experts available now in Live!

Get 1:1 Help Now