Reputation: 363
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
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>
<font>
, use css insteadUpvotes: 2