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
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
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
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
Share on other sites

so the only way to open a pHp script inside a Div on a Page is ajax: I just find that kind of strange to I can launch a php script from a link but we can not get that script to Load inside a div with out Ajax.. Thank you  :'(

Link to comment
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
Share on other sites

ajax isn't a scripting language, it stands for 'asynchronous JavaScript and XML' and incorporates languages (javascript being the primary) to complete asynchronous calls.

 

Try researching it using a javascript framework like jQuery, very easy.

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.