Code Error

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
melz0625
Forum Newbie
Posts: 10
Joined: Wed Jul 01, 2009 11:21 am

Code Error

Post by melz0625 »

Why is the form not loading properly?
http://www.releaseboyz.com/form.php

Code: Select all

<?php 
 
    // ---------- CONFIG - BEGIN ---------- 
 
    // relativePathToForm is the relative path from this webpage 
    // to your form. 
    $relativePathToForm = "FORMfields/forms/generated/contact_us.php"; 
 
    // relativePathToFORMfields is the relative path from this webpage 
    // to your FORMfields directory. 
    $relativePathToFORMfields = "FORMfields"; 
 
    // ---------- CONFIG - END ---------- 
 
    require_once(dirname(__FILE__) . "/" . $relativePathToFORMfields 
        . "/FORMfields.php"); 
    $parts = preg_split("'/\\* (BEGIN|END) - SECTION [1-3] \\*/'", 
    file_get_contents(dirname(__FILE__) . "/" . $relativePathToForm)); 
 
    // There can be 6 parts or 7 parts depending on the version of FORMgen, 
    // which may or may not include the "/* BEGIN - SECTION 1 */" comment. 
    // In each case, the parts are formatted differently 
    if (sizeof($parts) == 6) { 
        $section1 = "?>" . $parts[0] . " ?>"; 
        $section2 = $parts[2] . " ?>"; 
        $section3 = $parts[4] . " ?>"; 
    } else if (sizeof($parts) == 7) { 
        $section1 = $parts[1]; 
        $section2 = $parts[3] . " ?>"; 
        $section3 = $parts[5] . " ?>"; 
    } 
 
    // Remove the require_once statements that include FORMfields.php as the 
    // path may not be correct 
    $section1 = preg_replace("'require_once\\(.*?FORMfields\\.php\"\\)\\;'", "", $section1); 
 
    eval($section1); 
?> 
 
<html>
<head>
<?php eval($section2); ?> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body,td,th {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
}
.texta { 
 font-size: 10px; 
 background-color: #FFFFFF; 
 border: 1px solid #666666; 
}
-->
</style></head>
 
<body>
<table width="200" border="0" align="center">
  <tr>
    <td><table width="200" border="0" align="left">
      <tr>
        <td><img src="releaseboyz.png" /></td>
      </tr>
      <tr>
        <td><table width="200" border="0" align="left">
            <tr>
              <td><a href="release.htm"><img src="home.png" border="0" /></a></td>
              <td><img src="blank.png" /></td>
              <td><img src="models.png" width="100" height="20" border="0" /></td>
              <td><img src="blank.png" /></td>
              <td><img src="blog.png" width="75" height="25" border="0" /></td>
              <td><img src="blank.png" /></td>
              <td><a href="contact.htm"><img src="contact.png" width="100" height="20" border="0" /></a></td>
              <td><img src="blank.png" /></td>
                <td><img src="join.png" width="75" height="25" border="0" /></td>
            </tr>
          </table>
            <p></p></td>
      </tr>
    </table>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
    <p></p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <table style="BORDER-COLLAPSE: collapse" height="1174" 
cellspacing="0" cellpadding="0" width="750" border="0">
      <tbody>
        <tr>
          <td width="245" colspan="4"><table style="BORDER-COLLAPSE: collapse" cellspacing="0" 
      cellpadding="0" width="100%" border="0">
              <tbody>
                <tr>
                  <td width="100%"><img src="becomeamodel.png" /></td>
                </tr>
              </tbody>
          </table>          </td>
          <td width="245">&nbsp;</td>
        </tr>
        <tr>
          <td colspan="4"><p>Please note all your info will be keep 
            strictly confidential and we will not sell any of your info to 
            anyone ever. Please submit at least 1 picture will your 
            application.</p>
            <p>Please fill in <b>ALL</b> the blanks, this helps your chances of modeling with us. 
              Please submit at least one picture of your face & be under 
              30 years of age. The more you are willing to do the more we 
              will pay you.<br />
                <br />
                <b>WE ARE ONLY ACCEPTING US 
                  APPLICANTS</b></p>
            <p>Will be mailed to<a href="mailto:relfvideo@yahoo.com"> relfvideo@yahoo.com</a></p></td>
          <td width="245">&nbsp;</td>
        </tr>
        <tr>
          <td height="294" colspan="4" rowspan="2"><?php eval($section3); ?> 
</td>
          <td width="245" height="294"><img src="strip.jpg" width="100" height="600" /></td>
        </tr>
        <tr>
          <td height="294">&nbsp;</td>
        </tr>
    </table>    
    <p>&nbsp;</p></td>
  </tr>
</table>
<p></p>
<p></p>
</body>
</html>
 
Last edited by melz0625 on Wed Jul 01, 2009 6:16 pm, edited 2 times in total.
BornForCode
Forum Contributor
Posts: 147
Joined: Mon Feb 11, 2008 1:56 am

Re: Code Error

Post by BornForCode »

Lol, why didn't you post all your application? :twisted:
Since you are using a library is hard for someone (which has not experience with that library) to give you an answer :)
melz0625
Forum Newbie
Posts: 10
Joined: Wed Jul 01, 2009 11:21 am

Re: Code Error

Post by melz0625 »

BornForCode wrote:Lol, why didn't you post all your application? :twisted:
Since you are using a library is hard for someone (which has not experience with that library) to give you an answer :)
Check this out.

http://www.releaseboyz.com/form.php
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: Code Error

Post by Eric! »

Your errors say it all

Code: Select all

Warning: file_get_contents(/home/release/public_html/FORMfields/forms/generated/contact_us.php) [function.file-get-contents]: failed to open stream: [b]No such file or directory in /home/release/public_html/form.php[/b] on line 18
 
Notice: [b]Undefined variable:[/b] section1 in /home/release/public_html/form.php on line 35
 
Notice: [b]Undefined variable:[/b] section2 in /home/release/public_html/form.php on line 42
If /home/release/public_html/FORMfields/forms/generated/contact_us.php
is valid, then check your permissions on the file.
Last edited by Eric! on Wed Jul 01, 2009 5:10 pm, edited 1 time in total.
BornForCode
Forum Contributor
Posts: 147
Joined: Mon Feb 11, 2008 1:56 am

Re: Code Error

Post by BornForCode »

Though was a not so great experience to see your site :twisted: what eric is trying to say is that you are giving a wrong path and the script cannot access contact.php ":)
melz0625
Forum Newbie
Posts: 10
Joined: Wed Jul 01, 2009 11:21 am

Re: Code Error

Post by melz0625 »

Can you tell me what would be the correct path?
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: Code Error

Post by Eric! »

/home/release/public_html/FORMfields/forms/generated/contact_us.php

The above path is what you're using

Where is your contact_us.php file actually located? Only you can tell us that.

Edit: Crap, I didn't look past the errors generated by your site, so after BFC's comment I regretably looked at your site again :dubious:
melz0625
Forum Newbie
Posts: 10
Joined: Wed Jul 01, 2009 11:21 am

Re: Code Error

Post by melz0625 »

contact_us.php is in that path specified. I changed the permission to 777. What else can I do? I'm thinking changing permissions on the folders?
melz0625
Forum Newbie
Posts: 10
Joined: Wed Jul 01, 2009 11:21 am

Re: Code Error

Post by melz0625 »

bump!
Post Reply