For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > June 2006 > Re: Learning php Sql Read Me First.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Learning php Sql Read Me First.
strawberry

2006-06-01, 7:00 pm


> isnt it better not to store images in the database.


I wouldn't store the images in the database, just store the paths to
the images. It's common practice to store things like that outside of
the server path, i.e. not in the htdocs directory, and then create a
php 'include file' that contains information about the
whereabouts of the images folder.

> as i understand it just typing in the hyper link would make it just text.
> dont i have to do some kind of script?


Yes. In php, you use html to create the hyperlink, just like normal
html - except you might write it something like this (untested):

echo "<a href='$img?id={$row['img_id']}'>Look inside this
apartment</a>\n";

where $img is the path to the folder (as assigned by the include file)
and $row['img_id'] is the name of the associated image.

Incidentally, the following script purports to reduce the calorie
intake from pancakes (again untested);
<html>
<head><title>Pancake Calorie Content Reducer</title></head>
<body>
<?php
echo "<center>EAT FEWER PANCAKES</center>";
?>
</body>
</html>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com