johnwayne77 Posted February 2, 2007 Share Posted February 2, 2007 I am trying to make a custom tv program for my personal use. Here is the link: http://www.imobconsulting.ro/tv/program.php select 'PROTV' and hit the 'Afiseaza program button' It displays the todays program. If you hit the "maine" link above in the headers, it will display the tomorrow program. Everything ok with that. Now try again to hit the 'maine' or 'pomaine' link again. It won't work. Depending on the program I thought of a dinamic days menu (yesterday, today, tomorrow) in the headers.php Here is the code: <? $page = $_GET['program']; ?> and... <td><div align="center"><a href="main.php?program=<? echo $page; ?>3">ieri</a></div></td> <td><div align="center"><a href="main.php?program=<? echo $page; ?>">azi</a></div></td> <td><div align="center"><a href="main.php?program=<? echo $page; ?>1">maine</a></div></td> <td><div align="center"><a href="main.php?program=<? echo $page; ?>2">poimaine</a></div></td> I think you got the idea on how this works. (i host day3.php, day.php, day2.php, day1.php where day is the program i select) How can I resolve the problem I've posted above? Quote Link to comment https://forums.phpfreaks.com/topic/36794-solved-_get-variable-dynamic-menu-problem/ Share on other sites More sharing options...
johnwayne77 Posted February 2, 2007 Author Share Posted February 2, 2007 i was thinking of a solution... is there anyway I can echo only the first 3 characters from a variable? like : $variable = 'john'; echo $variable,3; so it will print: 'joh' ??? Quote Link to comment https://forums.phpfreaks.com/topic/36794-solved-_get-variable-dynamic-menu-problem/#findComment-175569 Share on other sites More sharing options...
ShogunWarrior Posted February 2, 2007 Share Posted February 2, 2007 echo substr( $variable, 0, 3 ) Quote Link to comment https://forums.phpfreaks.com/topic/36794-solved-_get-variable-dynamic-menu-problem/#findComment-175573 Share on other sites More sharing options...
.josh Posted February 2, 2007 Share Posted February 2, 2007 substr Quote Link to comment https://forums.phpfreaks.com/topic/36794-solved-_get-variable-dynamic-menu-problem/#findComment-175574 Share on other sites More sharing options...
johnwayne77 Posted February 2, 2007 Author Share Posted February 2, 2007 the substr did the job thanks Quote Link to comment https://forums.phpfreaks.com/topic/36794-solved-_get-variable-dynamic-menu-problem/#findComment-175580 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.