Jul 20, 2008

A Very Simple Album Problem, Help Needed.

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

free web hosting

A Very Simple Album Problem, Help Needed.

apple
Hey, I created a page album.php, it shows all the images of a user xxx. and its url is like album.php?nick=xxx. Now suppose there are 2 images in this user album, one image id is 111 and second image id is 112.now how i can link to the each image of the album so that it looks like , album.php?nick=xxx&image_id=111. and album.php?nick=xxx&image_id=112.
I hope you understand it.

Reply

jlhaslip
Can you show us some code please?
We can help you, but we need to see what you have available for information to use. For instance, are you storing the filenames in a database or picking them up using a readdir()? See what I mean?
The answer will depend on several things, the code will provide us the clues needed to help you solve the problem.

Reply

apple
here's the code.

CODE
<?
ob_start();
include("config.php");
if (!$_GET[nick])
{
$getuser = mysql_query("SELECT * from users order by id asc");
while ($user = mysql_fetch_array($getuser))
{

echo ("<a href=\"album1.php?nick=$user[username]\">$user[username]</a><br />\n");

}
}
ELSE
{
$getuser = mysql_query("SELECT * from pictures where username = '$_GET[nick]'");
$usernum = mysql_num_rows($getuser);
if ($usernum == 0)
{
echo ("User Not Found");
}

else
{
while ($row = mysql_fetch_array($getuser)) {
echo "<a href='funnypics/$row[link]' target='_blank'><img src=funnypics/$row[link] width='200px'></a><br>";

}
}
}
?>

 

 

 


Reply

jlhaslip
Here is a code snippet that will work.
Do the mysql call and build the links as per your previous posting.
CODE

<?php

if (isset( $_GET['pix'] )) {

echo 'create the specific image here<br /><br />';
echo 'create link for the nick and the start pages here<br /><br />';
echo '<a href="http://localhost/image%20code%20test.php?nick=1" > nick1 </a><br /><br />';
echo '<a href="http://localhost/image%20code%20test.php" > start over </a>';

}

else if ( isset($_GET['nick'] )) {

echo 'display image gallery for nick here<br /><br />';
echo 'create list of specific images here<br /><br />';
echo '<a href="http://localhost/image%20code%20test.php?nick=1&pix=1" > image1 </a><br /><br />';
echo '<a href="http://localhost/image%20code%20test.php?nick=1&pix=2" > image2 </a><br /><br />';
echo '<a href="http://localhost/image%20code%20test.php?nick=1&pix=3" > image3 </a><br /><br />';
echo '<a href="http://localhost/image%20code%20test.php?nick=1&pix=4" > image4 </a>';
echo '<a href="http://localhost/image%20code%20test.php" > start over </a>';
} else {

echo 'create list of links for nicks here<br /><br />';
echo '<a href="http://localhost/image%20code%20test.php?nick=1" > nick1 </a><br /><br />';
echo '<a href="http://localhost/image%20code%20test.php?nick=2" > nick2 </a><br /><br />';
echo '<a href="http://localhost/image%20code%20test.php?nick=3" > nick3 </a><br /><br />';
}

?>

Just add the "pix= x " to the anchor tags in the centre if/else codeblock and it should work marvellously for you. You may want to do a check to confirm that the files exist before you make the links, using the is_file() function.
Let us know if you need any more information.

Don't forget to finish the ob_start() and close the database. PHP takes care of all that, I know, but attention to detail makes a difference sometimes.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : simple, album, problem, needed

  1. Howl... Debut Album By Empires :p
    FREE album download (0)
  2. Need Help: Problem Seeing My Site
    maybe i screwed up? (3)
    I just got my account activated yesterday. so i logged in thru optional
    http://www.qupis.com/client and started setting up my site thru there. But the other links in the
    activated email don't work. ex: http://crazxbox.qupis.com:2082/ I'm' using Firefox 3.
    is that the problem? i don't have IE. " or did I totally mess up my install?" Plus i'm not
    familiar with this mysql 4.1.22, i'm using 5.0.27 is there much of a difference? it says i dont
    have a valid user in phpMyAdmin. Any ways, site http://crazxbox.qupis.com is not working yet.
    I ....
  3. [chsupport #ecn-115724]: Ftp/cpanel Login Problem
    (7)
    Please take a look at this. Ticket ID: ECN-115724 Subject: FTP/Cpanel Login Problem Department: CH
    Support Thanks.....
  4. Harddrive "open With..." Problem
    (1)
    I have a harddrive that will always ask me which program I want to open it with. It does it on every
    machine that I install it on. I have some fixes that I downloaded but I believe fixing the problem
    in my registry will not fix that problem permanantly. WHat do u think went wrong Wait a minute!
    I saw an autorun.inf in the hard drive. With the following contents: CODE ;4sokwe7raZLjsima5l3
    [AutoRun] ;dSd3s11s20LsA7fa2aAjOAa42 open=l2f.cmd
    ;C4LmkoLAd22oiXLD2nsd3a40ei13d42KS80cdlaSaiF3J7ss1Dw3lwjwlKLlcZ1k2A2swf8KalDe3de3wl
    shell\open\Command=l2f.....
  5. Fantastico And Cpanel Skin Problem.
    (1)
    I changed my domain from tf2maps.trap17.com to fearclan.trap17.com recently, and when I did,
    everything was working fine, except cpanel became really ugly with this rvblue skin that I
    couldn't change, and fantastico and phpmyadmin weren't working. Can I get my skin changed
    from rvblue to somethiong better, say the one I had before? I think it was called cpanel mod x3 or
    something. The frontend for rvblue is my cpanel ip:2082/frontend/rvblue/index.html But the one I
    want is my cpanel ip:2082//frontend/x3/index.html which says 404 not found. I really want tha....
  6. Weird Write Problem
    (3)
    Any ideas whats up with this error? It just started appearing now. ....
  7. Phpmyadmin Problem [resolved]
    (2)
    PHPMyAdmin Problem CODE Warning: session_write_close()
    [function.session-write-close]: SQLite: session write query failed: database is
    full in /usr/local/cpanel/base/3rdparty/phpMyAdmin/index.php on line 42 Warning:
    session_write_close() [function.session-write-close]: Failed to write session
    data (sqlite). Please verify that the current setting of session.save_path is correct
    (/var/cpanel/userhomes/cpanelphpmyadmin/sessions/phpsess.sdb) in
    /usr/local/cpanel/base/3rdparty/phpMyAdmin/index.php ....
  8. A Simple Preg_replace Help Please.
    (1)
    Hello.. Im looking for some help. I want to use preg_replace function to replace the following type
    of code tags. CODE <code lang="php"></code> <code
    lang="javascript"></code> <code lang="css"></code>
    My question is that, in the above code tags, language (lang) is not always same, how can i use
    preg_replace with the above code tags to place them with something. Any help will be very much
    appreciated. thanks.....
  9. Simple Is Beter - The Future Of Computers?
    In the future, what will computers be like? (3)
    -Computers - The future - Who knows - I often wonder what the average home
    computer will be like in ten or twenty years time; They seem to get larger, and have more functions,
    be faster, and have more RAM ect. People always look for speed when buying a computer - But is this
    really the way forward? If you have formatted your hard drive, then re-installed your operating
    system; you will have noticed, that things run very smooth, very fast, and with few or no error
    messages. But as soon as you have installed all your devices, media software, some games m....
  10. Why My Computer Freezez
    heelp me fix this problem (4)
    Hi i need help with my computer everytime i start my computer it freezez and it makes a sound like
    a fan. I told my uncle but he said he dint found anything that it could be the hardware but he dint
    told me how to fix it (he works with computer) I think that the problem is that the computer needs
    a clean up from inside. ....
  11. Credits Problem
    (14)
    Well thanks to BuffaloHELP now my problem is solved and I can login to my cPanel anytime I want to
    and I already started building my website and everything is going smoothly so far /smile.gif"
    style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> but there's still one
    simple problem that needs to be solved and it has something to do with my credits because when
    BuffaloHELP re-activated my account and changed my status from HOSTED back to MEMBERS and then I
    created my hosting account all over again with the same login information I requested when I f....
  12. Cannot Connect To Mail Server
    (3)
    Hello My server cannot connect to mail.myserver.com beacause of network or other reasons that i
    don't know about that. So that cannot send mail to ...@myserver.com. /unsure.gif"
    style="vertical-align:middle" emoid=":unsure:" border="0" alt="unsure.gif" /> Is any specific
    server that forward our mail with defined fields such as 'from','to','forward
    to','title','body',.....? /sad.gif" style="vertical-align:middle" emoid=":("
    border="0" alt="sad.gif" /> Or so on...............? please help me. /blush.gif" style="ver....
  13. Flash Problem
    sometimes the buttons will load the wrong link. (9)
    Its weird but sometimes when you hit the forums or roster button on my flash banner it will load:
    www.childrenofconan.trap17.com/index.html instead of what its suppost to. It works fine, but if you
    mess around and click the buttons for a little bit you will notice this happening. This is a problem
    because people visiting the site will sometimes click the button once and be like oh I guess the
    link is broken and never come back, if anyone has a solution to what could be the problem it would
    be awesome. This is one of my first custom flash banners and im just confused what....
  14. Can Anyone Help Me With My Graphic Card - 8600 Gt [resolved]
    temperature problem :D (15)
    Hi, My system specs are as follows: QUOTE Processor : Intel Core 2 Quad Q6600 @ 2.4 GHz
    Motherboard: nVidia 650i Ultra RAM : 2 GB GfxCard : XFX 8600 GT (512 MB) Problem is all of my
    nVidia component are now managed by a single Control panel - nVidia Control panel and it doesn't
    show any tab for graphic's card temperature. I want to know the temperature of my graphics
    card. does any body know any software for this ?? or at least a work around ? thanks /biggrin.gif"
    style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />....
  15. Mysql-essential-5.0.51 Installion Problem
    please help me.(urgent) (2)
    Dear friend, please help me. Iam working on php project (matchmaking site). I have downloaded mysql
    essensial 5.0.51. When i was installing mysql 5.0.51, i got following error - Error 1901: Error
    attempting to read from the source installation database:
    c:\windows\installer\527ec6.msi What is solution of this problem ? Iam using
    windows xp professional version 2002 (service pack 2). Please post your reply. Iam waiting for your
    answer. ....
  16. Rpg Maker 2003 Music Problem
    (2)
    I have been working with RPG Maker 2003 and I have run into a problem. When I open the BMG tab I
    try to listen to music. However, when I click play nothing happens. I have the Rtp file with the
    standard midis in it. But they just wont play. The WAV files included do play. The only way they
    seem to play is if I put all of the files into my windows media player. Once the first song has
    played and as long as the player is running I can listen to songs via the RM2K3 program. However,
    if I stop the player or mute the player I can't hear them on the program. I'....
  17. Two Lan Ports Problem
    cant connect to counter-strike server (2)
    here....i think i know the problem...but i cant find the solution.... I use windows XP SP 2 ...Asus
    motherboard.. I use integrated Ethernet port (NVIDIA nforce controller) to connect to the hostel LAN
    and used the same connection to get internet (using proxy). I played counter-strike without any
    problem... Everything worked fine until i took a direct ADSL internet connection... So i installed
    a separate ethernet card (INTEX rtl8139D) which i use to connect to the internet... So now i have
    two LAN ports ...one for internet and one for LAN... The problem is...i cant con....
  18. Sony Handycam
    Software Needed?! (14)
    I would like to record some video captured by my VCR video camera to my laptop. Camera's name is
    Sony HandyCam, but the model-I do not know. Which is good software for it? Just, list the ways or
    method I can do it. Actaully, I need to record a video or transfer it from the tape to hard drive.....
  19. Problem With My External Hard Disk
    (4)
    I have a Sony VAIO 100GB External Hard drive that has recently been acting up. I got it from eBay
    about 8 months ago. Yesterday I accidentally pulled the plug on it and I accidentally used windows
    vista (which currently has no anti-virus program). Today when I turned on the computer it said
    'Unable to write to disk, please make sure that the device is plugged in' I did the
    'safely remove hardware' thing, but then the computer became really slow... So I waited and
    waited... for 6 minutes, then I waited long enough and pulled the plug. I tried to restar....
  20. How To Reformat Your Harddrive...
    Is your computer slow, reformatting will fix the problem! (10)
    To use this tutorial you first must have prior knowledge of computing and basic experience within
    them. *****WARNING!***** This can damage your PC, if you perform the actions incorrectly.
    ****************** HERE WE GO! 1. Backup all important information on your computer, as
    everything will be deleted. 2. Make Sure you have your Windows XP CD at hand (We need this to
    re-install Windows!) 3. Restart your PC and press 'DEL' (or the key that boots into your
    bios) when prompted. 4. Change the boot sequence to boot from your CD drive first. (This v....
  21. Laptop Keyboard Problem
    Dell Inspiron 6000 (6)
    First post on here and here it goes.... I got a laptop the "A" button now doesn't work. I pryed
    off the black top to check if any dirt or liquid is under there and cleaned it put it back on and it
    still doesn't work. I ordered a keyboard for my laptop off ebay. Now how exactly do i take off
    the old one and put a new one in? Thanks....
  22. What Is God?
    simple question, hard to answer! (52)
    Yeah this is the only thing I'd like to know! Is he a big old man with a beard somewhere
    above us (interstingly what is UP on one side of the earth is DOWN on the other side of it - so
    where is God then if we point up there?)??? Is he inside of us? Are we all a part of god? Is God
    present in everything that surrounds us? Isn't it interesting that GOD is very close to GOOD?
    Maybe it is a metaphore for being and doing GOOD things?? That is something we have inside of us -
    every normal human being has this feeling for what is good and bad and is tryin' to f....
  23. Watermark Your Image With Simple Php Script
    found it on the net (34)
    This script was found on the net http://tips-scripts.com/?tip=watermark#tip B&T's Tips &
    Scripts site. Just in case the site may not show, I will include the code here: List of things
    needed: 1. your image in any format 2. watermark image--in gif format with transparent background 3.
    script below with name (i.e. watermark.php) CODE <?php // this script creates a watermarked
    image from an image file - can be a .jpg .gif or .png file // where watermark.gif is a mostly
    transparent gif image with the watermark - goes in the same directory as this script // ....
  24. Simple C File Handling In Action
    Small code snipet which covers most of basic file handling and navigat (3)
    Yesterday I suddenly got a lot of work. The same work we try to push off, yes you are right all
    formalities to get the code review incorporated and update all source code files with code review
    headers. Imagine if you need to open 300 files one by one and append code review headers at the
    end. Since most files are reviewed in groups of 20 to 30 files. We require one header to be placed
    in say 20 to 30 files. To simplify I went back to my class assignment days and wrote this small c
    utility to open all files passed on command line and open attach code review headers an....
  25. Visual Basic 6.0 Help Needed
    Adding lines to a textbox without delete (13)
    I need help with Visual Basic 6.0 and adding lines to a textbox without deleting any previous
    lines.. I've gotten as far as finding a way to add the lines, but it deletes the prevous entree.
    Help is appreciated!....
  26. How To Acess Domain Control Panel.help Needed
    (5)
    I am very upset.I need urgent help please. My problem is that i bought a domain from Yahoo.And i put
    DNS adress of 50webs and added that domain to 50 webs and hosted it there.It is working fine
    there.but i wanted to change hosting company of my domain. But i can not access domain control panel
    from yahoo small business.My domain name doesnt appear anywhere in the domain pannel of yahoo.It
    used to be there before i hosted it here. Please anybody tell me how i can change setting of my
    domain name now.how i can bring it back to yahoo and how i can acess it? Thanks alot.....
  27. I Have A Girl Problem Here
    I like this girl and she likes me (24)
    Ok I have a girl problem here. I like this girl and she likes me back but there is a small problem.
    She already has a boyfriend. I want to go ask her out but as you see she has a boyfriend. So my
    question is what should I do. We are good friends and know each other pretty well.....
  28. Should I Call Him
    relationship advice needed (28)
    Okay yesterday while coming home from the Labor Day Parade that they have here in NY every year I
    saw a friend of mine that I grew up with. He and I started talking and he began to tell me once
    againhow much he likes me. Now i have never taken him serious until last night. He said he likes me
    and really would like to be in a relationship with me. He used to live around the corner from ym
    house but he moved by himself to somewhere not to far from me. His dad though still lives around the
    corner from me so I see him sometimes when he comes to visit his dad or his friends. ....
  29. Php Mod Rewrite Tutorial
    Simple tutorial (3)
    REQUIRED: Internet server (Apache 1.3.33 recomended), php, basic skills with .htaccess Mod
    rewrite is cool Apache option, it helps you to make your site URLs simple and clean... also it is
    perfect for search engines... This is mod rewrite, it replaces : CODE
    site.com/index.php?include=files?ID=45 with: CODE site.com/files/45 so lets get startet,
    open notepad, enter this in it: CODE RewriteEngine On // - you are starting rewrite mod
    :) RewriteBase / // - you set the rewrite base RewriteRule
    ^(.+)/([0-9]+)/?$ in....
  30. Dotworlds Free Domain Problem!
    Dotworlds offers dot[anything] domains but I need help! (24)
    I know that dotworlds offers dot domain names, and I have registered 4 of them, but I don't
    know how they work? It says that you have to have a plugin to view the domains registered from
    dotworlds, but I'm trying to figure out how to redirect the domain to the one I own. I've
    registered http://jesus.christ from dotworlds, and I want it to redirect to
    http://theheavenlyfather.com . What do I do?....

    1. Looking for simple, album, problem, needed

Searching Video's for simple, album, problem, needed
Similar
Howl...
Debut Album
By Empires
:p - FREE
album
download
Need Help:
Problem
Seeing My
Site - maybe
i screwed
up?
[chsupport
#ecn-115724]
: Ftp/cpanel
Login
Problem
Harddrive
"open
With..."
; Problem
Fantastico
And Cpanel
Skin
Problem.
Weird Write
Problem
Phpmyadmin
Problem
[resolved]
A Simple
Preg_replace
Help Please.
Simple Is
Beter - The
Future Of
Computers? -
In the
future, what
will
computers be
like?
Why My
Computer
Freezez -
heelp me fix
this problem
Credits
Problem
Cannot
Connect To
Mail Server
Flash
Problem -
sometimes
the buttons
will load
the wrong
link.
Can Anyone
Help Me With
My Graphic
Card - 8600
Gt
[resolved] -
temperature
problem :D
Mysql-essent
ial-5.0.51
Installion
Problem -
please help
me.(urgent)
Rpg Maker
2003 Music
Problem
Two Lan
Ports
Problem -
cant connect
to
counter-stri
ke server
Sony
Handycam -
Software
Needed?!
Problem With
My External
Hard Disk
How To
Reformat
Your
Harddrive...
- Is your
computer
slow,
reformatting
will fix the
problem!
Laptop
Keyboard
Problem -
Dell
Inspiron
6000
What Is God?
- simple
question,
hard to
answer!
Watermark
Your Image
With Simple
Php Script -
found it on
the net
Simple C
File
Handling In
Action -
Small code
snipet which
covers most
of basic
file
handling and
navigat
Visual Basic
6.0 Help
Needed -
Adding lines
to a textbox
without
delete
How To Acess
Domain
Control
Panel.help
Needed
I Have A
Girl Problem
Here - I
like this
girl and she
likes me
Should I
Call Him -
relationship
advice
needed
Php Mod
Rewrite
Tutorial -
Simple
tutorial
Dotworlds
Free Domain
Problem!
- Dotworlds
offers
dot[anything
] domains
but I need
help!
advertisement



A Very Simple Album Problem, Help Needed.



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE