brown2005 Posted January 22, 2007 Share Posted January 22, 2007 ?> <select onchange="window.open(this.options[this.selectedIndex].value,'_top')" class='text'><?echo" <option></option>";?> <?php echo' <option value="http://www.randomhomepage.co.uk/homepages/files/rate.php?id='.$id.'&rate=1"' ?> <?php Rate($page1, "1");?>>1</option> <??> <?php echo' <option value="http://www.randomhomepage.co.uk/homepages/files/rate.php?id='.$id.'&rate=2"' ?> <?php Rate($page1, "2");?>>2</option> <??> <?php echo' <option value="http://www.randomhomepage.co.uk/homepages/files/rate.php?id='.$id.'&rate=3"' ?> <?php Rate($page1, "3");?>>3</option> <??> <?php echo' <option value="http://www.randomhomepage.co.uk/homepages/files/rate.php?id='.$id.'&rate=4"' ?> <?php Rate($page1, "4");?>>4</option> <??> <?php echo' <option value="http://www.randomhomepage.co.uk/homepages/files/rate.php?id='.$id.'&rate=5"' ?> <?php Rate($page1, "5");?>>5</option> <??> <?php echo' <option value="http://www.randomhomepage.co.uk/homepages/files/rate.php?id='.$id.'&rate=6"' ?> <?php Rate($page1, "6");?>>6</option> <??> <?php echo' <option value="http://www.randomhomepage.co.uk/homepages/files/rate.php?id='.$id.'&rate=7"' ?> <?php Rate($page1, "7");?>>7</option> <??> <?php echo' <option value="http://www.randomhomepage.co.uk/homepages/files/rate.php?id='.$id.'&rate=8"' ?> <?php Rate($page1, "8");?>>8</option> <??> <?php echo' <option value="http://www.randomhomepage.co.uk/homepages/files/rate.php?id='.$id.'&rate=9"' ?> <?php Rate($page1, "9");?>>9</option> <??> <?php echo' <option value="http://www.randomhomepage.co.uk/homepages/files/rate.php?id='.$id.'&rate=10"' ?> <?php Rate($page1, "10");?>>10</option> <?echo" </select>";i need to change all the above into php, if someone could point me in the right direction with the select bit and the first option i could do the rest, thanks in advance...p.s. i have tried but when i go onto page it comes up blank..thanks in advance Link to comment https://forums.phpfreaks.com/topic/35232-writing-in-php/ Share on other sites More sharing options...
trq Posted January 22, 2007 Share Posted January 22, 2007 Um... it is in php. Link to comment https://forums.phpfreaks.com/topic/35232-writing-in-php/#findComment-166362 Share on other sites More sharing options...
Jessica Posted January 22, 2007 Share Posted January 22, 2007 What does Rate() do?This should be close, depending on what Rate() is for.[code]for($i=1; $i<=10; $i++){ echo '<option value="http://www.randomhomepage.co.uk/homepages/files/rate.php?id='.$id.'&rate='.$i.'">'.$i.'</option>'; Rate($page1, $i);}[/code] Link to comment https://forums.phpfreaks.com/topic/35232-writing-in-php/#findComment-166367 Share on other sites More sharing options...
brown2005 Posted January 22, 2007 Author Share Posted January 22, 2007 what I mean is that i want to get rid of all the <? and ?> Link to comment https://forums.phpfreaks.com/topic/35232-writing-in-php/#findComment-166379 Share on other sites More sharing options...
trq Posted January 22, 2007 Share Posted January 22, 2007 [quote]what I mean is that i want to get rid of all the <? and ?>[/quote]Are your fingers broken? Well do it. Were not here to write out code for you. Link to comment https://forums.phpfreaks.com/topic/35232-writing-in-php/#findComment-166385 Share on other sites More sharing options...
brown2005 Posted January 22, 2007 Author Share Posted January 22, 2007 yes but what i am saying is how I would usually do it i cant get it to work. Link to comment https://forums.phpfreaks.com/topic/35232-writing-in-php/#findComment-166396 Share on other sites More sharing options...
redbullmarky Posted January 22, 2007 Share Posted January 22, 2007 then post the result of your attempt and we can go from there.... Link to comment https://forums.phpfreaks.com/topic/35232-writing-in-php/#findComment-166398 Share on other sites More sharing options...
Jessica Posted January 22, 2007 Share Posted January 22, 2007 Uhm, did you try what I posted? Link to comment https://forums.phpfreaks.com/topic/35232-writing-in-php/#findComment-166402 Share on other sites More sharing options...
brown2005 Posted January 22, 2007 Author Share Posted January 22, 2007 hi, i have triedecho" <font class='text_red_bold'>Rate: </font>";echo' <select class="text_red_bold" onchange="window.open(this.options[this.selectedIndex].value,\_top\)">';echo' <option></option>'; for($i=1; $i<=10; $i++) {echo' <option value="http://www.randomhomepage.co.uk/homepages/files/rate.php?id='.$website_id.'&rate='.$i.'">'.$i.'</option>'; Rate($page1, $i); } echo' </select>'; and it doesnt do anything Link to comment https://forums.phpfreaks.com/topic/35232-writing-in-php/#findComment-166406 Share on other sites More sharing options...
Jessica Posted January 22, 2007 Share Posted January 22, 2007 Then the problem might be elsewhere. Where is $page1 defined? As I asked before, what does Rate() do? Are you getting any errors? Link to comment https://forums.phpfreaks.com/topic/35232-writing-in-php/#findComment-166408 Share on other sites More sharing options...
brown2005 Posted January 22, 2007 Author Share Posted January 22, 2007 i have thatfunction Rate($page, $file){ if ($page == $file) echo "selected=\"selected\"";} and it goes to http://www.randomhomepage.co.uk/homepages/files/rate.php file Link to comment https://forums.phpfreaks.com/topic/35232-writing-in-php/#findComment-166417 Share on other sites More sharing options...
brown2005 Posted January 22, 2007 Author Share Posted January 22, 2007 hi i have seen you have put echo' <option value="http://www.randomhomepage.co.uk/homepages/files/rate.php?id='.$website_id.'&rate='.$i.'">'.$i.'</option>'; Rate($page1, $i);but this is in the <option> tag on the original, dont know if that matters Link to comment https://forums.phpfreaks.com/topic/35232-writing-in-php/#findComment-166422 Share on other sites More sharing options...
brown2005 Posted January 23, 2007 Author Share Posted January 23, 2007 sorry this Rate($page1, $i); was in the <option Rate($page1, $i);> like that.. in the original..any ideas please? Link to comment https://forums.phpfreaks.com/topic/35232-writing-in-php/#findComment-167014 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.