Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 07-03-2010, 03:19 AM syntax issues
Skilled Talker

Posts: 83
Trades: 0
I'm having a slight problem setting an img tag in a variable. This variable will be called later in the page.

PHP Code:
$avatar $uploadrow['avatar'];
$avatarshow "<img src=\'/avatars/$avatar\' width=\'100\' height=\'100\'>"
Now I am certain the problem is with my syntax in the avatarshow variable. I tested it by typing out the full name of the file, and it is shown just fine. But doing it this way causes problems. Any suggestions on fixing this code?

(I'm not getting any mysql errors)
Smudly is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-03-2010, 06:37 AM Re: syntax issues
shivaji's Avatar
Ultra Talker

Posts: 321
Trades: 0
You can try:
PHP Code:
$avatarshow '<img src="avatars/' $avatar '" width="100" height="100" />'
__________________

Please login or register to view this content. Registration is FREE
- uncommon free scripts

Please login or register to view this content. Registration is FREE
- Städte, Sport, Party, Gourment, Apartments, Hotels
shivaji is offline
Reply With Quote
View Public Profile Visit shivaji's homepage!
 
Old 07-03-2010, 03:56 PM Re: syntax issues
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
Quote:
Originally Posted by Smudly View Post
I'm having a slight problem setting an img tag in a variable. This variable will be called later in the page.

PHP Code:
$avatar $uploadrow['avatar'];
$avatarshow "<img src=\'/avatars/$avatar\' width=\'100\' height=\'100\'>"
When writing a string in double-quotes, you don't need to escape single-quotes ('), but you do need to escape other double-quotes (")
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to syntax issues
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11265 seconds with 12 queries