venom6pak Posted February 17, 2011 Share Posted February 17, 2011 hi guys ive just finished this task after hours of head scratching since svg is only really supported good in firefox and opera ive chosen firefox as my browser to view this url www.deansignori.com/phpsvgpie/index.php i do need more help with this task but a different problem (creating select box to call different stylesheet and to change from 2d - 3d i have the code set out so that i can explode any segment or change size of slices or change from 2d-3d but i have to do this manually in the code to render different piecharts im wanting to use 1 but change it using a select box and echo my variable into it basically im unsure of the syntax for this problem psuedo code for style maybe something like if select box value isset onchange stylecolour echo stylecolour if select box value isset onchange stylegrey echo stylegrey and for 3d-2d if select box value isset onchnage format3 echo format3 if select box value isset onchange format2 echo format2 this would be on my index page can anyone advise me please regards Dean Quote Link to comment https://forums.phpfreaks.com/topic/228023-php-select-box/ Share on other sites More sharing options...
denno020 Posted February 18, 2011 Share Posted February 18, 2011 You will need to use a form, obviously. Now I'm assuming that the lines saying "if select box value isset onchange stylecolour" is just your way of saying which drop down option has been selected? What you would do it this: //Have a form on your page that has an empty action (it will refresh with the same page) //At the top of your page you will have code to check if a form has been submitted, like this: if(isset($_POST["submit"])){ //Then you can do your checking of the drop downs like this if($_POST["drop_down_1"] == "styleColour"){ echo "styleColour"; //This will be echoed into your header where the style sheet is, changing which style sheet is loaded. }else{ //you can add else if, however if there is only two options, and one of the options have to be picked, the extra condition isn't needed echo "styleGrey"; } } It will be very similar above for the 2d/3d changing, just checking that corresponding drop down instead. Hope that helps Denno Quote Link to comment https://forums.phpfreaks.com/topic/228023-php-select-box/#findComment-1175933 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.