• I want to thank all the members that have upgraded your accounts. I truly appreciate your support of the site monetarily. Supporting the site keeps this site up and running as a lot of work daily goes on behind the scenes. Click to Support Signs101 ...

PHP Help ?

Replicator

New Member
Lets say I have a PHP block that looks like this :

******************************************************************************************

<?php
/*
$Id: conditions.php 1739 2007-12-20 00:52:16Z hpdl $

osCommerce, Open Source E-Commerce Solutions

[]http://www.oscommerce.com[/]

Copyright (c) 2002 osCommerce

Released under the GNU General Public License
*/

define('NAVBAR_TITLE', 'Privacy Notice');
define('HEADING_TITLE', 'Privacy Notice');

define('TEXT_INFORMATION', 'Put here text information here');
?>

*********************************************************************************

How can I insert a block of HTML where it says to insert text information and not have it be all FUBAR ?

Please Help !
 

Replicator

New Member
I tried doing that and had many issues.

1. If I insert the html I get error messages galore.

2. If I insert the text, then I have issues with any kind of punctuation in the text and the \n does not work for line breaks.
 

ProWraps

New Member
there are all kinds of problems because you are defining a variable. when you insert html, your asking for something that needs to be parsed and the php processsor is going to frag. i would figure out where that variable is being called, and deal with it there. you will have more control over how it is being handled and will be able to escape it from the php processor and have it parsed as the html you are requesting.

it also may cause a headers info error such as Warning: Cannot modify header information - headers already sent by.....

Cause:

This error is caused if the your PHP scripts are printing to the browser prior to sending headers. A common example is printing the html tags prior to starting a session, or setting a cookie.


-------------------
posting your errors would help debug the problem.
 

Replicator

New Member
Thank you Poconopete, you saved my ass . . . Who'da thunk I could have used HTML <br> tags in PHP :LOL:

You pretty muych still have to remove all punctuation that will be recognized as php code and cause syntax errors, but that's OK . . . THANKS !
 

ProWraps

New Member
Thank you Poconopete, you saved my ass . . . Who'da thunk I could have used HTML
tags in PHP :LOL:

You pretty muych still have to remove all punctuation that will be recognized as php code and cause syntax errors, but that's OK . . . THANKS !


actually you don\'t, but it involves using includes and whatnot. much easier. but i\'m glad you got it fixed :)

php was created to ease the use of html directly in the code. once you get ahold of it (especially if you have a perl background like me), you will quickly see how easy it is to use.
 
Top