0

My php code will not execute and I'm not sure why. Below is the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Before.html </title>
<meta name="Generator" content="Alleycode HTML Editor" />
<meta name="Description" content="Your description here..." />
<meta name="Keywords" content="Your keywords here..." />
</head>

Before #1, Test php
<br />

<?php
echo "Hello World!; <br> 
?>

<br />
Before #2, Variables
<br />

<?php
$name = "Name
$age = Age;
echo "My name is $name and I am $age years old.";
?>

<br />
Before #3, Comments
<br />

<?php
//-----------------------------------------variables------------------------------------
$name = "Name";
$age = Age;
$color = "Color" ;
echo "Welcome<br>";
echo "Enjoy it?<br>";
echo "Messages<br>";
?>

<body>
</body>
</html>

Any suggestions would be greatly appreciated
Thanks
Tina

Edited by Dani: Formatting fixed

4
Contributors
8
Replies
44
Views
4 Years
Discussion Span
Last Post by amith_ami
0

@tinabina22

My php code will not execute and I'm not sure why. Below is the code:

I think in the future try to copy and paste you code correctly.

Regarding about the issue you are having:

Where is your query?

What error are you getting?

The reason why I ask because you didn't mention it at all?

How can you expect someone or anyone understand what you are talking about.

0

I did paste the code as it reads. Query? No error, I am new to php so I gues I "expected" someone with experience to have some idea what I was talking about!
I don't see where being rude is any help!

This is what I get when I bring up the code, remember I am new at this:

Before #1, Test php
?>
Before #2, Variables

Before #3, Comments
"; echo "Enjoy it?
"; echo "Messages
"; ?>

0

@tinabina22

I did paste the code as it reads.

Well, now your code is pasted correctly before it was all text and white background.

Query? No error, I am new to php so I gues I "expected" someone with experience to have some idea what I was talking about!

What is the issue then?

All I see is just echoing. How does it echo? I got no idea because there's no query.

A query is statement.

There's has to be at least a code that show what is echoing.

0

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Before.html </title>
<meta name="Generator" content="Alleycode HTML Editor" />
<meta name="Description" content="Your description here..." />
<meta name="Keywords" content="Your keywords here..." />
</head>

Before #1, Test php
<br />

<?php
echo "Hello World!; <br>
?>

<br />
Before #2, Variables
<br />

<?php
$name = "Name
$age = Age;
echo "My name is $name and I am $age years old.";
?>

<br />
Before #3, Comments
<br />

<?php
//-----------------------------------------variables------------------------------------
$name = "Name";
$age = Age;
$color = "Color" ;
echo "Welcome<br>";
echo "Enjoy it?<br>";
echo "Messages<br>";
?>

<body>
</body>
</html>

But this is the same thing I posted in the beginning?

1

You don't need to repost it again. I can see it fine now.

Make some adjustments:

<?php
$name = "Name";
$age = "Age";
echo "My name is $name and I am $age years old.";
?>

Can you explain a little more about his:

<?php
//-----------------------------------------variables------------------------------------
$name = "Name";
$age = Age;
$color = "Color" ;
echo "Welcome<br>";
echo "Enjoy it?<br>";
echo "Messages<br>";
?>

Edited by LastMitch: grammer

1

Hi double check this part

  • "" -make sure it has a opening and closing
  • ; - make sure you put it at the end of your variable and at the end of every echo
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.