Jump to content

Recommended Posts

Hi, i'm new to this PHP thing, so I am a bit slow, but most of you guys know what your on about.

Basicly, I am making a really simple script, I am not that great with PHP but using some tutorials and some previous scripts I attempted to make one.

Now, as you can see, it doesn't work.

[a href=\"http://www.phulldesigns.com/masiv.html\" target=\"_blank\"]PAGE WITH PHP PROBLEM LINK[/a]

Basically, it doesn't send or display the page which confirms it has been sent!!! So its kind of useless!

I was hoping someone could fix the script and maybe instead of telling someone it has been sent, just make it redirect back to the page they were on?

The script has been attached below.

[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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Phull Designs | New Site Coming Soon</title>
<style type="text/css">
<!--
.style1 {
    font-family: Tahoma;
    font-size: 11px;
}
.style2 {font-family: Tahoma; font-size: 11px; font-weight: bold; }
.style3 {color: #666666}
.style4 {color: #D58E3E}
.style5 {font-family: Tahoma; font-size: 11px; color: #333333; }
.style6 {font-family: Tahoma; font-size: 11px; font-weight: bold; color: #333333; }
-->
</style>
</head>

<body>
<table width="800" border="0" align="center">
  <tr>
    <td width="800"><img src="images/header.png" alt="Phull Designs | Masiv Studio's" width="800" height="194" /></td>
  </tr>
  <tr>
    <td align="left" valign="middle"><p class="style2"><span class="style4">Latest</span> | <span class="style3">News</span></p>
      <p class="style6">1st June 2006</p>
      <p class="style5">Over the past 6 months, Phull Designs has decided to diversify  into different parts of designing (other than web designing) and will now start  to include business card designing, leaflets/brochure, posters etc. More  details will be available in the near future. <br />
        </p>
      <p class="style5">From the 1st June 2006, Phull Designs will begin to work with  Masiv Studio's. Masiv Studio's is a well established multimedia designing  company which has a number of satisfied customers. To help diversify into the  wide market, Phull Designs will work with Masiv Studio's to help its clients  achieve the truly distinctive and efficient ethos they aim for.<br />
      </p>
      <p class="style5">More details will be available in the near future, however if  you are an interested client who needs more information about the existing new solutions  available please fill out the form below or follow the links.</p>
      <p class="style5">Thank You,</p>
      <p class="style6">// Phull Designs </p>
      <table width="815" border="0">
        <tr>
          <td width="809" height="3"><img src="images/h-line.png" width="800" height="1" /></td>
        </tr>
      </table>
      <p class="style6"><span class="style4">Further</span>| <span class="style3">Information</span> </p>
      <form method="post" action="<?php echo $PHP_SELF?>">
        <table width="800" border="0">
            <tr>
              <td width="27" height="40" valign="middle"><div align="right" class="style5">Name</div></td>
              <td width="179" valign="middle"><input name="Name" type="text" class="style5" id="Name" value="Your Name" size="25" maxlength="30" /></td>
              <td width="102" valign="middle"><div align="right" class="style5">E-Mail Address              </div></td>
              <td width="170" valign="middle"><input name="EMail Address" type="text" class="style5" id="EMail Address" value="Your E-Mail Address" size="25" maxlength="30" /></td>
              <td width="105"><div align="right" class="style5">Telephone Number </div></td>
              <td width="191"><input name="Telephone" type="text" class="style5" id="Telephone" value="Your Telephone Number" size="25" maxlength="30" /></td>
            </tr>
          </table>
        <p>
        <input name="submit" type="submit" value="Submit" />
        <?php
if ($submit) {
  $tomail = "sales@phulldesigns.com";
  $replyemail = "sales@phulldesigns.com";

  $Name = $_POST['Name'];
  $EMail Address = $_POST['EMail Address'];
  $Telephone = $_POST['Telephone'];

  mail($tomail, "Masiv Studio's Form Queried", "An interested client with the ID:($REMOTE_ADDR,REMOTE_HOST,HTTP_USER_AGENT) has entered the following information with regards to an interest with Phull Designs and Masiv Studios.<br><br><b>Name:</b>$Name<br><b>E-Mail Address</b> $Email Address<br><br><b>Telephone:</b> $Telephone<br><b>, "Content-Type: text/html; charset=\"ISO-8859-1\"\nFrom:$replyemail\n");

  echo "The data entered has been sent to the Sales Team @ Phull Designs. Please allow up to 48 hours for a reply..";
}
else {
?></p>
        <p class="style5"><strong>Please Note:</strong> For security reasons, your IP will be sent. Please see our <a href="privacy.html">privacy policy</a> for more details. </p>
        <table width="71" border="0" align="right">
          <tr>          </tr>
        </table>
      </form>
      
      <table width="815" border="0">
        <tr>
          <td width="800" height="3"><img src="images/h-line.png" width="800" height="1" /></td>
        </tr>
      </table>
      <p class="style2"><span class="style4">Web</span> | <span class="style3">Links</span> </p>
      <p class="style1"><a href="http://www.masivstudios.com">Masiv Studio's</a></p>
    <p class="style1"><a href="http://www.phulldesigns.com">Phull Designs </a></p>
    <p class="style1"> </p></td>
  </tr>
  <tr>
    <td bgcolor="#CCCCCC"><div align="center"><span class="style1">| - © Copyright 2006 Phull Designs. All Rights Reserved. - | </span></div></td>
  </tr>
</table>
</body>
</html>
[/code]


THANK YOU!!!!
Link to comment
https://forums.phpfreaks.com/topic/13091-simple-php-problem-for-you-clever-people/
Share on other sites

Hi , I agree with Destramic, but I also feel you need to look at the logic.

Try this
[ol type=\'1\'][*]save your page as a .php extension, not html[*]enclose all the "meat" of the page in an "if" statement[/ol]

//if the viewer has not pressed "submit", show the form
if(!$submit) {

[blockquote]//insert your HTML code for the form here[/blockquote]

}
else // if he has pressed "submit", then this is what you want him to see
{

[blockquote]Insert your copy for the "Thank you" here[/blockquote]

}
Ok I am confused!!!

I changed the e-mail address vairable. Still getting the problem:


Parse error: syntax error, unexpected T_STRING in /home/phulldes/public_html/masiv.php on line 61

With regards to putting the HTML into the PHP, I dont think I am doing it right since it removes all text.

By the way, the new link is www.phulldesigns.com/masiv.php

doesn't seem that you are closing your else brace, try this.

[code]
<?php
if ($submit) {
  $tomail = "sales@phulldesigns.com";
  $replyemail = "sales@phulldesigns.com";

  $Name = $_POST['Name'];
  $EMail Address = $_POST['EMail Address'];
  $Telephone = $_POST['Telephone'];

  mail($tomail, "Masiv Studio's Form Queried", "An interested client with the ID:($REMOTE_ADDR,REMOTE_HOST,HTTP_USER_AGENT) has entered the following information with regards to an interest with Phull Designs and Masiv Studios.<br><br><b>Name:</b>$Name<br><b>E-Mail Address</b> $Email Address<br><br><b>Telephone:</b> $Telephone<br><b>, "Content-Type: text/html; charset=\"ISO-8859-1\"\nFrom:$replyemail\n");

  echo "The data entered has been sent to the Sales Team @ Phull Designs. Please allow up to 48 hours for a reply..";
}
else {
?></p>
        <p class="style5"><strong>Please Note:</strong> For security reasons, your IP will be sent. Please see our <a href="privacy.html">privacy policy</a> for more details. </p>
        <table width="71" border="0" align="right">
          <tr>          </tr>
        </table>
      </form>
      
      <table width="815" border="0">
        <tr>
          <td width="800" height="3"><img src="images/h-line.png" width="800" height="1" /></td>
        </tr>
      </table>
      <p class="style2"><span class="style4">Web</span> | <span class="style3">Links</span> </p>
      <p class="style1"><a href="http://www.masivstudios.com">Masiv Studio's</a></p>
    <p class="style1"><a href="http://www.phulldesigns.com">Phull Designs </a></p>
    <p class="style1"> </p></td>
  </tr>
  <tr>
    <td bgcolor="#CCCCCC"><div align="center"><span class="style1">| - © Copyright 2006 Phull Designs. All Rights Reserved. - | </span></div></td>
  </tr>
</table>
</body>
</html>
<?php
} // close else brace
?>
[/code]

hope this helps...if it doesnt could you paste over the code for line 61.
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.