mega77 Posted December 15, 2007 Share Posted December 15, 2007 I would like to know if there is any way to fake a variable. In the example below, is it possible to change $email to something else ? <?php $email = "myemail@mydomain.com"; print $email; ?> Quote Link to comment Share on other sites More sharing options...
Grego Posted December 15, 2007 Share Posted December 15, 2007 I assume you don't mean by just using "$email = 'something else'", but beyond that I'm not sure what you mean. Fake it on which end? And to one level? Could you explain what you really want to do? Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted December 15, 2007 Share Posted December 15, 2007 What do you mean? Please explain your question better. Ken Quote Link to comment Share on other sites More sharing options...
rab Posted December 15, 2007 Share Posted December 15, 2007 No, with the code you posted it isn't. If there was register_globals turned on and $email wasn't assigned before it was printed, then yes. Example <?php // $email was never modified so its the value you give it. print $email; // more code; ?> Although, don't depend on register_globals. Quote Link to comment Share on other sites More sharing options...
mega77 Posted December 15, 2007 Author Share Posted December 15, 2007 This situation is just theoretical. I was just wondering if a surfer-hacker could change that php variable in any possible way. Of course the surfer-hacker would not have access to my server, just surfing. I guess you are right and I'm just being paranoid here. If the variable is already set previously, there is no way... Quote Link to comment Share on other sites More sharing options...
JamieThompson90 Posted December 15, 2007 Share Posted December 15, 2007 Unless your retreiving it via $_GET['email'] then nope, if you are it can be forced through www.domain.com/?email=somethingelse Hope this helped. Quote Link to comment 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.