View Full Version : PHP Help ?
Replicator
01-10-2010, 04:04 PM
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 !
Fred Weiss
01-10-2010, 04:13 PM
Just insert the text between the single quote marks.
Replicator
01-10-2010, 04:19 PM
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.
Poconopete
01-10-2010, 04:26 PM
You escape apostrophes with a back slash-\ i.e. she\'s, for line breaks use < br > without the extra spaces shown. I had to put spaces to make it show here.
A wealth of info can be found here http://forums.oscommerce.com/
ProWraps
01-10-2010, 04:32 PM
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.
iSign
01-10-2010, 04:33 PM
I think you must have forgot the [/FUBAR] tag! :wink:
Replicator
01-10-2010, 04:50 PM
Thank you Poconopete, you saved my *** . . . 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
01-10-2010, 04:55 PM
Thank you Poconopete, you saved my *** . . . 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.
Replicator
01-10-2010, 06:03 PM
Thank you Pro . . . !
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.