fatalkaiser Posted April 22, 2007 Share Posted April 22, 2007 Can it be done? Ive been searching the net for ages trying to find tutorials or examples of this, and so far come up blank. What im trying to do looks something like this. <? if ($variable == "blah") //and i made sure it did { $a = 1; $b = 2; $c = 3; }; { echo ($e . $f . $g); }; ?> Ive tried doing the above about a hundred different ways, but none of them echo the variables when the script executes. Can someone give me the correct coding for this? Quote Link to comment https://forums.phpfreaks.com/topic/48121-solved-defining-variables-within-if-statements/ Share on other sites More sharing options...
paul2463 Posted April 22, 2007 Share Posted April 22, 2007 already answered in you other post ***** DO NOT DOUBLE POST , IT WASTES THE TIME OF THE PEOPLE TRYING TO HELP YOU ******* Quote Link to comment https://forums.phpfreaks.com/topic/48121-solved-defining-variables-within-if-statements/#findComment-235171 Share on other sites More sharing options...
fatalkaiser Posted April 22, 2007 Author Share Posted April 22, 2007 I didn't mean to, my comp froze when i clicked post and i thought it didn't work. Anyways, your code worked, and thanx for the quick reply. So this topic is solved now Quote Link to comment https://forums.phpfreaks.com/topic/48121-solved-defining-variables-within-if-statements/#findComment-235174 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.