1

I'm writing an app to grab pictures from social networks. How can I add make sure that when the user clicks the links, the output (which consists of the grabbed pictures) is displayed in the same page?

I wrote separate php files for each of them, and they all go to separate pages. I want to put them on the same page. How can I run the php files in the same page?

<a href="#" class="show_hide" rel="#slidingDiv">View</a>
<br /> 
<div id="slidingDiv"> 
    <a href="/Gravatar/gravindex.php">Gravatar</a> 
</div>
4
  • 1
    keep them in different divs, and just show the div you want to without hiding the exisiting ones Commented Apr 11, 2013 at 6:29
  • 1
    try $.ajax(), $.get(), .load() from jquery, whichever suits you. or you can use <?php incude() ?>, includeOnce, requireOnce etc. Commented Apr 11, 2013 at 6:30
  • @Deepanshu, i'm using a jquery plugin which has the following code in the html page. <a href="#" class="show_hide" rel="#slidingDiv">View</a><br /> <div id="slidingDiv"> <a href="/Gravatar/gravindex.php">Gravatar</a> </div> Where should my gravatar php be linked? Commented Apr 11, 2013 at 6:34
  • post your jquery code you are using Commented Apr 11, 2013 at 6:45

1 Answer 1

1

That depeneds on the link not to php. if you use target="_self" it will be open in the same page

Sign up to request clarification or add additional context in comments.

3 Comments

okay, so if i use target="_self" in <a> tag then will the link open in the same page? without a refresh.
It will be opened in the same page but you need a refresh. otherwise you have to use jquery and ajax if you want no refresh at all
also you don't put it, by default "_self" will be used.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.