Connecting...

This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of Introduction to PHP
For more information, please see full course syllabus of Introduction to PHP
Introduction to PHP Accessing Form Data in PHP
Lecture Description
In this lesson our instructor talks about accessing form data in PHP. First he discusses the $_GET array, name form, and using arrays with input controls. Then he talks about indexed array form, associative arrays with input controls, and echo form. Lastly, he lectures on outputting arrays in string and some homework challenges.
Bookmark & Share
Embed
Share this knowledge with your friends!
Copy & Paste this embed code into your website’s HTML
Please ensure that your website editor is in text mode when you paste the code.(In Wordpress, the mode button is on the top right corner.)
×
Since this lesson is not free, only the preview will appear on your website.
- - Allow users to view the embedded video in full-size.
Next Lecture
Previous Lecture
0 answers
Post by Kitt Parker on January 7, 2015
The curly brace method for multidimensional arrays throws me off a bit. I feel like it breaks consistency and thus is not ideal. I would think the ideal solution would have been to just call a multi-dimensional array value with the same syntax. I wonder why it turned out this way.
0 answers
Post by Anand Richard on July 8, 2013
I keep getting merely the echo'ed statements and not the $_GET array values at all. I have copied the code exactly as it is but no results.
0 answers
Post by eoctech21 on May 22, 2013
Is it possible to submit the form to it's own unique page? To somehow change the action in <form method="get" action="test.php"> and have it be a randomly generated number, similar to how uploading a YouTube video works.
I don't want the information I store in the form to be lost as soon as I get off the page. Users should be able to just copy/paste the link and see what I put.
0 answers
Post by Dixon Kavanaugh on April 25, 2013
Hi,
Jut a point of clarification for my own understanding. In the homework solutions folder step-4 you have given the names "accountIndexed" & "accountAssoc" - these are names you are using not required syntax, correct?
Thanks!!
3 answers
Wed Apr 11, 2012 3:41 PM
Post by David L on March 1, 2012
Hello, these videos are great. I have a question.
I wanted to test the syntax for "Outputting arrays in a string". 25:29 in the video.
My code:
<?php
$_GET['name'] = 'john';
echo "his name is $_GET[name];
?>
It yields this error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING ... on Line 3.
I have tried changing line 3 to:
echo "his name is $_GET['name']";
as well as changed the variable from $_GET to just $get.
Why is this? I am on a Mac and using XAMPP and the version PHP is 5.3.1 so I am not sure that is the reason for the error. Old version maybe?