Jump to content

adding a http link tag


netman182

Recommended Posts

i have a database field called photo. it is used to generate photo id in a software progam for our soccer league. I also want to be able to view the photo on our approval page. could someone help me with the coding of the http h-link? i am having issues with it.

 

the photo field has the following paramaters: images/picture.jpg

 

i want the link on the approval page to look like this: <a href="http://bccsl.org/managers/images/picture.jpg">"http://bccsl.org/managers/images/picture.jpg</a>

 

 

thanks

 

 

stefan

<?php

/* connection and protection */

include 'dbc.php';

page_protect();



    mysql_query( "SET NAMES utf8" );





if(isset($_POST["update"]) AND isset($_POST["hiddenid"]))

{

    $updated=false;



    $activateapproved=array();

    $deactivateapproved=array();

    

    foreach($_POST["hiddenid"] AS $value)

    {

        if(isset($_POST["checkboxapproved"][$value]))

        $activateapproved[]=intval($value);

        else

        $deactivateapproved[]=intval($value);

    }





    if(count($activateapproved)>0)  {

    $SQL=sprintf("UPDATE players SET approved=1 WHERE id in (%s)" , implode(",", $activateapproved));

    mysql_query($SQL) OR DIE(mysql_error());

    $updated=true;

    }



    if(count($deactivateapproved)>0) {

    $SQL=sprintf("UPDATE players SET approved=0  WHERE id in (%s)" , implode(",", $deactivateapproved));

    mysql_query($SQL) OR DIE(mysql_error());

    $updated=true;

    }

    

    if($updated==true) {

    header("Location: ".$_SERVER["PHP_SELF"]."");

    exit();

    }

}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Player Approval</title>

<script type="text/javascript" src="public_smo_scripts.js"></script>

<link href="styles.css" rel="stylesheet" type="text/css">

</head>



<body>
<table width="100%" border="0" cellspacing="0" cellpadding="5" class="main">
  <tr> 
    <td colspan="3"> </td>
  </tr>
  <tr> 
    <td width="160" valign="top">
<? include 'menu.php'; ?>
      <p>  </p>
      <p> </p>
      <p> </p>
      <p> </p></td>
    <td width="732" valign="top"><p> </p>
<?php
if(isset($_GET["todo"]) AND $_GET["todo"]=="updated")

{

    echo "Updated succesfully";

}

?>

<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" name="Form">

<table border="1" cellpadding="2" cellspacing="2">

<tr>

<td><div align="center">First</div></td> 
<td><div align="center">Last</div></td> 
<td><div align="center">Address</div></td>
<td><div align="center">City</div></td>
<td><div align="center">Postal</div></td> 
<td><div align="center">Phone #</div></td>
<td><div align="center">Feet</div></td>
<td><div align="center">Inches</div></td> 
<td><div align="center">Weight</div></td> 
<td><div align="center">Birthdate</div></td> 
<td><div align="center">Team ID</div></td>
<td><div align="center">Type</div></td>
<td><div align="center">photo</div></td>
<td><div align="center">Date Added</div></td>
<td><div align="center">Approved</div></td>

</tr>

<?php

$sql="select * from players where teamid='$_POST[teamid]' order by status ASC";

$res=mysql_query($sql) or die(mysql_error());



while($r=mysql_fetch_assoc($res))

{

?>

<tr>

    <input type="hidden" name="hiddenid[]" value="<?php echo $r["id"]?>">

    <td>

      <div align="center"><?php echo empty($r["first"])?' ':htmlspecialchars($r["first"]); ?>        </div></td>

    <td>

      <div align="center"><?php echo empty($r["last"])?' ':htmlspecialchars($r["last"]); ?>        </div></td>

    <td>

      <div align="center"><?php echo empty($r["address"])?' ':htmlspecialchars($r["address"]); ?>        </div></td>

    <td>

      <div align="center"><?php echo empty($r["city"])?' ':htmlspecialchars($r["city"]); ?>        </div></td>

    <td>

      <div align="center"><?php echo empty($r["postal"])?' ':htmlspecialchars($r["postal"]); ?>        </div></td>

    <td>

      <div align="center"><?php echo empty($r["phone"])?' ':htmlspecialchars($r["phone"]); ?>        </div></td>

    <td>

      <div align="center"><?php echo empty($r["feet"])?' ':htmlspecialchars($r["feet"]); ?>        </div></td>

    <td>

      <div align="center"><?php echo empty($r["inches"])?' ':htmlspecialchars($r["inches"]); ?>        </div></td>

    <td>

      <div align="center"><?php echo empty($r["weight"])?' ':htmlspecialchars($r["weight"]); ?>        </div></td>

    <td>

      <div align="center"><?php echo empty($r["birth"])?' ':htmlspecialchars($r["birth"]); ?>        </div></td>

    <td>

      <div align="center"><?php echo empty($r["teamid"])?' ':htmlspecialchars($r["teamid"]); ?>        </div></td>

    <td>

      <div align="center"><?php echo empty($r["status"])?' ':htmlspecialchars($r["status"]); ?>        </div></td>

    <td>
    
      <div align="center"><?php echo empty($r["photo"])?'<a href="http://bccsl.org/managers/:htmlspecialchars($r["photo"])</a>'; ?>        </div></td>

    <td>
          <div align="center"><?php echo empty($r["dateadded"])?' ':htmlspecialchars($r["dateadded"]); ?>        </div></td>

    <td>

        <div align="center">

          <input type="checkbox" name="checkboxapproved[<?php echo $r["id"]?>]" value="1"<?php echo empty($r["approved"])?'':' checked="checked"'; ?> />

          </div></td>

</tr>

<?php

}

?>

</table>

<p>

  <input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/>

  select/unselect

  <input type="submit" value="update" name="update">

</p>

</form>



<table width="178" border="1" cellpadding="0" cellspacing="1">

  <tr>

    <th colspan="2" scope="col">Type</th>

  </tr>

  <tr>

    <td width="113"><div align="center">Church Player</div></td>

    <td width="50"><div align="center">1</div></td>

  </tr>

  <tr>

    <td><div align="center">Import Player</div></td>

    <td><div align="center">2</div></td>

  </tr>

  <tr>

    <td><div align="center">Witness Player</div></td>

    <td><div align="center">3</div></td>

  </tr>

</table>
     </td>
    <td width="196" valign="top"> </td>
  </tr>
  <tr> 
    <td colspan="3"> </td>
  </tr>
</table>

</body>
</html>
<a href="http://bccsl.org/managers/">http://bccsl.org/managers/</a>

Link to comment
https://forums.phpfreaks.com/topic/231102-adding-a-http-link-tag/
Share on other sites

ignore the bottom h-link. i forgot to take that out.

 

this is the part i want to link to the id card pictures.

 

  <div align="center"><?php echo empty($r["photo"])?'<a href="http://bccsl.org/managers/:htmlspecialchars($r["photo"])</a>'; ?>        </div></td>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.