Need PHP Help

Community Forums/General Help/Need PHP Help

Sauer(Posted 2009) [#1]
Hi everyone,

I've started learning a little PHP since its so similar to C. I started to implement it on some websites but I just can't get it to work:
echo "<form method='post' action='contact.php'>";
  //echo "<p class="wrap">Email:</p>";
  echo "<input name='email' type='text' /><br />";
  //echo '<p class="wrap">' . Message: . '</p>';
  echo "<br /><textarea name='message' rows='15' cols='40'>
    </textarea><br />
    <input type='submit' />
    </form>";


Its a simple email submit form. This (and the rest of the code) works, and it even sends emails. The problem I'm having is I can't get the style tags to work for 'Email' and 'Message'. I have them commented out so it will work, but uncommenting them gives me a blank web page.

I looked at a website that had something on it about style tags in echo, and tried all different arrangements of quotes, but I'm stumped on this one. I'm sure its an easy solution too ;)

Any help is greatly appreciated, thanks a ton,


TaskMaster(Posted 2009) [#2]
What is Message:? Why is it outside of the echo quotes?

If it is a variable, it needs to be $Message.


TaskMaster(Posted 2009) [#3]
Also, it is better to single quote your echos, that way you can have double quotes in your output easier.

echo '<form name="myform" action="action.php">';


TaskMaster(Posted 2009) [#4]
What does the CSS of your wrap class look like? maybe there is a mistake there as well?


GfK(Posted 2009) [#5]
Try:
echo "<p class='wrap'>Email:</p>";
and
echo "<p class='wrap'>Message:</p>";

If that doesn't work, your CSS might be stuffed.


Yahfree(Posted 2009) [#6]
//echo "<p class="wrap">Email:</p>";
Your ending the string at "wrap and starting another one... try using single quotes:

//echo '<p class="wrap">Email:</p>';


Sauer(Posted 2009) [#7]
Hey thanks guys, it was just the single/double quote thing. This website I'm working on is much better with a just a tad of PHP added, but I'm still learning :)

Thanks again,


Sauer(Posted 2009) [#8]
Hey, this isn't really PHP related but I have a quick question and didn't want to spend a whole post on it...

If I have .wma music files embedded in my website, will Mac/Linux users be able to play them? Also, after downloading, would they be able to play them on their computers?

Thanks,


Retimer(Posted 2009) [#9]
wish I could answer that but i'm not sure if they support .wma files in their native players, however many cross-platform players that a good portion of, at least mac users have (quicktime amongst many), should have support for .wma files.


Sauer(Posted 2009) [#10]
I would imagine they would support it... its a site for a music group and a lot of Mac people are musicy people so I want it to work for all.


Tricky(Posted 2009) [#11]
It can also be done like this:
echo "<p class=\"wrap\">Email:</p>";


Now I'm not into C, but I believe that worked in C in the same manner.