IBTrey Posted October 27, 2014 Share Posted October 27, 2014 Hey guys, I'm a newby to PHP and coming from a few years of HTML and CSS it's kinda confusing to me. I'm getting the hang of it but I'm stuck. I have a form and I need to post that data to a different page, I have: $Events = $_REQUEST; but it posts Array. I need to post the form data from my other page, if I do a var_dump it shows my "test" (value I entered) but on the other page shows Array. I've been given a hint by a friend who is helping me with php: $Events = new GalaxyEvents(); Though I'm not sure as to what it means.. can anyone help? :-) Quote Link to comment https://forums.phpfreaks.com/topic/292089-variable-new/ Share on other sites More sharing options...
Barand Posted October 27, 2014 Share Posted October 27, 2014 That var_dump of $_REQUEST should tell you all you need to access the value that you want from the posted data. And as for $Events = new GalaxyEvents(); That should create an object of class GalaxyEvents. Quote Link to comment https://forums.phpfreaks.com/topic/292089-variable-new/#findComment-1494895 Share on other sites More sharing options...
IBTrey Posted October 27, 2014 Author Share Posted October 27, 2014 Ah I seeee so it creates a class... Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/292089-variable-new/#findComment-1494896 Share on other sites More sharing options...
jcbones Posted October 27, 2014 Share Posted October 27, 2014 No it instantiates an existing class, and creates an object. In order to access the values, you need to call the indexes. $events = $_POST['test']; PS. Don't use $_REQUEST, it opens up insecurities that you could do without. Quote Link to comment https://forums.phpfreaks.com/topic/292089-variable-new/#findComment-1494916 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.