corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Quick PHP help


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Quick PHP help
Jodi_the_g
Member

Registered: 7th Aug 01
Location: Washington D.C
User status: Offline
16th Sep 06 at 09:20   View User's Profile U2U Member Reply With Quote

I got this code so far and it gives me the following error

Parse error: parse error, unexpected T_STRING

The code is
$lang['admin_listing_limit_reached'] = " <p>You Have Reached Your Listing Limit</p><p>Please make a payment using the link below to list your caravan</p><p><a target="_blank" HREF="http://www.nochex.com/payme.asap?email=support@staticcaravanholidaysrus.co.uk"><IMG border="0" SRC="http://www.nochex.com/web/images/cardsboth2.gif"></a></p>";

Neil
Member

Registered: 2nd Nov 03
Location: Newcastle Drives: E46 MSport Coupe
User status: Offline
16th Sep 06 at 09:25   View User's Profile U2U Member Reply With Quote

Needs slashes..

$lang['admin_listing_limit_reached'] = " <p>You Have Reached Your Listing Limit</p><p>Please make a payment using the link below to list your caravan</p><p><a target=\"_blank\" HREF=\"http://www.nochex.com/payme.asap?email=support@staticcaravanholidaysrus.co.uk\"><IMG border=\"0\" SRC=\"http://www.nochex.com/web/images/cardsboth2.gif\"></a></p>";

[Edited on 16-09-2006 by NeilM]
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
16th Sep 06 at 09:35   View Garage View User's Profile U2U Member Reply With Quote

its not the slashes, replace the " at the start of the string and the end with ' hence


$lang['admin_listing_limit_reached'] = ' <p>You Have Reached Your Listing Limit</p><p>Please make a payment using the link below to list your caravan</p><p><a target="_blank" HREF="http://www.nochex.com/payme.asap?email=support@staticcaravanholidaysrus.co.uk"><IMG border="0" SRC="http://www.nochex.com/web/images/cardsboth2.gif"></a></p>';
Jodi_the_g
Member

Registered: 7th Aug 01
Location: Washington D.C
User status: Offline
16th Sep 06 at 09:41   View User's Profile U2U Member Reply With Quote

Works either way thanks.
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
16th Sep 06 at 09:44   View Garage View User's Profile U2U Member Reply With Quote

Neil
Member

Registered: 2nd Nov 03
Location: Newcastle Drives: E46 MSport Coupe
User status: Offline
16th Sep 06 at 11:28   View User's Profile U2U Member Reply With Quote

Just depends how you prefer to code.
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
16th Sep 06 at 15:12   View Garage View User's Profile U2U Member Reply With Quote

Using ' instead of " will mean that the string is does not have its variables interpolated which is not a problem in that example but would not do what you wanted if you were doing something like -

$message = 'Please email <a target="_blank" HREF="mailto:$adminemail">$adminemail</a>';

...as you want $adminemail to be replaced by its value as opposed to being printed literally.
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
16th Sep 06 at 15:37   View Garage View User's Profile U2U Member Reply With Quote

indeed, the problem was it was interpretting part of the string as a comment, if he needed text outside the string i would not have suggested my fix
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
16th Sep 06 at 16:12   View Garage View User's Profile U2U Member Reply With Quote

Yeah I was just clarifying that the difference between the two types of quote isn't just a style thing.

The exact error with that was that after the second quote the first string is closed and therefore the parsers expects to see concatenation operator, more bits of string etc.


 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
everyone look quick !!!!!!! Kerry General Chat 49 548
19th Jun 03 at 14:31
by Joff
 
QUICK SALE NEEDED ASAP ON MY SHOW CAR jock@sw-cc.com Cars Offered 1 442
19th Feb 05 at 14:12
by jock@sw-cc.com
 
Few Pics from the Pod (56K Warning) PaulW General Chat 12 1064
21st Feb 05 at 16:40
by Jambo
 
Astra GSI or Honda Civic type R c4r5aj4m1e General Chat 187 2694
6th Oct 05 at 17:51
by rustyarchs
 
quick mk4 astra jamesvalver General Chat 4 163
4th Jan 06 at 16:54
by Ricky-Lee53
 

Corsa Sport » Message Board » Off Day » Geek Day » Quick PHP help 29 database queries in 0.0121739 seconds