Sujit Tiwari
Sujit Tiwari

Reputation: 363

loading external pages within website

I have a table in database which stores links submitted by users, I want my users to use those links whenever they want but the problem i am facing is I can retrive and display the links with this code

<td width="560"><font color="#999">
<a href="'.$row['link'].'?action=tagtoload"  class="tagToload">'.$row['link'].'</a>
</font>
</td>

but it generates link like this

http://XYZ.com/www.pxleyes.com/blog/2011/12/these-50-photos-will-blow-you-away/?action=tagtoload so when the users click on this links it says page not found.

I want to open the links within my page so i have added ?action=tagtoload which will load pages within my page with ajax call but the things are not working.

yes XYZ.com is my domain and for not generated links xyz.com/abc?action=tagtoload is working fine. its coming just below top header i want all external links to be below my header. can you please tell how i can open these links under my header. I want to display these links as anchored link so that user can see what these items are and when users clicks on these links it should open in iframe or whatever but under my header –

Upvotes: 1

Views: 147

Answers (1)

Johannes Staehlin
Johannes Staehlin

Reputation: 3720

Guessing that XYZ.com stands for your domain:

add http:// for external links

Concerning the ajax-Problem: Is it working with fixed, not generated links? Please post also the output of the php file and your ajax-code.

Please also define 'in you page': In an iframe? div? replacing your window?

EDIT:

To 'fix' you 'php-code':

<td width="560">
 <font color="#999">
<a href="<?php print $row['link'] ?>?action=tagtoload"  class="tagToload">
  <?php print $row['link'] ?></a>
</font>
</td>
  1. Please get familiar with html and php first.
  2. do NOT use <font>, use css instead
  3. use css instead of putting the width in the td as an attribute
  4. read http://php.net/

Upvotes: 2

Related Questions