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
Having a problem with this url...
Old 06-29-2011, 03:22 PM Having a problem with this url...
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Can someone fix this url? It seems like it should work, but the sweat is pouring from my eyes (literally) trying to find the reason for the error:

Code:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/duckster/public_html/cats.php on line 56

PHP Code:
<b>
<?php="<a href=\"$row['url']\">" $row['category_name'?></a>
</b>
<br />
Thanks!
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-29-2011, 03:36 PM Re: Having a problem with this url...
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
Not sure your short tag is correct.

PHP Code:
It should be: <?='something'?>

And not: <?php='something'?>
Also, you're missing a dot between your two expressions.
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.

Last edited by lizciz; 06-29-2011 at 03:38 PM..
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 06-29-2011, 03:41 PM Re: Having a problem with this url...
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Better yet, don't use short tags at all.

Also, it looks like there is another syntax error; should there be a concatenation operator between
PHP Code:
"<a href=\"$row['url']\">" 
and
PHP Code:
$row['category_name'
The following is valid:
PHP Code:
<?php echo "<a href=\"{$row['url']}\">{$row['category_name']}"?>
__________________

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

Last edited by NullPointer; 06-29-2011 at 03:46 PM..
NullPointer is offline
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 06-29-2011, 03:42 PM Re: Having a problem with this url...
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
Oh, and another thing. Not that it really matters, but the short tags are nice to have becuase you dont need to echo everything, just print out small things and then keep to the html part.

So, personally, I think this would look "nicer":
PHP Code:
<b> 
<a href="<?=$row['url']?>"><?=$row['category_name']?></a> 
</b> 
<br />
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 06-29-2011, 03:45 PM Re: Having a problem with this url...
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Quote:
Originally Posted by lizciz View Post
short tags are nice to have becuase you dont need to echo everything
They would have been a nice feature if they were implemented better from the start. As it is they are the best way to kill the portability of your application. Many servers have them disabled.
__________________

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

Last edited by NullPointer; 06-30-2011 at 01:10 AM..
NullPointer is offline
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 06-29-2011, 03:49 PM Re: Having a problem with this url...
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Quote:
Originally Posted by lizciz View Post
Your short tag is incorret. It should be

PHP Code:
It should be: <?='something'?>

And not: <?php='something'?>
Also, you're missing a dot between your two expressions.
This is obviously not correct, but I would like to show how I did what you said:

Edit::
PHP Code:
<b><?="<a href=\"$row['url']\">" $row['category_name'?></a></b><br />
Should be:
PHP Code:
<b><?="<a href=\"$row[url]\">".$row['category_name']?></a><br /></a></b><br />
__________________
Made2Own

Please login or register to view this content. Registration is FREE

Last edited by Brian07002; 06-29-2011 at 04:10 PM..
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 06-29-2011, 04:15 PM Re: Having a problem with this url...
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
On this same topic, could someone point me in the correct direction for the subcategory pages? How would they (should they) be best setup for this category layout:

Http://www.reunitemysite.com/cats.php

Thank you!
Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE

Last edited by Brian07002; 06-29-2011 at 04:17 PM..
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 06-30-2011, 03:56 AM Re: Having a problem with this url...
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
Quote:
Originally Posted by Brian07002 View Post
On this same topic, could someone point me in the correct direction for the subcategory pages? How would they (should they) be best setup for this category layout:

Http://www.reunitemysite.com/cats.php

Thank you!
Brian
If you mean the links under categories - either as vertical lists if you don't have too many in a category or, better, as SELECT tags with an onSelect
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Having a problem with this url...
 

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