Jump to content

Variables in URL


VogrothUnmaker

Recommended Posts

??? I am having trouble with my website. I have tried explaning it on many occasions but to no avail so now I will use a picture to help demonstrate my issue. I want to create something like this -> (I photoshopped this picture a lot)
[IMG]http://i43.photobucket.com/albums/e385/DoomedBanana/helpmepic.png[/img]

Just for clarity, I am pretty sure I am not looking for a gallery script. NO GALLERY SCRIPTS (unless it is percisely what Im looking for) If your still unsure what exactly I'm trying to accomplish, tell me and I will try to further explain it. I need you to ask me any questions of this manner so that I can help you help me. Thanks alot^.^
Link to comment
https://forums.phpfreaks.com/topic/27159-variables-in-url/
Share on other sites

[code]<?php
switch($_GET['comicnum']){
case 1:
    $image = '<img alt="alt text" src="Imagename1.jpg">';
break;
case 2:
    $image = '<img alt="alt text" src="Imagename2.jpg">';
break;
case 3:
    $image = '<img alt="alt text" src="Imagename3.jpg">';
break;
}
echo $image;
?>[/code]
Link to comment
https://forums.phpfreaks.com/topic/27159-variables-in-url/#findComment-124178
Share on other sites

[quote author=VogrothUnmaker link=topic=114878.msg467547#msg467547 date=1163462809]
I think so, I just have one question how do i get the buttons to scroll through em?
[/quote]
[code]<a href="comic.php?comicnum=<?php echo $_GET['comicnum']+1; ?>"> <img src="NEXT.gif" alt="next" /> </a>[/code]
For previous minus one.
Link to comment
https://forums.phpfreaks.com/topic/27159-variables-in-url/#findComment-124189
Share on other sites

[quote author=VogrothUnmaker link=topic=114878.msg467555#msg467555 date=1163463341]
Thanks!!!  :D

            (This is the fastest moving forum I have ever been to, getting a response on the spriting forums I belong to can take days if not weeks >.>)
[/quote]

Your welcome.  I'm new here also, and it's much faster than I am used to.
Link to comment
https://forums.phpfreaks.com/topic/27159-variables-in-url/#findComment-124195
Share on other sites

Maybe it will work this way
[code]<?php
$comic = $_GET['comicnum'];
switch($comic){
case 1:
    $image = '<img alt="alt text" src="Imagename1.jpg">';
break;
case 2:
    $image = '<img alt="alt text" src="Imagename2.jpg">';
break;
case 3:
    $image = '<img alt="alt text" src="Imagename3.jpg">';
break;
}
echo $image;
?>[/code]
Link to comment
https://forums.phpfreaks.com/topic/27159-variables-in-url/#findComment-124283
Share on other sites

Can you tell me exactly what topic(s) I should read up on. I am a slow reader and I often have to reread things several times before I understand them, so it would be helpfull if I knew exactly what to look up instead of reading through this entire (giant manual)
Link to comment
https://forums.phpfreaks.com/topic/27159-variables-in-url/#findComment-124647
Share on other sites

like i said it depends on your database,  but the most common is mysql
example:
[code]
$cn=@mysql_connect("host","username","password") or die(mysql_error());
@mysql_select_db("name",$cn) or die(mysql_error());
$result=@mysql_query("SELECT latest_comic FROM comics",$cn) or die(mysql_error());
while($row=mysql_fetch_array($result))
{
        $latest_comic=$row[latest_comic];
}
echo "<img scr=\"{$latest_comic}\" alt=\"Latest comic\">";
[/code]
Link to comment
https://forums.phpfreaks.com/topic/27159-variables-in-url/#findComment-124753
Share on other sites

[color=maroon]Thorpe mentioned logging the dates the comics are entered but Im unsure of how I would go about doing that, would i use the[/color] [color=orange][i][b]DATETIME[/b][/i][/color][color=maroon] command or a [/color][color=orange][i][b]Unix Timestamp[/b][/i][/color] [color=maroon]or what? And then after that how do I declare that the comic with the latest date is the latest comic entered. Im reading the tutorial thorpe told me to but its so large and the sections that I have read have mentioned date entered fields but they never quite explain how to create and use them.[/color]
[hr]
[move]8)[size=7pt][color=green]This is turning out good so far! YAY[/color][/size]8)[/move]
Link to comment
https://forums.phpfreaks.com/topic/27159-variables-in-url/#findComment-125149
Share on other sites

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.