Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    3

    Default php string wont stick

    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. #2
    Member darren.nolan's Avatar
    Join Date
    Oct 2007
    Posts
    259

    Default

    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. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    3

    Default 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. #4
    Registered User
    Join Date
    Jan 2008
    Posts
    3

    Default 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. #5
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by bdatz View Post
    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?
    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. #6
    Member darren.nolan's Avatar
    Join Date
    Oct 2007
    Posts
    259

    Default

    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. #7
    Member serversphere's Avatar
    Join Date
    Jan 2004
    Posts
    658

    Default

    Quote Originally Posted by bdatz View Post
    Code:
    <!--p echo $active; if ($active){ include('message/dispmarq.php'); }-->
    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.
    Darren Benfer | SS-Darren | AIM: serversphere
    www.serversphere.com
    Dedicated Server Solutions Have Come Full Circle

  8. #8
    Member darren.nolan's Avatar
    Join Date
    Oct 2007
    Posts
    259

    Default

    Depends what he's using - but I was focusing more on the very first php include between <doctype> and <html> for include message.php

Similar Threads & Tags
Similar threads

  1. how to load php mb string
    By FreakRick in forum New User Questions
    Replies: 1
    Last Post: 02-23-2011, 05:36 AM
  2. php.ini - Stick Changes
    By grayloon in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-02-2009, 10:10 AM
  3. PHP Multibyte String Functions
    By rubykitten in forum New User Questions
    Replies: 10
    Last Post: 04-22-2009, 02:30 PM
  4. Compiling PHP with Mb String
    By nyy in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 11-21-2006, 03:59 AM
  5. Help - Apache/PHP wont compile on a new server
    By Snowman30 in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 03-24-2005, 11:39 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube