Jump to content

html and php


Porkie

Recommended Posts

im confused with an error i get with this code

 

echo '<div id="leftalign">';
echo '<div id="style1">';
echo '[site News]'.'          '.'<a href="admin.php">Edit Details</a>'.'  '.'<a href="admin.php">Competitions</a>'.'  '.'<a href="admin.php">Contact Us</a>';;
echo '</div>';
echo '<hr>';
echo '<form method="post" enctype="multipart/form-data">;
<br />;
Password:                <input type="text" name="password" value="<?php echo $stuff['password']; ?>" /><br /><br />;
Email:                      <input type="email" name="email" value="<?php echo $stuff['email']; ?>"  /><br /><br />;
Membership Type:     <select name="type">
<option value="Music Enthusiast">Music Enthusiast</option>
    <option value="Band Member"<?php if ($stuff['type'] == 'Band Member') { echo ' Selected="selected"'; } ?>>Band Member</option>
</select><br /><br />';

 

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/myuklive/public_html/test3.php on line 96

 

line 96 being,

 

Password:                <input type="text" name="password" value="<?php echo $stuff['password']; ?>" /><br /><br />;

 

any help is appreciated :D

 

regards

Link to comment
Share on other sites

You cannot place PHP tags within an echo statement

echo '<form method="post" enctype="multipart/form-data">;
<br />;
Password:                <input type="text" name="password" value="<?php echo $stuff['password']; ?>" /><br /><br />;
Email:                      <input type="email" name="email" value="<?php echo $stuff['email']; ?>"  /><br /><br />;
Membership Type:     <select name="type">
   <option value="Music Enthusiast">Music Enthusiast</option>
    <option value="Band Member"<?php if ($stuff['type'] == 'Band Member') { echo ' Selected="selected"'; } ?>>Band Member</option>
</select><br /><br />';

 

The above should be coded as

 

echo '<form method="post" enctype="multipart/form-data">;
<br />;
Password:                <input type="text" name="password" value="' . $stuff['password'] . '" /><br /><br />;
Email:                      <input type="email" name="email" value="' . $stuff['email'] . '"  /><br /><br />;
Membership Type:     <select name="type">
   <option value="Music Enthusiast">Music Enthusiast</option>
    <option value="Band Member"' . (($stuff['type'] == 'Band Member') ? ' Selected="selected"' : null) . '>Band Member</option>
</select><br /><br />';

Link to comment
Share on other sites

echo '<form method="post" enctype="multipart/form-data">;

<br />;

 

Should be

 

echo '<form method="post" enctype="multipart/form-data">

<br />';

 

You really need to check that code over.  Are you meaning to exit out of php after line 94? if so you will need to change all lines afterwards as HTML does not use ; to close.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.