Welcome! Log In Create A New Profile

Advanced

Section 2 - What is a Variable in PHP?

Posted by KeeganTR 
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
Section 2 - What is a Variable in PHP?
July 25, 2011 10:05AM
Finished it with no problems or hiccups, hope it goes just as well with the rest!
The more I get into the code, the more the pattern of functionality becomes clear, I'm loving it like Timberlake!!
=D
Re: Section 2 - What is a Variable in PHP?
August 01, 2011 09:51PM
Done baby!
avatar Re: Section 2 - What is a Variable in PHP?
August 02, 2011 12:23PM
Hi,

$_POST["name"] is a variable so it can be set like

Language: PHP
$_POST["name"] = "Riaz";

There isn't any performance issue with setting custom $_POST variables without posting any data, right ?
avatar
Mac
Re: Section 2 - What is a Variable in PHP?
August 02, 2011 04:09PM
Why do you want to do that? You can just say

Language: PHP
$name='Riaz_likes_to_type_extra_characters';
avatar Re: Section 2 - What is a Variable in PHP?
August 03, 2011 08:23AM
hehe smile I actually don't like typing more than needed.

I have a form that's like this:

Language: PHP
<html> <head> <title> Contact Form </title> </head> <body>   <form name="contactForm" method="post" action="contact.php"> <input type="text" name="contact_person" value="<?php echo $_POST["contact_person"]; ?>" /> <input type="text" name="contact" value="<?php echo $_POST["contact"]; ?>" /> <input type="submit" name="submit" name="Submit" /> </form>   </body> </html>

So instead of creating an update form that's exactly the same I wanted to just fetch the data from the database create the POST variables and populate the fields.
Re: Section 2 - What is a Variable in PHP?
August 12, 2011 10:26PM
pos()funcion is used to display the current value of a variable if its used in conjunction with the echo function.it is then followed by the next.ja hey php is nicethumbs up
Sorry, only registered users may post in this forum.

Click here to login