The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php string wont stick

Discussion in 'General Discussion' started by bdatz, Jan 13, 2008.

  1. bdatz

    bdatz Registered

    Joined:
    Jan 13, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I am kind of new to this but I put a PHP include string in an html page via the file manager and it doesn't show up on the web. It completely disappears from the source code when you view source on the web page,:( but it's still there in the cpanel version. How can this be remedied?
     
  2. darren.nolan

    darren.nolan Well-Known Member

    Joined:
    Oct 4, 2007
    Messages:
    259
    Likes Received:
    0
    Trophy Points:
    16
    Hey,

    Can you post all your code in the two files. The string being included and the file that calls the string up with include?
     
  3. bdatz

    bdatz Registered

    Joined:
    Jan 13, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    php string won't stick: reply to reply

    Thanks for the reply. I hope this is what you were asking for...

    First is the code right out of cpanel, where it's all one big block of type. Then I'll follow with the other code as it appears online, but I had to cut it to fit the maximum allowed on this forum... you can view the complete source at www.thecenteredplace.com on the index page.

    The client knocked out some coding messing around in cpanel. The include statement at the top was what I re-inserted from the previous version of the page. I did not design this site; I think it was built with Front Page and since I use Dreamweaver I just tried cpanel to avoid compatibility issues with php.

    OK here is cpanel:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <? include('message/message.php'); ?> <html> <head> <title>"Bliss" or Svaroopa Yoga - The Centered Place</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta http-equiv="Content-Language" content="en-us"> <link media="all" href="styles.css" type="text/css" rel="stylesheet"> <meta content="The Centered Place located in Central Massachusetts offers Svaroopa yoga classes, workshops and yoga retreats. Hatha Yoga Svaroopa style is a therapeutic style of Hatha Yoga." name="description"> <meta content="FrontPage.Editor.Document" name="ProgId"> </head> <body background="images/back.gif"> <center> <table height="324" cellspacing="0" cellpadding="0" width="770" bgcolor="#ffffff" border="0"> <tbody> <tr> <td width="100%" height="168"> <p align="center"><img height="148" alt="" src="images/mainphoto.gif" width="770" border="0"></p></td></tr> <tr> <td valign="top" width="112%" height="388"> <div align="center"> <table id="table1" width="750" border="0"> <tbody> <tr> <td align="center" colspan="3"> <div align="right"> <table id="table5" cellspacing="0" cellpadding="0" width="74%" align="center" border="0"> <tbody> <tr> <td><i><font face="Arial" color="#427d7b" size="5">The heart of yoga in Central Massachusetts</font></i></td></tr></tbody></table></div></td></tr> <tr> <td valign="top" align="center" width="145" rowspan="2"><b> <div class="menu"><font face="Arial"><a class="menu" href="svaroopa.htm">SVAROOPA YOGA</a></font> <hr color="#74d5d2"><a class="menu" href="yogaclasses.htm">CLASSES</a> <hr color="#74d5d2"><a class="menu" href="workshops.htm">WORKSHOPS</a> <hr color="#74d5d2"><!-- <a class= "menu" href="retreats.htm">RETREATS</a><hr color="#74D5D2"> --><a class="menu" href="contact.htm">CONTACT US</a> <hr color="#74d5d2"><a class="menu" href="index.html">HOME</a> <hr color="#74d5d2"><a class="menu" href="aboutus.htm">ABOUT US</a> <hr color="#74d5d2"><a class="menu" href="faq.htm">Q & A</a></div><br> 286 Bridge Street<br> Warren<br> Massachusetts<br> 01083-1210<br> <br> <b><font size="4">800-815-7374</font></b><br> </b></td> <td align="center" width="250"> </td> <td align="center"> <p align="center"> </p></td></tr> <tr> <td valign="top" align="center" colspan="2"> <div align="right"> <table id="table4" width="554" border="0"> <tbody> <tr> <td valign="top" align="center" width="250"><img height="300" alt="" src="images/HomePage.jpg" width="273" border="0"></td> <td valign="top" align="center"> <div class="lspace" align="left"><b><font face="Arial"><a href="svaroopa.htm"><font color="#427d7b" size="4">Svaroopa Yoga</font></a></font></b> is a gentle style of hatha yoga suitable for every body. You do not have to be flexible. Flexibility is the outcome, as well as better health, more vitality, reduced stress, and much more. Svaroopa yoga effectively relaxes the body and calms the mind. It enables you to open to the innermost dimensions of your true nature that is bliss.<br> <br> <!-- <a target="_blank" href="docs/schedule.pdf">Click here to download our class schedule</a> -->Our 2008 workshop schedule will be ready soon. </div> <div class="lspace" align="left"> </div> <div class="lspace" align="left"><strong><font color="#cc0000"><font color="#cc0099">This website is under reconstruction. Stay in touch.</font> </font></strong></div> <p class="lspace" align="left"> </p> <p class="lspace" align="left"> </p> <div class="small"> <p align="left"><br> </p></div> <div class="lspace"> </div></td></tr></tbody></table></div></td></tr> <tr> <td align="center" width="145"> </td> <td align="center" width="250"> </td> <td align="center"> </td></tr> <tr> <td align="center" width="145"> <p align="center"> </p></td> <td align="center" colspan="2"> <table id="table2" height="31" cellspacing="0" cellpadding="0" width="100%" border="0"> <tbody> <tr> <td align="center" width="27%" height="31"><a href="svaroopa.htm"><font face="Arial" color="#0000ff" size="2">SVAROOPA YOGA</font></a></td> <td align="center" width="21%" height="31"><a href="yogaclasses.htm"><font face="Arial" color="#0000ff" size="2">CLASSES</font></a></td> <td align="center" width="23%" height="31"><a href="workshops.htm"><font face="Arial" color="#0000ff" size="2">WORKSHOPS</font></a></td><!-- <td width="29%" height="31" align="center"><a href="retreats.htm"> <font face="Arial" color="#0000FF" size="2">RETREATS</font></a></td> --></tr></tbody></table> <table id="table3" height="29" cellspacing="0" cellpadding="0" width="100%" border="0"> <tbody> <tr> <td align="center" width="27%" height="29"><a href="contact.htm"><font face="Arial" color="#0000ff" size="2">CONTACT US</font></a></td> <td align="center" width="21%" height="29"><a href="index.html"><font face="Arial" color="#0000ff" size="2">HOME</font></a></td> <td align="center" width="23%" height="29"><a href="aboutus.htm"><font face="Arial" color="#0000ff" size="2">ABOUT US</font></a></td> <td align="center" width="29%" height="29"><a href="resources.htm"><font face="Arial" color="#0000ff" size="2">RESOURCES</font></a></td></tr></tbody></table></td></tr></tbody></table></div></td></tr></tbody></table><br> <table cellspacing="0" cellpadding="0" width="770" bgcolor="#ffffff" border="0"> <tbody> <tr> <td width="100%"> <p align="center"><font size="1">Disclaimer: This website is created and maintained by The MarketingPlace (<a href="http://www.yourmarketingplace.com">www.yourmarketingplace.com</a>). While every attempt is made to ensure that the information provided is correct, no warranty is made as to its accuracy, and no liability for its use, or misuse, will be accepted. All names and logos used herein this website are trademarks or registered trademarks of their respective owners and are used for identification purpose only </font></p></td></tr></tbody></table></center><!--p echo $active; if ($active){ include('message/dispmarq.php'); }--> </body> </html>

    Now here is the page coding

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


    <html>

    <head>

    <title>"Bliss" or Svaroopa Yoga - The Centered Place</title>

    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

    <meta http-equiv="Content-Language" content="en-us">

    <link media="all" href="styles.css" type="text/css" rel="stylesheet">

    <meta content="The Centered Place located in Central Massachusetts offers Svaroopa yoga classes, workshops and yoga retreats. Hatha Yoga Svaroopa style is a therapeutic style of Hatha Yoga." name="description">

    <meta content="FrontPage.Editor.Document" name="ProgId">

    </head>

    <body background="images/back.gif">

    <center>

    <table height="324" cellspacing="0" cellpadding="0" width="770" bgcolor="#ffffff" border="0">

    I had to cut it here; I believe other than the top include statement they are identical, no?
    Thanks again
     
  4. bdatz

    bdatz Registered

    Joined:
    Jan 13, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    php wont stick: This file may also be what you asked for

    The code for dispmarq.php, the file that I believe calls the string up with the include is:

    <? require_once('message.php'); ?>
    <div style="position:absolute; top: 0; left: 0; font-size: 26px; color: #ff0033; background: cyan;">
    <marquee behavior="scroll" direction="left" height="24px" width="100%" scrollamount="2" scrolldelay="65">
    <b><?echo $message; ?> </b>***
    </marquee></div>
     
  5. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    PHP is server-side code, meaning when you go to view source of the page when you request it in your web browser, the PHP code will not appear.

    You may wish to check the error_log file in the directories of the files from which you are calling PHP to see what that file says may be going wrong. If those files do not exist, then it is likely that the page is functionally working properly, but there may be a logic flaw in message.php preventing it from properly displaying a message on those pages.
     
  6. darren.nolan

    darren.nolan Well-Known Member

    Joined:
    Oct 4, 2007
    Messages:
    259
    Likes Received:
    0
    Trophy Points:
    16
    Have you tried
    Code:
    <?php require_once ('./message.php'); ?>
    Note the ./ before what you are calling. Depends on your PHP setup, but it's good programming practice anyway.

    Also - as David said, there may also be something wrong with the way message.php is setup/written. Just go over your code in that file in particular (if the above suggestion doesn't work) and make sure all your code is right.
     
  7. mctDarren

    mctDarren Well-Known Member

    Joined:
    Jan 6, 2004
    Messages:
    664
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    Wow. Okay, it looks like you are expecting the file dispmarq.php to be included at the bottom of the page. If so, you've done your include wrong. Replace this:
    Code:
    <!--p echo $active; if ($active){ include('message/dispmarq.php'); }-->
    with this:
    Code:
    <?php echo $active; if ($active){ include('message/dispmarq.php'); } ?>
    and see how you make out. What you have is a server side include for Apache, not a PHP include.
     
  8. darren.nolan

    darren.nolan Well-Known Member

    Joined:
    Oct 4, 2007
    Messages:
    259
    Likes Received:
    0
    Trophy Points:
    16
    Depends what he's using - but I was focusing more on the very first php include between <doctype> and <html> for include message.php
     
Loading...

Share This Page