Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Importing photo and text with PHP
I am a beginner in PHP.
On my website, I have pages with photos thumbnails. Each thumbnail is a link
opening a html page with a larger photo and some text.
I saw on some web sites that it is possible to do the same with PHP with the
great advantage of always reusing the same html page to load different
photos and descriptive text.
Links to tutorials explaning how is it done?
Many thanks!
Pascal


---
Ce courriel est exempt de virus.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.783 / Virus Database: 529 - Release Date: 2004-10-25



Report this thread to moderator Post Follow-up to this message
Old Post
Pascal Bouchard
11-05-04 01:55 AM


Re: Importing photo and text with PHP
"Pascal Bouchard" <forum@mitan.ca> schreef in bericht
news:W6xid.263$ab.145059@weber.videotron.net...
> I am a beginner in PHP.
> On my website, I have pages with photos thumbnails. Each thumbnail is a
link
> opening a html page with a larger photo and some text.
> I saw on some web sites that it is possible to do the same with PHP with
the
> great advantage of always reusing the same html page to load different
> photos and descriptive text.
> Links to tutorials explaning how is it done?
> Many thanks!
> Pascal
>

Create a database
pictures(id, pic, text) etc
dont forget to connect to ur database first see www.php.net

index.php
<?php
$sql = "SELECT pic,id "
. "FROM pic ";
$query = mysql_query("$sql")
or exit ("Ongeldige query " . mysql_error());
while($row = mysql_fetch_array($query))
{echo '<a href="picpage.php?pic_id='.$row[id].'"><img
src="thumbs/'.$row[pic].'"> </a>';}
?>



picpage.php
<?php
$sql = "SELECT pic,text "
. "FROM pic "
. "WHERE id =$_GET[id]";
$query = mysql_query("$sql")
or exit ("Ongeldige query " . mysql_error());

$row = mysql_fetch_array($query);

echo '<img src="'.$row[pic].'">';
echo '<p>'.$row[text].'</p>';
?>






Report this thread to moderator Post Follow-up to this message
Old Post
Floortje
11-05-04 01:55 AM


Re: Importing photo and text with PHP
Many thanks, Floortje.
Now I know for sure it can be done and that I have to do my part and do some
tutorials!

Dans un message précédent, Floortje
<floortje- apestaartjexs4allpuntnl@hetminnetjehoort
.erbij> a écrit:
> "Pascal Bouchard" <forum@mitan.ca> schreef in bericht
> news:W6xid.263$ab.145059@weber.videotron.net... 
>
> Create a database
> pictures(id, pic, text) etc
> dont forget to connect to ur database first see www.php.net
>
> index.php
> <?php
> $sql = "SELECT pic,id "
>    . "FROM pic ";
> $query = mysql_query("$sql")
>         or exit ("Ongeldige query " . mysql_error());
> while($row = mysql_fetch_array($query))
>    {echo '<a href="picpage.php?pic_id='.$row[id].'"><img
> src="thumbs/'.$row[pic].'"> </a>';} 
>
>
>
> picpage.php
> <?php
> $sql = "SELECT pic,text "
>    . "FROM pic "
>    . "WHERE id =$_GET[id]";
> $query = mysql_query("$sql")
>         or exit ("Ongeldige query " . mysql_error());
>
> $row = mysql_fetch_array($query);
>
> echo '<img src="'.$row[pic].'">';
> echo '<p>'.$row[text].'</p>';


---
Ce courriel est exempt de virus.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.783 / Virus Database: 529 - Release Date: 2004-10-26



Report this thread to moderator Post Follow-up to this message
Old Post
Pascal Bouchard
11-05-04 08:56 PM


Re: Importing photo and text with PHP
"Pascal Bouchard" <forum@mitan.ca> schreef in bericht
news:HdMid.48183$ab.598808@weber.videotron.net...
> Many thanks, Floortje.
> Now I know for sure it can be done and that I have to do my part and do
some
> tutorials!

Actually the code is allmost done. All u need to do is quickly read over
some basic PHP syntax, basic SQL and google for phpmyadmin

Floortje



Report this thread to moderator Post Follow-up to this message
Old Post
Floortje
11-06-04 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP SQL archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:39 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.