Jump to content

Ripping my hair out!! Know your PHP??? Please help!


fri3ndly

Recommended Posts

Hello all

 

I am not sure if this is the right place to post this but I saw some other TinyMCE problems posted here (AND I BELIEVE THIS IS MORE A PHP PROBLEM).

 

If anyone can help me I would be very very greatful!!!!

 

Ok, so I have tinyMCE working on my site and everything works, the save feature etc...

 

BUT

 

All justified text is lost and images are not showing up after the file has been saved in the editor.

 

Div tags and image tags are appearing to have random "\" tags inside them which is making the html not work properly. I believe it may have something to do with this script towards the bottom of the page on my index page (Any PHP whizzkids out there, you will probably be able to see why instantly):

 

 

<?php
include("../header.html");

// Get the page name from the query string
$page = $_GET['page'] . '.txt';

if (!$_GET['page']) {
  echo("<h1>Page name not specified</h1>\n");
  include("../footer.html");
  exit;
}

if ($_POST['page']) {
  $handle = fopen("../pages/$page", 'w');
  fwrite($handle, $_POST['page']);
  fclose($handle);
  include("../pages/$page");
  include("../footer.html");
  exit;
} 

if (file_exists("../pages/$page")) {
  $FILE = fopen("../pages/$page", "rt");
  while (!feof($FILE)) {
    $text .= fgets($FILE);
  }
  fclose($FILE);
} else {
   echo("<h1>New Page: $page</h1>\n");
  $text = "<p></p>";
}

echo <<< EOM
<div align="center">
<script language="javascript" type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
valid_elements : "[*]",
invalid_elements : "",
    content_css : "style.css"
      


});
</script>
EOM;

$page = $_GET['page'] . '.txt';
$a = $_GET['page'];



$a = 1; //$_SERVER['PHP_SELF'];

$this_page = $_SERVER['PHP_SELF'];
$query_string = $_SERVER['QUERY_STRING'];
echo("<form method=\"post\" action=\"$this_page?$query_string\">\n");
echo("<textarea id=\"page\" name=\"page\" rows=25 cols=80>\n");
echo(htmlspecialchars($text));
echo("</textarea>\n");
echo("<input type=\"submit\" value=\"Save\">\n");
echo("</form>\n");

include("../footer.html");

?> 

</div>

 

 

THANK YOU!

Link to comment
Share on other sites

Thanks...

 

I tried that code you wrote and replaced the htmlspecialchars code I already had, and now it does not appear to be updating the page with what I write, but when I revisit the page (not in editing mode) it displays the original text but not formatted :(

 

I am so confused with this one, been trying things all day lol

Link to comment
Share on other sites

Ok, I have done a test on one of the pages code before I have edited it using tinymce and after.

 

Script Before:

<div class="tnew" style="padding-left:20">
          <p align="justify"><strong>At Space we  work vertical markets enabling us to specialise at mid to  senior management levels within niche business sectors. Our  consultants are perfectly positioned to understand, act upon and develop client  recruitment strategies </strong></p>
          <p align="justify"><img src="images/headers/outsourcing.jpg" width="136" height="26" /></p>
          <p align="justify">Space  are a leading supplier of mid–senior specialist management in the outsourcing  industry - we work on a global basis.</p>
          <p align="justify">We  place candidates with specialist skills throughout all aspects of outsourcing,  as detailed below:</p>
          
          <div align="justify">
              <ul>
                <li>BPO & Back office  administration</li>
                <li>Customer Management /  Contact Centre (CMO)</li>
                <li>Onshore / Offshoring</li>
                <li>ITC and Software (ITO)</li>
                <li>HR & Training  Outsourcing</li>
                <li>Debt Management</li>
              </ul>
          </div>
          <p align="justify" class="style2">We support our clients by  providing them with industry professionals who typically have expertise within  the following business verticals:</p>
          <p align="justify"><strong>Financial Services<br />
          </strong>Life and Pensions<br />
          Mortgages<br />
          Insurance</p>
          <p align="justify"><strong>Public Sector<br />
          </strong>Local & Central Government</p>
          
          <ul>
            <li>Education, Transport</li>
            <li>Health</li>
          </ul>
          <p align="justify"><strong>Utility Sector<br />
          </strong>Energy & Water</p>
          <p align="justify"><strong>Private Sector<br />
          </strong>Retail</p>
          
          <div align="justify">
              <ul>
                <li>Telecoms</li>
                <li>Travel & Leisure </li>
              </ul>
          </div>
          <p align="justify"><strong><img src="images/headers/directmarketing.jpg" width="185" height="26" /><a name="dir" id="dir"></a><br />
          </strong>Space has a dedicated team of  experienced consultants who specialise in the Direct Marketing supplier and  agency industry. In the team the consultants work within their given vertical  markets, which are divided as follows:</p>
          <p align="justify"><strong>Agency</strong><br />
          Space have established  relationships with some of the largest direct marketing and integrated agencies  in the UK.  Our established network of contacts within the market is unrivalled and  together with our pro-active networking skills puts us in a position where we  can deliver on all client assignments. Our focus within the agency market is  working with New Business, Client Services and Data Planning expertise. </p>
          <p align="justify"><strong>Database Marketing</strong><br />
            Space work with many leading suppliers of database  marketing solutions. They actively network at a mid to senior management level  and have established key industry contacts throughout the B2B and B2C markets.  Their clients provide a range of database marketing services that include:<br />
          </p>
          
          <div align="justify">
              <ul>
                <li>Database Hosting</li>
                <li>Database Analytics / Customer Insight</li>
                <li>Data Planning</li>
                <li>Data Bureau</li>
                <li>List Rental / Broking</li>
              </ul>
          </div>
          <p align="justify">Within these clients Space have filled assignments in  roles for Sales Director, Business Development Director, Business Development  Manager, Client Service Direct Director, Account Director, Pre-Sales, Channel  Partner Manager, Operations Director, Campaign Manager, Client Partner,  Business Analyst, Head of Professional Services etc. </p>
          <p align="justify"><strong>Direct Mail / Fulfilment</strong><br />
          Space Recruitment has built strategic relationships with  some of the leading suppliers of Direct Mail and Fulfilment services throughout  the UK. Space  offers their clients consultation on how to streamline their client’s  recruitment procurement process and supply high calibre candidates in both  sales and operational capacities. </p>
          <p align="justify"><strong>Telemarketing</strong><br />
          We have established ourselves as one of the leading  suppliers of senior management to outsourced call centres in the UK and Europe.  Space have an excellent network of industry professionals and have  relationships with the leading players in the market. We specialise in placing  expertise with in New Business, Client Services, Client Delivery and Operational  capacity. Our clients offer  integrated solutions across vertical markets  including financial services, telecom, travel and leisure, utilities,  government and charity.</p>
          <p align="justify"><strong><img src="images/headers/digitalmarketing.jpg" width="190" height="26" /><a name="dig" id="dig"></a></strong></p>
          <p align="justify">With the huge and growing demand from within the  marketing industry to focus on online marketing campaigns, Space set up their  Digital Division in 2004. Since its inception the team have enjoyed success in  building relationships with leading specialist Digital agencies, working on  some of the most innovative campaigns in the market. Within the digital  industry, Space has established over 2,000 contacts of professionals working  across many vertical markets and is well positioned to fulfil and deliver on  the most demanding of client requirements. Our focus is to work with New  Business, Client Services and Digital Planning expertise</p>
          <p align="justify"><img src="images/headers/contactcentre.jpg" width="171" height="21" /><a name="con" id="con"></a></p>
          <p align="justify">Space derived from placing management to the outsourced  contact centre industry. As a result of senior management often being well  suited for both in-house contact centres and outsourced contact centres, we  have been able to add significant value by providing candidates who have the  required impact on a company’s recruitment drive, due to our already  established network and expertise in this field. </p>
          <p align="justify" class="style2">Here are some examples of the job titles that we add most  value to:</p>
          
          <div align="justify">
              <ul>
                <li>Head of Offshore Programmes</li>
                <li>Head of International Operations</li>
                <li>Head of outsourcing and Alliances </li>
                <li>Head of Customer Services</li>
                <li>Contact Centre Managers</li>
                <li>Quality Managers</li>
                <li>Project Managers</li>
                <li>Resource and Planning Managers</li>
              </ul>
          </div>
          <p align="justify"><img src="images/headers/financial.jpg" width="199" height="21" /><a name="fin" id="fin"></a></p>
          <p align="justify">Space are a leading supplier of mid–senior  management throughout Financial Services. Due to the size of the market, we  have carved ourselvs a niche in which we excel due to our vertical market  expertise.</p>
          <p align="justify">The areas in which we place candidates in  financial services are detailed below:</p>
          
          <div align="justify">
              <ul type="disc">
                <li>Life and Pensions</li>
                <li>Wealth Management </li>
                <li>Invest Management</li>
                <li>Asset Management</li>
                <li>Global Custody </li>
                <li>Debt Management</li>
                <li>Mortgages</li>
                <li>Retail Banking</li>
              </ul>
          </div>
          <p align="justify" class="style2">Our  areas of expertise lie in placing candidates in:</p>
          
          <div align="justify">
              <ul type="disc">
                <li>Operations</li>
                <li>Customer service</li>
                <li>Client relationship </li>
                <li>Programme managemen</li>
              </ul>
          </div>
          <p align="justify"><img src="images/headers/sri.jpg" width="167" height="21" /><a name="sri" id="sri"></a></p>
          <p align="justify">Due to our vertical market focus we  have been able to work with board-level management and source qualified leaders  on behalf of our clients.  Continued success in this field resulted  in SRI Associates being formed; an arm of the business that specialise in  placing industry leaders. </p>
          <p align="justify">SRI Associates is committed to earning our clients’ trust  every day, on every assignment. Our clients benefit from our  unrivalled matched expertise in executive search and assessment. Our  unique, collaborative, "one firm" approach is designed to  quickly identify the highest-quality candidates. At SRI Associates, we  provide our clients with the benefit of our extensive market knowledge and the  collective expertise of our organization. SRI Associates handles a significant  number of Board appointments, including many for Chairmen, Non Executive  Directors, Chief Executives, Managing Directors and COO’s.  </p>
          <p align="justify">The philosophy of the SRI is to win repeat business from  a restricted client base. This enables us to minimise our off-limits  issues and maximise our ability to approach the best candidates for our  clients.  </p>
          <p align="justify"> This freedom to access candidates from the widest possible  universe becomes increasingly important in specialist areas when recruiting for  the most senior positions, as there are often only a limited number of  qualified people.  </p>
          <p align="justify">The team at SRI Associates is stable, experienced  and focused. We deliver exceptional work for our clients by insisting that a  partner of the Firm lead and execute each and every one of our assignments. </p>
          </div>

 

Script After:

<div><p><strong>At Space we work vertical markets enabling us to specialise at mid to senior management levels within niche business sectors. Our consultants are perfectly positioned to understand, act upon and develop client recruitment strategies </strong></p><p><img />sdghsrg</p><p>Space are a leading supplier of mid–senior specialist management in the outsourcing industry - we work on a global basis.</p><p>We place candidates with specialist skills throughout all aspects of outsourcing, as detailed below:</p><div><ul><li>BPO & Back office administration</li><li>Customer Management / Contact Centre (CMO)</li><li>Onshore / Offshoring</li><li>ITC and Software (ITO)</li><li>HR & Training Outsourcing</li><li>Debt Management</li></ul></div><p>We support our clients by providing them with industry professionals who typically have expertise within the following business verticals:</p><p><strong>Financial Services<br /></strong>Life and Pensions<br />Mortgages<br />Insurance</p><p><strong>Public Sector<br /></strong>Local & Central Government</p><ul><li>Education, Transport</li><li>Health</li></ul><p><strong>Utility Sector<br /></strong>Energy & Water</p><p><strong>Private Sector<br /></strong>Retail</p><div><ul><li>Telecoms</li><li>Travel & Leisure </li></ul></div><p><strong><img /><br /></strong>Space has a dedicated team of experienced consultants who specialise in the Direct Marketing supplier and agency industry. In the team the consultants work within their given vertical markets, which are divided as follows:</p><p><strong>Agency</strong><br />Space have established relationships with some of the largest direct marketing and integrated agencies in the UK. Our established network of contacts within the market is unrivalled and together with our pro-active networking skills puts us in a position where we can deliver on all client assignments. Our focus within the agency market is working with New Business, Client Services and Data Planning expertise. </p><p><strong>Database Marketing</strong><br />Space work with many leading suppliers of database marketing solutions. They actively network at a mid to senior management level and have established key industry contacts throughout the B2B and B2C markets. Their clients provide a range of database marketing services that include:</p><div><ul><li>Database Hosting</li><li>Database Analytics / Customer Insight</li><li>Data Planning</li><li>Data Bureau</li><li>List Rental / Broking</li></ul></div><p>Within these clients Space have filled assignments in roles for Sales Director, Business Development Director, Business Development Manager, Client Service Direct Director, Account Director, Pre-Sales, Channel Partner Manager, Operations Director, Campaign Manager, Client Partner, Business Analyst, Head of Professional Services etc. </p><p><strong>Direct Mail / Fulfilment</strong><br />Space Recruitment has built strategic relationships with some of the leading suppliers of Direct Mail and Fulfilment services throughout the UK. Space offers their clients consultation on how to streamline their client’s recruitment procurement process and supply high calibre candidates in both sales and operational capacities. </p><p><strong>Telemarketing</strong><br />We have established ourselves as one of the leading suppliers of senior management to outsourced call centres in the UK and Europe. Space have an excellent network of industry professionals and have relationships with the leading players in the market. We specialise in placing expertise with in New Business, Client Services, Client Delivery and Operational capacity. Our clients offer integrated solutions across vertical markets including financial services, telecom, travel and leisure, utilities, government and charity.</p><p><strong><img /></strong></p><p>With the huge and growing demand from within the marketing industry to focus on online marketing campaigns, Space set up their Digital Division in 2004. Since its inception the team have enjoyed success in building relationships with leading specialist Digital agencies, working on some of the most innovative campaigns in the market. Within the digital industry, Space has established over 2,000 contacts of professionals working across many vertical markets and is well positioned to fulfil and deliver on the most demanding of client requirements. Our focus is to work with New Business, Client Services and Digital Planning expertise</p><p><img /></p><p>Space derived from placing management to the outsourced contact centre industry. As a result of senior management often being well suited for both in-house contact centres and outsourced contact centres, we have been able to add significant value by providing candidates who have the required impact on a company’s recruitment drive, due to our already established network and expertise in this field. </p><p>Here are some examples of the job titles that we add most value to:</p><div><ul><li>Head of Offshore Programmes</li><li>Head of International Operations</li><li>Head of outsourcing and Alliances </li><li>Head of Customer Services</li><li>Contact Centre Managers</li><li>Quality Managers</li><li>Project Managers</li><li>Resource and Planning Managers</li></ul></div><p><img /></p><p>Space are a leading supplier of mid–senior management throughout Financial Services. Due to the size of the market, we have carved ourselvs a niche in which we excel due to our vertical market expertise.</p><p>The areas in which we place candidates in financial services are detailed below:</p><div><ul><li>Life and Pensions</li><li>Wealth Management </li><li>Invest Management</li><li>Asset Management</li><li>Global Custody </li><li>Debt Management</li><li>Mortgages</li><li>Retail Banking</li></ul></div><p>Our areas of expertise lie in placing candidates in:</p><div><ul><li>Operations</li><li>Customer service</li><li>Client relationship </li><li>Programme managemen</li></ul></div><p><img /></p><p>Due to our vertical market focus we have been able to work with board-level management and source qualified leaders on behalf of our clients.  Continued success in this field resulted in SRI Associates being formed; an arm of the business that specialise in placing industry leaders. </p><p>SRI Associates is committed to earning our clients’ trust every day, on every assignment. Our clients benefit from our unrivalled matched expertise in executive search and assessment. Our unique, collaborative, "one firm" approach is designed to quickly identify the highest-quality candidates. At SRI Associates, we provide our clients with the benefit of our extensive market knowledge and the collective expertise of our organization. SRI Associates handles a significant number of Board appointments, including many for Chairmen, Non Executive Directors, Chief Executives, Managing Directors and COO’s.  </p><p>The philosophy of the SRI is to win repeat business from a restricted client base. This enables us to minimise our off-limits issues and maximise our ability to approach the best candidates for our clients.  </p><p> This freedom to access candidates from the widest possible universe becomes increasingly important in specialist areas when recruiting for the most senior positions, as there are often only a limited number of qualified people.  </p><p>The team at SRI Associates is stable, experienced and focused. We deliver exceptional work for our clients by insisting that a partner of the Firm lead and execute each and every one of our assignments. </p></div>          </div></td></td>
    </tr>
    <tr>
      <td height="20" scope="col"> </td>
    </tr>

 

Basically it loosk like tinymce is grouping all of the code together and changing/ignoring some of the commands.

 

Please can somebody help me as this is a project I really need to finish.

 

Thank you very much!!!

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.