could someone explin what is going on here?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
buzzby
Forum Newbie
Posts: 9
Joined: Sun Oct 12, 2003 2:13 pm

could someone explin what is going on here?

Post by buzzby »

<?
This section sets the defaults for the scripts
$msg = "First Name:$first";
$msg .= "Last Name:$last";
$msg .= "E-mail Address:$email";
$recipient = "driscolls@sgco.com";
$subject = "Feedback from A&E Form";
$mailheaders = "From: A&E Web Site <webmaster@aehangers.com>";
$mailheaders .= "Reply-To: $email";
?>

my question isnt whether it works or not. my question is how come there are many attributes attached to the same variable.

you have $msg = $first
$msg .=$last
$msg .=$email

please explain to me what is going on!!

what is the difference between $msg and $msg .
like_duh44
Forum Commoner
Posts: 63
Joined: Sat Jul 26, 2003 6:57 pm

Post by like_duh44 »

For the:

$msg = "alkbh;alsdj";
$msg .= "lajkhoghaoerj";
$msg .= "lakjhgopqihropkgjahkjt";

There isnt any difference between $msg and $msg. The ' .= ' means that it is adding it to the end of that. So, the output of $msg would be all three entries! Hope this explains it a little better
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

Code: Select all

<?php
$text = "This ";
$text .= "is ";
$text .= "some ";
$text .="text.";

echo $text;
?>
That would print This is some text to the browser.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

buzzby
Forum Newbie
Posts: 9
Joined: Sun Oct 12, 2003 2:13 pm

getting there

Post by buzzby »

ok, i understand about including the php coding into the html files. i understand about not putting the images on the database but instead saving the filenames instead. how do i save the filenames? is it easier to just call the images by using the $image var? is there any other way to do this?

pages like phpbb.com, do they use this format of having loads of html/php files then an index file which includes (via $include variable) the other php files?

is it possible to have a php form that is a multiform. ie a button to go to the next page of the form once all the previous fields have been done?
Post Reply