<? DEW-CODE.COM  

Downloads

Assorted scripts  (1)
DewNewPHPLinks  (9)





Lost Password?
No account yet? Register

Dew-Code Newsfeed

Resources


 USdigitalcable.com

Dew-Code
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Link in the about text (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Link in the about text
#1146
timopp (User)
Fresh Boarder
Posts: 19
graphgraph
User Offline Click here to see the profile of this user
Link in the about text 2 Years, 4 Months ago Karma: 0  
Dewed,

Well this is embarrassing.

How do I put a text link in the About us section. When I tried a standard href I got php errors.

Thanks

Tim
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#1147
Dewed (Admin)
Admin
Posts: 603
graph
User Online Now Click here to see the profile of this user
Dew-Code.com
Re:Link in the about text 2 Years, 4 Months ago Karma: 9  
It would be helpful if you mentioned what the error was.. but, the 2 most common causes.. unescaped quotes, and headers already sent.

Unescpaed quotes:
Almost all of the html you see in the browser is assigned to a php variable, and them printed...

Something like

<b>Some text<img src="someimage.jpg"> YAY !</b>

becomes

$html = "<b>Some text<img src=\"someimage.jpg\"> YAY !</b>";

The backslashed quotes are needed to tell PHP this is not the end of the variable, you actually want the quotes printed.

Same is true if the html is assigned with single quote, aka apostrophes.. they'll need escaping too, with backslashes so . . .

<P>I'll be home for Christmas</P>

becomes

$html = '<P>I\'ll be home for Christmas</P>';

Headers already sent errors:
This error is caused by accidentally adding a blank line, or even a space before the first <?php tag at the top of a file, or after the closing ?> at the bottom of a file. The error should indicate which file "output started in", check that file for blank lines/spaces.
 
Report to moderator   Logged Logged  
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
#1148
Dewed (Admin)
Admin
Posts: 603
graph
User Online Now Click here to see the profile of this user
Dew-Code.com
Re:Link in the about text 2 Years, 4 Months ago Karma: 9  
PS.. Don't be embarrassed. The primary purpose of this site is helping people bend open source scripts to their needs. I'm a self taught PHP coder myself, and that's how I learned, by breaking things and eventually fixing them again.
 
Report to moderator   Logged Logged  
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
#1149
timopp (User)
Fresh Boarder
Posts: 19
graphgraph
User Offline Click here to see the profile of this user
Re:Link in the about text 2 Years, 4 Months ago Karma: 0  
Okay,

So this should work

$html = "About Jonesboro is a product of <a href=\"http://clicksdigital.com\"> clicks|digital.com </a>";

But I get this:

Parse error: syntax error, unexpected T_STRING in /home/timopp/public_html/jdirectory/include/about.php on line 25

Thanks

Tim

I prefer an unexpected G-String though...Kapow!!!!
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#1150
Dewed (Admin)
Admin
Posts: 603
graph
User Online Now Click here to see the profile of this user
Dew-Code.com
Re:Link in the about text 2 Years, 4 Months ago Karma: 9  
Yes, that should work..

Is the line of code you mention actually line 25 of the file ? Might be best to post a few surrounding lines, the cause of the error might actually be on line 22-23. Just indicate which line is actually #25 in your post.


Also, you might notice some lines start with
$html =
and others have a period in them ...
$html .=

The .= means append..

$html = 'First line<br>';
$html .='Second line';
$html ='Third line ';

echo $html; //; prints only "Third line" because the period was missing and the $html variable contents were overwritten.
 
Report to moderator   Logged Logged  
 
Last Edit: 2009/09/29 11:34 By Dewed.
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
#1151
timopp (User)
Fresh Boarder
Posts: 19
graphgraph
User Offline Click here to see the profile of this user
Re:Link in the about text 2 Years, 4 Months ago Karma: 0  
Kewl Dewed,

That period got me ( as I suspect many more )

BTW what is the difference in $htmlsrc?

Tim
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
get the latest posts directly to your desktop
Outsource your projects to thousands of programmers at
ScriptLance.com
Newsflash
Interested in
advertising?

This space for rent!

Sign up for PayPal and start accepting credit card payments instantly.
Copyright Dew-Code 2008