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 08-28-2009, 07:55 PM Proper php syntax
Average Talker

Posts: 15
Name: taylor
Trades: 0
Is this syntax ok- didnt have any problems when i ran the code on my server
but then when i uploaded to go-daddy it was having problems. thanks

echo "<option value='".$R6D3021FF1D6F157789F083D1FB643E8E['prodid']."'
".$R8B2267A9CCF41F9CDBA21DE22FA4A946.">
".$R6D3021FF1D6F157789F083D1FB643E8E['prodname']."</option>";

thanks,
-tay
antioch1st is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-28-2009, 09:16 PM Re: Proper php syntax
NullPointer's Avatar
Will Code for Food

Posts: 2,781
Name: Matt
Location: Irvine, CA
Trades: 0
I don't see any problems with it, other than the really terrible variable names. Syntax highlighting will often make it easier to see if there is an error in your code:

PHP Code:
echo "<option value='".$R6D3021FF1D6F157789F083D1FB643E8E['prodid']."'
"
.$R8B2267A9CCF41F9CDBA21DE22FA4A946.">
"
.$R6D3021FF1D6F157789F083D1FB643E8E['prodname']."</option>"
Are you getting an error message?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 08-29-2009, 05:20 AM Re: Proper php syntax
lizciz's Avatar
Webmaster Talker

Posts: 744
Name: Mattias Nordahl
Location: Sweden
Trades: 0
Just to make this easier, let's say your variable names are $var1 and $var2. You got

PHP Code:
echo "<option value='".$var1['prodid']."'".$var2.">".$var1['prodname']."</option>"
Now, lets put in some variable values.

PHP Code:
$var1['prodid'] = 123;
$var2 456;
$var1['prodname'] = 789
This will output

Code:
<option value='123'456>789</option>
That doesn't look right to me :P
Unless your $var2 holds an attribute, like

PHP Code:
$var2 " class='someclass' name='somename'"
__________________
34343639363436653237373432303635373837303635363337 34323037343638363137343263323036343639363432303739 366637353366
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Reply     « Reply to Proper php syntax
 

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.45307 seconds with 12 queries