•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 455,968 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,739 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1512 | Replies: 3 | Solved
![]() |
•
•
Join Date: Nov 2007
Posts: 183
Reputation:
Rep Power: 2
Solved Threads: 5
hi
i want to create the database retrieved datas as hyperlink using php.i have sent the code.please tell me how to edit the below code
<html>
<head>
</head>
<body>
<form>
<table>
<tr>
<td><font color="red">View All Posting</font>
</td>
</tr>
<tr>
<td><a href="care.php">Create New Users</a></td>
</tr>
<?php
$hostname = "localhost";
$username = "splendor_lydia";
$password = "jesus";
$dbid = "splendor_samp";
$link=mysql_connect($hostname, $username, $password);
mysql_select_db($dbid) or die("unable to connect");
echo "<table width='60%' border='1' style='padding-right: 6px'>";
$result=mysql_query("SELECT jobtitle FROM please");
print "<tr><td>jobtitle </td></tr>";
for ($i = 0; $i < mysql_num_rows($result); ++$i)
{
$line = mysql_fetch_row($result);
print "<tr><td>$line[0]</td></tr>";
}
echo "</table>";
mysql_close($link);
?>
</table>
</form>
</body>
</html>
i want to create the database retrieved datas as hyperlink using php.i have sent the code.please tell me how to edit the below code
<html>
<head>
</head>
<body>
<form>
<table>
<tr>
<td><font color="red">View All Posting</font>
</td>
</tr>
<tr>
<td><a href="care.php">Create New Users</a></td>
</tr>
<?php
$hostname = "localhost";
$username = "splendor_lydia";
$password = "jesus";
$dbid = "splendor_samp";
$link=mysql_connect($hostname, $username, $password);
mysql_select_db($dbid) or die("unable to connect");
echo "<table width='60%' border='1' style='padding-right: 6px'>";
$result=mysql_query("SELECT jobtitle FROM please");
print "<tr><td>jobtitle </td></tr>";
for ($i = 0; $i < mysql_num_rows($result); ++$i)
{
$line = mysql_fetch_row($result);
print "<tr><td>$line[0]</td></tr>";
}
echo "</table>";
mysql_close($link);
?>
</table>
</form>
</body>
</html>
•
•
Join Date: Aug 2007
Location: Cavite,Philippines
Posts: 508
Reputation:
Rep Power: 3
Solved Threads: 68
replace this part:
print "<tr><td>$line[0]</td></tr>";
with this part:
print "<td><tr><a href='".$line[0]."'>$line[0]</a></td></tr>";
print "<tr><td>$line[0]</td></tr>";
with this part:
print "<td><tr><a href='".$line[0]."'>$line[0]</a></td></tr>";
"death is the cure of all diseases..."
http://ryantetek.wordpress.com
http://ryantetek.wordpress.com
•
•
Join Date: Jan 2008
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
Can anyone help me with this code? I have been trying to output the url as a link but I cannot manage to do so. The url comes out fine in text form but when I try to output the url as a link I either get an error message or all of the url is not in the link. The code works without errors as I have it posted here but all of the url does not appear in the link. It seems anything I add after video_id. either produces and error or the var lable is output instead of the var value. I have been working on this for hrs. I know it must be something simple but I just cannot figure it out.
Thanks in advance
Kanui
http://www.daniweb.com/forums/newrep...treply&t=98084
Thanks in advance
Kanui
<?php
$txt = file_get_contents('http://youtube.com/watch?v=Z_qBWLAdKoE');
preg_match('/video_id:\'[\w]{11}\'/', $txt, $video_id_temp);
preg_match('/[\w]{11}/',$video_id_temp[0],$video_id_temp2);
$video_id = $video_id_temp2[0];
preg_match('/l:\'[\d]{1,15}\'/',$txt,$l_temp);
preg_match('/[\d]{1,15}/',$l_temp[0],$l_temp2);
$l = $l_temp2[0];
preg_match('/t:\'[\w]{32}\'/',$txt,$t_temp);
preg_match('/[\w]{32}/',$t_temp[0],$t_temp2);
$t = $t_temp2[0];
echo "http://youtube.com/get_video.php?video_id=".$video_id."&l=".$l."&t=".$t;
$url="http://youtube.com/get_video.php?video_id=";
print "<td><tr><a href='".$url.$video_id."'> Download</a></td></tr>";http://www.daniweb.com/forums/newrep...treply&t=98084
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- creating cookies using curl-php (PHP)
- Creating a login page in PHP (PHP)
- create a php link by creating by making directory in unix (PHP)
- Google, Yahoo and PHP (Search Engine Optimization)
- Random text display with image, link (PHP)
- Html+PHP Forms (PHP)
Other Threads in the PHP Forum
- Previous Thread: input submit
- Next Thread: YouTube Downloader script problem


Linear Mode