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 Quote Link to comment Share on other sites More sharing options...
trq Posted January 22, 2007 Share Posted January 22, 2007 Um... it is in php. Quote Link to comment 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] Quote Link to comment 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 ?> Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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.... Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 22, 2007 Share Posted January 22, 2007 Uhm, did you try what I posted? Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment 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.