Adding URL to Results Page in Script

Links for php scripts

Moderators: macek, egami, gesf

Post Reply
seandisanti
php-forum Fan User
php-forum Fan User
Posts: 973
Joined: Mon Oct 01, 2012 12:32 pm

Re: Adding URL to Results Page in Script

Post by seandisanti » Thu Mar 28, 2013 11:04 pm

make sure you're urlencoding your titles, so that you don't include invalid characters like spaces etc. magic_quotes is deprecated and even removed since 5.3 i believe. mysql_ functions are also a poor choice, but i'm trying to avoid slipping into another pdo rant. (but seriously http://jream.com/learning/videos/php-oo ... o-examples check it out).

<?php echo $row_searchresult['producturl']; ?> IS a dynamic url if you mean how do you turn it into a link; that's done by using anchor tags and link text, like...

Code: Select all

<?php
echo '<a href="' . $row_searchresult['domain'] . '/' . $row_searchresult['producturl'] . '">Click here to download ' . $row_searchresult['description'] . '</a>';
 

seandisanti
php-forum Fan User
php-forum Fan User
Posts: 973
Joined: Mon Oct 01, 2012 12:32 pm

Re: Adding URL to Results Page in Script

Post by seandisanti » Tue Apr 09, 2013 9:53 pm

The line that I wrote would generate text formatted the same way, but have your markup echo'd out instead of embedding php into your markup. It's 6 of one, half dozen of the other, but I typically go with echo'd markup instead of embedded php because of 1) the file extension 2) my php files do a lot more on the programming side than they do on the markup side.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests