![]() |
|
#1
|
|||
|
|||
T variable error in php codeI'm getting an error saying
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/sites/site31/web/showitems.php on line 13 here is my code. PHP Code:
I can not see any problems but have been looking at it and working on it for a while so might be overlooking something. can anyone see any problems? thanks Last edited by LuciWiz : 06-Oct-2004 at 05:06.
Reason: Please insert your php code between [php] [/php] tags
|
|
#2
|
||||
|
||||
|
I'm not able to reproduce this error (on PHP 5.0.1)
but you could try quoting your vars, like PHP Code:
|
|
#3
|
|||
|
|||
|
Quote:
Thanks I tried this and got the error Warning: Failed opening 'http://www.website.com/content/item-list.php? CID=612& TID=8& group=java games& list_columns=5& list_rows=6& link_url=orderitem.php& list_page=& list_in_new=0& cat=' for inclusion (include_path='.:/usr/local/lib/php') in /home/sites/site31/web/showitems.php on line 22 I'm off to check the permissions of the file. thanks lee |
|
#4
|
||||
|
||||
|
hmm, for some reason the php tags add a space after each line.
it works fine when you remove the space after each line. if this file is a local file(because you mentioned permission) it would be better to include it local, but that can only be done if it's on the same server |
|
#5
|
||||
|
||||
|
Hello bwd,
You just have to remember that if you insert an array inside a string, between double quotes, you can write something like $_GET['TID'] the following ways: PHP Code:
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#6
|
|||
|
|||
|
Thanks
I'm just upgrading to PHP5.0.2 now so hopefully this will sort the problem out and I can use my original code. If not I will try removing the spaces. either way I'll let you know the outcome. regards lee |
|
#7
|
||||
|
||||
|
This has nothing to do with PHP being version 4 or 5. It will report the same error if you do not make the changes that Allowee or I suggested above.
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#8
|
|||
|
|||
|
Quote:
I just tried allowee's way and still get the same error. I'll try the other way. Lee |
|
#9
|
||||
|
||||
|
I also am not certain why there's a space after the newline on the web page cause I can't find them in the HTML source... anyway, let me edit Allowee's suggestion for you and it shouldn't fail if you try this instead:
PHP Code:
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
Recent GIDBlog
First week of IA training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Formatting C / C++ code | WaltP | C Programming Language | 1 | 06-Jan-2008 23:59 |
| Parsing PHP code that's stored in a database. | JdS | MySQL / PHP Forum | 3 | 13-May-2004 09:15 |
| PHP code snippet library - Anyone have any use for this? | jrobbio | MySQL / PHP Forum | 1 | 02-Mar-2003 15:18 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The