Enjoy an ad free experience by logging in. Not a member yet?
Register .
10-23-2004, 09:29 PM
PM User |
#1
Regular Coder
Join Date: Jun 2002
Location: England
Posts: 172
Thanks: 0
Thanked 0 Times in 0 Posts
Problem with this..
PHP Code:
$piconeloc = "blah.jpg" ;
$piconew = "250" ;
$piconeh = "150" ;
$piconealt = "blah blah" ;
$desc = str_replace ( "*picone*" , "<img src=\"/images/$piconeloc\" width=\"$piconew\" height=\"$piconeh\" alt=\"$piconealt\" align=\"right\" border=\"0\">" , "$desc" );
echo "$desc" ;
This just echoes:
Quote:
<img src="/images/" width="" height="" alt="" align="right" border="0">
Why isn't it including the info in the $'s? They definately exist.
__________________
\o/
10-23-2004, 10:10 PM
PM User |
#2
Master Coder
Join Date: Jul 2002
Posts: 6,589
Thanks: 0
Thanked 0 Times in 0 Posts
Try:
PHP Code:
$piconeloc = 'blah.jpg' ;
$piconew = '250' ;
$piconeh = '150' ;
$piconealt = 'blah blah' ;
$desc = str_replace ( '*picone*' , '<img src="/images/' . $piconeloc . '" width="' . $piconew . '" height="' . $piconeh . '" alt="' . $piconealt . '" align="right" border="0" />' , $desc );
10-24-2004, 12:02 AM
PM User |
#3
Supreme Overlord
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,220
Thanks: 4
Thanked 80 Times in 79 Posts
Try reading our
POSTING GUIDELINES sometime
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
10-24-2004, 03:15 PM
PM User |
#4
Regular Coder
Join Date: Jun 2002
Location: England
Posts: 172
Thanks: 0
Thanked 0 Times in 0 Posts
Well how about being sa bit more constructive and try to suggest a subject title that could have been used? I can't think of one.
Do you not take into account the fact that some people are not that good at asking questions or thinking up complicated subject titles?
__________________
\o/
10-24-2004, 04:19 PM
PM User |
#5
Sensei
Join Date: Aug 2003
Location: One step ahead of you.
Posts: 2,815
Thanks: 0
Thanked 3 Times in 3 Posts
If we would take that into account you will have to take in account that you will get now anwser.
You are the one that want's something not us.
10-24-2004, 06:37 PM
PM User |
#6
Supreme Overlord
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,220
Thanks: 4
Thanked 80 Times in 79 Posts
Quote:
Originally Posted by Richard
Well how about being sa bit more constructive and try to suggest a subject title that could have been used? I can't think of one.
Do you not take into account the fact that some people are not that good at asking questions or thinking up complicated subject titles?
Complicated?
Subject: PHP echo problems
That didn't seem too complicated to me.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
10-24-2004, 11:52 PM
PM User |
#7
Regular Coder
Join Date: Feb 2004
Location: Cornwall, UK
Posts: 535
Thanks: 0
Thanked 0 Times in 0 Posts
But... did it fix it? I take it it did, 'cos you don't seem too bothered about it anymore.
10-25-2004, 12:04 AM
PM User |
#8
Regular Coder
Join Date: Jun 2002
Location: England
Posts: 172
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by trib4lmaniac
But... did it fix it? I take it it did, 'cos you don't seem too bothered about it anymore.
Yes thank you it's fine now.
btw spookster it was a str_replace problem, and it is a php forum so no need to put php in the subject eh
:P
__________________
\o/
10-25-2004, 12:18 AM
PM User |
#9
Supreme Overlord
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,220
Thanks: 4
Thanked 80 Times in 79 Posts
Quote:
Originally Posted by Richard
Yes thank you it's fine now.
btw spookster it was a str_replace problem, and it is a php forum so no need to put php in the subject eh
:P
The easiest way to come up with a proper subject is to type in your question or code and then look through that for keywords or code statements. "Problem with str_replace" or "str_replace not working" would have been just fine as a subject line. The more specific the better. The reason we stress proper subject lines is because when people use our search feature and come up with a list of 50 results they will want to be able to sift through the subject lines of the results without having to open each and every thread to see if the thread is related to their problem.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
10-25-2004, 01:30 PM
PM User |
#10
Regular Coder
Join Date: Feb 2004
Location: Cornwall, UK
Posts: 535
Thanks: 0
Thanked 0 Times in 0 Posts
I would have called it "str_replace not replacing" or something similar
10-25-2004, 04:02 PM
PM User |
#11
Master Coder
Join Date: Jul 2002
Posts: 6,589
Thanks: 0
Thanked 0 Times in 0 Posts
i would have called it:
"embedded values not showing in doublequoted string used in str_replace()"
10-25-2004, 04:14 PM
PM User |
#12
Regular Coder
Join Date: Feb 2004
Location: Cornwall, UK
Posts: 535
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by raf
i would have called it:
"embedded values not showing in doublequoted string used in str_replace()"
Right... bit long winded for me. Each to there own though
10-25-2004, 07:41 PM
PM User |
#13
Master Coder
Join Date: Jul 2002
Posts: 6,589
Thanks: 0
Thanked 0 Times in 0 Posts
i already trimmed it down from
"terrible codingproblem with embedded variables' values that are not showing in doublequoted string that serves as the replacevalue in the str_replace() function i am using, is giving me a headache"
10-26-2004, 12:14 AM
PM User |
#14
Regular Coder
Join Date: Feb 2004
Location: Cornwall, UK
Posts: 535
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by raf
i already trimmed it down from
"terrible codingproblem with embedded variables' values that are not showing in doublequoted string that serves as the replacevalue in the str_replace() function i am using, is giving me a headache"
11-08-2004, 07:31 PM
PM User |
#15
New to the CF scene
Join Date: Nov 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
bad-juju
Last edited by firepages; 11-08-2004 at 10:24 PM ..
Jump To Top of Thread
Thread Tools
Rate This Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT +1. The time now is 03:02 AM .
Advertisement
Log in to turn off these ads.