abrew108 Posted November 23, 2014 Share Posted November 23, 2014 I want to link this two file but not working, first file to make drop down option form second file to print image I can not print image ,,, can any body give advise ?? Thank you for ur help **File option reg** : $spi1s[1]="01_SAT_MAX_DUR"; $spi1s[2]="01_SAT_MAX_INT"; $spi1s[3]="01_SAT_RTN_PRD"; $spi1s[4]="01_SAT_FREQ"; $spires1 = mysql_query("SELECT SPI FROM kekeringan where SPI like '%01_SAT%'"); $spirow1=mysql_fetch_array($spires1); $spiTitle1=$spirow1["SPI"]; foreach ($spi1s as $spiTitle1) { echo "<option id=\"option\" value=\"".$spiTitle1."\" "; if (isset($_POST['plot']) && $_POST['plot'] == $spiTitle1) { echo "selected=\"SELECTED\" "; } echo "> $spiTitle1 </option>"; } echo "<br />"; echo "<br />";echo "</select></td>\n"; echo "<input id='option' type=\"submit\" name=\"getringan\" value=\"Submit\" />\n"; echo "</form>\n"; **File to print** : (isset($_POST['getringan'])){ $spi1s[1]="01_SAT_MAX_DUR"; $spi1s[2]="01_SAT_MAX_INT"; $spi1s[3]="01_SAT_RTN_PRD"; $spi1s[4]="01_SAT_FREQ"; $spires1 = mysql_query("SELECT SPI FROM ringan where SPI like '%01_SAT%'"); $spirow1=mysql_fetch_array($spires1); $spiTitle1=$spirow1["SPI"]; $image = "<div id=\"plot_res\" style='border: none;width:810px;height:610px;margin:auto;padding:auto;'>"; if ($_POST['plot'] == "01_SAT_MAX") { $image .= "<center><img src=\"../data/4_0_0.png\" /></center>"; $image .= "</div>"; echo $image; } elseif ($_POST['plot'] == "SPI_01_SAT_MAX_INT"){ $image .= "<center><img src=\"../data/4_1_0.png\" /></center>"; $image .= "</div>"; echo $image; } elseif ($_POST['plot'] == "SPI_01_SAT_RTN_PRD"){ $image .= "<center><img src=\"../data/4_2_0.png\" /></center>"; $image .= "</div>"; echo $image; } elseif ($_POST['plot'] == "SPI_01_SAT_FREQ"){ $image .= "<center><img src=\"../data/4_2_0.png\" /></center>"; $image .= "</div>"; echo $image; } else {echo "fail";} Quote Link to comment https://forums.phpfreaks.com/topic/292653-can-not-use-isset_post/ Share on other sites More sharing options...
QuickOldCar Posted November 23, 2014 Share Posted November 23, 2014 Did you paste a partial code? Should have an if here if(isset($_POST['getringan'])){ and also wrap it with another curly brace at the end Quote Link to comment https://forums.phpfreaks.com/topic/292653-can-not-use-isset_post/#findComment-1497364 Share on other sites More sharing options...
abrew108 Posted November 23, 2014 Author Share Posted November 23, 2014 (edited) Did you paste a partial code? Should have an if here if(isset($_POST['getringan'])){ and also wrap it with another curly brace at the end yes i did it, sorry not checking the paste of my code coz i am making many trial ,,, try anything ,,, but still strugling Edited November 23, 2014 by abrew108 Quote Link to comment https://forums.phpfreaks.com/topic/292653-can-not-use-isset_post/#findComment-1497365 Share on other sites More sharing options...
QuickOldCar Posted November 23, 2014 Share Posted November 23, 2014 I guess the first thing should do is add this to the top of your script error_reporting(E_ALL | E_NOTICE); ini_set('display_errors', '1'); See if there are any errors. Next can explain how it's not working, what you are not seeing or expecting. Quote Link to comment https://forums.phpfreaks.com/topic/292653-can-not-use-isset_post/#findComment-1497368 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.