0602006 0532 GMT-6
Since you are posting via the url, I think you can use $_GET.
if ($_GET == "/pranikah.php?id=1") {
print 'pranikah1.jpg';
}
This is what I am doing in a similar situation.
I use DEFINE and use constants.
For example, Im using a templete and there is one page
where I must change a majority of the templete and
therefore also the CSS. I use
if(TITLE == 'schedule') {
print '@import "schedule.css";';
}
and that takes care of that.
wade
Adam Yusfan Edwin wrote:
>the code is working fine in my virtualserver "localhost"
>but it's not working when it upload into my webhosting
>
>
>i just want to catch url id for :
>http://www.imelstudio.com/pranikah.php?id=1
>
>i want my php script grab this id number, then
>write the correct image number to display
>
>if id = 1 then the pranikah1.jpg will displayed
>
>if there any easy way to do this?
>
>
>regards
>
>
>adam
>
>
>
>--- In [email protected], "cdg1111us" <[EMAIL PROTECTED]> wrote:
>
>
>>I've got several questions for you about this, but I guess the best
>>
>>
>would be to ask if you've
>
>
>>put a line above the switch statement echoing the value of $id.
>>
>>
>This would show you
>
>
>>whether the error is in your switch statement or before that.
>>
>>It looks to me like you're mixing programming constructs here as
>>
>>
>well. If you want to
>
>
>>change the value of $id like in your lines where you set $id = 1 or
>>
>>
>$id = 9 if $id is ever
>
>
>>below 1 or above 9 respectively, put if-then statements ahead of
>>
>>
>your switch statement.
>
>
>>Switch statements are supposed to exactly match on individual cases,
>>
>>
>and then have a
>
>
>>default "catch-all" statement.
>>
>>Hope this helps!
>>
>>
>>
>>--- In [email protected], "Adam Yusfan Edwin" <adam_y_e@> wrote:
>>
>>
>>>hi...
>>>
>>>i have this code in my website
>>>
>>>==========================================
>>> <?
>>> switch ($id)
>>> {
>>> case $id < 1;
>>> $id = 1;
>>> echo
>>> "<script>document.write('<img
>>>src=\"images/prewedding/foto-prawedding1.jpg\" width=\"300\"
>>>height=\"427\">');</script>";
>>> break;
>>>
>>> case "":
>>> echo
>>> "<script>document.write('<img
>>>src=\"images/prewedding/foto-prawedding1.jpg\" width=\"300\"
>>>height=\"427\">');</script>";
>>> break;
>>>
>>> case "1":
>>> echo
>>> "<script>document.write('<img
>>>src=\"images/prewedding/foto-prawedding1.jpg\" width=\"300\"
>>>height=\"427\">');</script>";
>>> break;
>>> case "2":
>>> echo
>>> "<script>document.write('<img
>>>src=\"images/prewedding/foto-prawedding2.jpg\" width=\"300\"
>>>height=\"427\">');</script>";
>>> break;
>>> case "3":
>>> echo
>>> "<script>document.write('<img
>>>src=\"images/prewedding/foto-prawedding3.jpg\" width=\"300\"
>>>height=\"427\">');</script>";
>>> break;
>>> case "4":
>>> echo
>>> "<script>document.write('<img
>>>src=\"images/prewedding/foto-prawedding4.jpg\" width=\"300\"
>>>height=\"427\">');</script>";
>>> break;
>>> case "5":
>>> echo
>>> "<script>document.write('<img
>>>src=\"images/prewedding/foto-prawedding5.jpg\" width=\"300\"
>>>height=\"427\">');</script>";
>>> break;
>>> case "6":
>>> echo
>>> "<script>document.write('<img
>>>src=\"images/prewedding/foto-prawedding6.jpg\" width=\"300\"
>>>height=\"427\">');</script>";
>>> break;
>>> case "7":
>>> echo
>>> "<script>document.write('<img
>>>src=\"images/prewedding/foto-prawedding7.jpg\" width=\"300\"
>>>height=\"427\">');</script>";
>>> break;
>>> case "8":
>>> echo
>>> "<script>document.write('<img
>>>src=\"images/prewedding/foto-prawedding8.jpg\" width=\"300\"
>>>height=\"427\">');</script>";
>>> break;
>>> case "9":
>>> echo
>>> "<script>document.write('<img
>>>src=\"images/prewedding/foto-prawedding9.jpg\" width=\"300\"
>>>height=\"427\">');</script>";
>>> break;
>>> case $id > 9:
>>> $id = 9;
>>> echo
>>> "<script>document.write('<img
>>>src=\"images/prewedding/foto-prawedding1.jpg\" width=\"300\"
>>>height=\"427\">');</script>";
>>> break;
>>>
>>> }
>>> ?>
>>> </div></td>
>>>
>>> </tr>
>>> </table>
>>> <p align="center"><a href="pranikah.php?id=<? echo
>>>$id - 1;?>">back</a> | <a
>>>href="index.php?halaman=foto_pranikah">home</a> | <a
>>>href="pranikah.php?id=<? echo $id + 1;?>">next </a></p>
>>>
>>>
>>>
>>>
>>=======================================================
>>=
>>
>>
>>>the function is if visitor visit pranikah.php file with id=1 then
>>>the foto-prewedding1.jpg will displayed.
>>>
>>>example :
>>>http://www.imelstudio.com/pranikah.php?id=1
>>>
>>>if id = 2 then the foto-prewedding1.jpg will displayed.
>>>
>>>the sample page is
>>>http://www.imelstudio.com/index.php?halaman=foto_pranikah
>>>
>>>the url contain the thumbnail of images, if you click then the
>>>pranikah.php will open with the large images.
>>>
>>>but its not working??? the images always displaying thr
>>>foto-prewedding1.jpg image. the $id dont work :(
>>>
>>>please help
>>>
>>>
>>>best regards
>>>
>>>adam
>>>
>>>
>>>
>
>
>
>
>
>
>
>The php_mysql group is dedicated to learn more about the PHP/MySQL web
>database possibilities through group learning.
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
>
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
Protect your PC from spy ware with award winning anti spy technology. It's free.
http://us.click.yahoo.com/97bhrC/LGxNAA/yQLSAA/CefplB/TM
--------------------------------------------------------------------~->
The php_mysql group is dedicated to learn more about the PHP/MySQL web database
possibilities through group learning.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php_mysql/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/