Jump to content

Recommended Posts

How do I mod this to make the website and email address links on the page

$query= 'SELECT Venue_Logo, Venue_Name, Venue_Show_Time, Venue_Show_Time, Host, Host_Email, Venue_Address, Venue_City, Venue_Email, Venue_Phone, Venue_Website FROM VenueUploads ORDER BY Venue_Show_Time ASC LIMIT 0, 100';

$result = mysql_query($query) or die(mysql_error());

while($row = mysql_fetch_array($result)) {

if(empty($row['Venue_Logo']) || !file_exists("admin/venue/logos/{$row['Venue_Logoe']}"))
    {
        echo "<img src='admin/venue/logos/noimage.gif'>";  // no image
    }else{
        echo "<img src=' admin/venue/logos/{$row['Venue_Logo']}'>";  // found image
    }
    if (!empty($row['Venue_Name'])) echo $row['Venue_Name']."<br />\n"; 
    if (!empty($row['Venue_Show_Time'])) echo "Date: ".$row['Venue_Show_Time']."<br />\n";
    if (!empty($row['Host'])) echo "Host: ".$row['Host']."  "; 
    if (!empty($row['Host_Email'])) echo "Host Email: ".$row['Host_Email']."<br />\n";
    if (!empty($row['Venue_Address'])) echo "Address: ".$row['Venue_Address']."<br />\n"; 
    if (!empty($row['Venue_City'])) echo "City: ".$row['Venue_City']."<br />\n"; 
    if (!empty($row['Venue_Email'])) echo "Email: ".$row['Venue_Email']."<br />\n"; 
    if (!empty($row['Venue_Phone'])) echo "Phone: ".$row['Venue_Phone']."<br />\n"; 
    if (!empty($row['Venue_Website'])) echo "Website: ".$row['Venue_Website']."<br />\n"; 


echo "<hr>";
}

Right now it displays the website and the email address but they are not links just text.

Assuming that the URLs have http:// already in them, this will work.

$query= 'SELECT Venue_Logo, Venue_Name, Venue_Show_Time, Venue_Show_Time, Host, Host_Email, Venue_Address, Venue_City, Venue_Email, Venue_Phone, Venue_Website FROM VenueUploads ORDER BY Venue_Show_Time ASC LIMIT 0, 100';

$result = mysql_query($query) or die(mysql_error());

while($row = mysql_fetch_array($result)) {

if(empty($row['Venue_Logo']) || !file_exists("admin/venue/logos/{$row['Venue_Logoe']}"))
    {
        echo "<img src='admin/venue/logos/noimage.gif'>";  // no image
    }else{
        echo "<img src=' admin/venue/logos/{$row['Venue_Logo']}'>";  // found image
    }
    if (!empty($row['Venue_Name'])) echo $row['Venue_Name']."<br />\n";
    if (!empty($row['Venue_Show_Time'])) echo "Date: ".$row['Venue_Show_Time']."<br />\n";
    if (!empty($row['Host'])) echo "Host: ".$row['Host']."  ";
    if (!empty($row['Host_Email'])) echo "Host Email: <a href=\"mailto:".$row['Host_Email']."\">".$row['Host_Email']."</a> <br />\n";
    if (!empty($row['Venue_Address'])) echo "Address: ".$row['Venue_Address']."<br />\n";
    if (!empty($row['Venue_City'])) echo "City: ".$row['Venue_City']."<br />\n";
    if (!empty($row['Venue_Email'])) echo "Email: ".$row['Venue_Email']."<br />\n";
    if (!empty($row['Venue_Phone'])) echo "Phone: ".$row['Venue_Phone']."<br />\n";
    if (!empty($row['Venue_Website'])) echo "Website: <a href=\"".$row['Venue_Website']."\" target=\"_blank\">".$row['Venue_Website']."</a> <br />\n";


echo "<hr>";
}

Thanks I got this 

if (!empty($row['Host_Email'])) echo "Host Email: <a href='mailto:".$row['Host_Email']."'>".$row['Host_Email']."</a><br />\n"; 

    if (!empty($row['Venue_Website'])) echo "<a href='".( strpos( '://', $row['Venue_Website'] ) ? '' : 'http://' ).$row['Venue_Website']."'>".$row['Venue_Website']."</a><br />\n"; 

But as always this site rocks for answer

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.