Jump to content

Stupid simple variable help


melloorr

Recommended Posts

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

Link to comment
Share on other sites

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ðÑ­üE­A~–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+2­Xzr•ä“Ÿ,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

Link to comment
Share on other sites

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  :-[

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.