melloorr Posted December 21, 2011 Share Posted December 21, 2011 Okay, So I have a dropdown box: <select name="imgsize"> <option value="small">480 x 360</option> <option value="medium">720 x 540</option> <option value="big">1200 x 900</option> <option value="large">1440 x 1080</option> </select> and I have code that gets the size: $resizeimg = $_REQUEST["imgsize"]; But I cannot get it to work with an if statement: if ($resizeimg == "large") { } It just comes up with about 50 lines of gibberish. I have used error_reporting(-1); but that is not coming up with any errors. Could anyone help please. Its probably so simple, but my mind is drawing a blank Quote Link to comment https://forums.phpfreaks.com/topic/253620-stupid-simple-variable-help/ Share on other sites More sharing options...
scootstah Posted December 21, 2011 Share Posted December 21, 2011 Post the "gibberish"? Quote Link to comment https://forums.phpfreaks.com/topic/253620-stupid-simple-variable-help/#findComment-1300163 Share on other sites More sharing options...
PFMaBiSmAd Posted December 21, 2011 Share Posted December 21, 2011 Also, don't use $_REQUEST. It combines post, get, cookie variables and at some point in time, it will burn you while trying to get an expected value. Use the correct $_POST or $_GET variable that you expect the data to be in. Quote Link to comment https://forums.phpfreaks.com/topic/253620-stupid-simple-variable-help/#findComment-1300165 Share on other sites More sharing options...
melloorr Posted December 21, 2011 Author Share Posted December 21, 2011 Post the "gibberish"? This is just 2 lines of the gibberish: ÿØÿàJFIFÿþX5)Yõ^Vüü×éó¿„>]_È‹od÷.ÒìÀ,1g4Ó9T‰OPd`ð‚Hèï|*²²hÖêÕ.‰]¶vHËj’I1UšeÜFóÃ8æV"¾€³ðZY[Ákå˜Ô¶Û{Kx£¶´i –¹’EIþ`ÊóÒÉ€ÇÖ´_…šÌ« Õ½½ìû£% ²,‘¤Šß1¤7$!¶Y6ìe,6}E,6 O MR„~×*ç’ÒÏ›tß“íæß*ÕjÊîZúí¶ºéò^zcá6µ†EÓÝndEaonÐÁÈåaéó*"¡aó³‘ì¾[ßk6GÄ7Pù’Îtöš\î¸ß,`,@‡òƒeØ,a0VïW@Ô Š(e†ÛK’6ƒlöìØ ¾YYeR¬3,m;Ùà=ׂ ¸:ÆŸ§=ö•¥èÞéëÚÝÑkM§YKö‰ö§s3Ϲu½¬òÚÃ4ÒÄd‰å;ƔҕHF1r”¤¢’Wm¶¦Ë»Vî„¢Ò瓲I»½©%{Û§[j÷Ø÷Má~¤Gv:z*Â0ŒËÊç;Šª¨Xœ’ˆ¤ô-×%oëßô‹:QðÑüEA~–icq¢x…ïch·3ÛOmkQ2ÊÈŠÚ…Í”2î"ª;êýC¾«UZÛÁÅëk;JÏ[§{t¬]š©Oå(éªßWëéCù¢Š+ðÓéŠ( Š( Š( Š( Š( Š( Š( œªX€2Iô?—z|0K;¬q!vržøÏÐW²ø+áÕÍô‘Ou8f]ª²I m@9f9ÀäõèåÙf+2Xzr•ä“Ÿ,Si;»[C*µ¡F.S’Vé}_ËësŠð÷ƒïµyP´l°¶2JN~¿áÔb¾¥ðÂYîž$´³y9O2o(²¯#©Æ3×;ˆç¯sðGÁ¯² Also, don't use $_REQUEST. It combines post, get, cookie variables and at some point in time, it will burn you while trying to get an expected value. Use the correct $_POST or $_GET variable that you expect the data to be in. I used $_POST but I am still getting the gibberish. I am using elseif statements too, could that be the problem? if ($resizeimg == "small") { } elseif ($resizeimg == "medium") { } elseif ($resizeimg == "big") { } elseif ($resizeimg == "large") { } else { echo "Error";} And I dont get see the echo "Error" either Quote Link to comment https://forums.phpfreaks.com/topic/253620-stupid-simple-variable-help/#findComment-1300171 Share on other sites More sharing options...
mikosiko Posted December 21, 2011 Share Posted December 21, 2011 I don't see any echo in the code that you posted (except your echo "error") that could produce your "gibberish", but I could bet that you are trying to echo an image file... post your relevant code Quote Link to comment https://forums.phpfreaks.com/topic/253620-stupid-simple-variable-help/#findComment-1300178 Share on other sites More sharing options...
melloorr Posted December 21, 2011 Author Share Posted December 21, 2011 I don't see any echo in the code that you posted (except your echo "error") that could produce your "gibberish", but I could bet that you are trying to echo an image file... post your relevant code It's okay, I just solved the problem. It turns out it was my stupidity. The form asks for a place to save the image, but I wasn't giving it anywhere to save it to, so it came up with all that. Sorry Quote Link to comment https://forums.phpfreaks.com/topic/253620-stupid-simple-variable-help/#findComment-1300182 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.