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
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;
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.