Welcome! Log In Create A New Profile

Advanced

Problem Code / Debuggingyour code

Posted by timothycoetzee 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Problem Code / Debuggingyour code
July 30, 2013 02:00PM
I created this thread so you can post your problem code and receive help from others.
Post your code and ALL relevant details including the problem you are experiencing. Screen dumps will also be helpful

Make sure to contribute and help others as well. smileys with beer
Re: Problem Code / Debugging your code
July 30, 2013 02:29PM
I'll start with a simple one.
I am experiencing the following problem:


I was reading that PHP comes with special variables called super global variables. One such example of these variables is the $_GET variable inside of which is an array that contains all the parameters that came from a form on the web.

My goal is to print to the screen, the content of the variable that the browser is sending to the server on my form.

This should be simple but it is not working:
my action.html page looks like this
Language: HTML
<form action="action.php" method="get"> Amount<input type="text" name="q" /> <input type="button" value="Show" /> </form>

Note the form="action.php" I want the form to send the value to action.php file which is in the root directory of my server

My action.php code looks like this
Language: PHP
<?PHP print_r($_GET[';q';]); ?>

Now what I should get back (according to my understanding )is when user clicks button 'show' the value entered into the text field should open in the action.php page

The problem im facing is NOTHING is happening when user clicks the button.... I'm stumped!

Any help or suggestions would be welcomed
Re: Problem Code / Debugging your code
July 30, 2013 03:29PM
I got solution to my own problem. On the HTML page I had <input type="button" /> It should read <input type="submit" />
avatar
Mac
Re: Problem Code / Debuggingyour code
July 30, 2013 04:13PM
Thank you for your initiative timothy... but it needs to be discussed under a relevant topic (See tut letter) - else this thread will become too long sad smiley So I am going to close this topic.
Sorry, you can't reply to this topic. It has been closed.