Jump to content

Open php in DiV


r2ks

Recommended Posts

<div id="example">
<a href="pl_user.php" target="_self">click here</a>
</div>

i think before you start using CSS you should revise your HTML knowledge because.. target="test" doesn`t exist target can be _blank, _parent, _self, _top and if i do remember quite well(it`s been a long time since i`ve read the manual i think you will find there a reference about framesets.

If you don`t have a manual you should use this one HTML Manual

 

P.S this topic should be in HTML Help Area.

Link to comment
https://forums.phpfreaks.com/topic/161311-open-php-in-div/#findComment-851217
Share on other sites

i think before you start using CSS you should revise your HTML knowledge because.. target="test" doesn`t exist target can be _blank, _parent, _self, _top and if i do remember quite well(it`s been a long time since i`ve read the manual i think you will find there a reference about framesets.

If you don`t have a manual you should use this one HTML Manual

 

First let me start by saying Thank you :) and yes i know test is not a Valid Target ?? it is not a Html Question i dont think ??

Ok I have a Menu on a PHP form in the Menu i have a Place called Users you can Click. i would Like that to excute pl_user.php in a div under the Menu instead it Open i new Window. (The test in the Target was the Div Called Test) 

P.S i did try this <div id="example">

<a href="pl_user.php" target="_self">click here</a>

</div>

and it Opened up i new page outside not in the example div

 

Link to comment
https://forums.phpfreaks.com/topic/161311-open-php-in-div/#findComment-851221
Share on other sites

Thank you every one for you posts to help me (asynchronously ) is not what i want to do.. Let me explain this way

<div id="example">
<?php include "pl_user.php" ?>

</div>

this works it Loads the PHP pl_user.php but on load of the Page.

 

if i have ( Click on ME ) how would i load the pl_user.php in the example div from a link ?? Thank everyone

Link to comment
https://forums.phpfreaks.com/topic/161311-open-php-in-div/#findComment-851231
Share on other sites

Hi,

 

gevans is right, the only way to reload a div is through ajax:

 

Javascript for simple ajax

function createRequestObject() { 
  var ro; 
  var browser = navigator.appName; 
  if(browser == "Microsoft Internet Explorer"){ 
    ro = new ActiveXObject("Microsoft.XMLHTTP"); 
  }else{ 
    ro = new XMLHttpRequest(); 
  } 
  return ro; 
} 
var http = createRequestObject(); 
var returnDiv 
function sndReq(divRet,file) { 
  var date = new Date();
  var timestamp = date.getTime();
  returnDiv = divRet; 
  http.open('get', file+'&time='+timestamp); 
  http.onreadystatechange = handleResponse; 
  http.send(null); 
} 
function handleResponse() { 
  if(http.readyState == 4){ 
    var response = http.responseText; 
    document.getElementById(returnDiv).innerHTML = response; 
  } 
}

 

to call this use

<a href="javascript:sndReq('example',p1_user.php&<?= rand(10000,99999); ?>">Click Here</a>

 

The only other way I know is with iframe redirection.

 

:)

Link to comment
https://forums.phpfreaks.com/topic/161311-open-php-in-div/#findComment-851234
Share on other sites

You cannot load it inside a div on a page asynchronously without ajax. If you just wanted it there from the start that's fine. Or if you were willing for a page refresh that's fine. But php is a server side script and requires communication with the server, this cannot happen with a page refresh, or an asynchronous call, via ajax.

Link to comment
https://forums.phpfreaks.com/topic/161311-open-php-in-div/#findComment-851263
Share on other sites

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.