Jump to content

iframe update sql data base


didgydont

Recommended Posts

hi i am building a iframe home page for online links basicly what i want is to make it so when the i frame changes it tells the data base so i can make a add this page button i have tried this

in php

<iframe name='theframe' width='100%' height='100%' src='http://www.google.com' onload=\"UpdURL(this.value)\"></iframe>

 

and made a js file with this

function UpdURL(str)
{
var url="doedit.php"
url=url+"?lasturl="+str
url=url+"&sid="+Math.random()
}

 

it doesnt seem to be going to the doedit.php in background and i did alert for str and it said undefiened

any ideas ?

Link to comment
https://forums.phpfreaks.com/topic/129079-iframe-update-sql-data-base/
Share on other sites

no i got it updating but cant get iframe url does not look possible

var xmlHttp

function UpdURL(str)
{
if (str.length==0)
  { 
  document.getElementById("txtHint").innerHTML=""
  return
  }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  } 
var url="doedit.php"
url=url+"?lasturl="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChanged() 
{ 
if (xmlHttp.readyState==3 || xmlHttp.readyState=="complete")
{ 

} 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
}
return xmlHttp;
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.