I am a newbie... Probably and easyone

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
TravisT6983
Forum Newbie
Posts: 19
Joined: Wed Jul 02, 2008 2:15 pm

I am a newbie... Probably and easyone

Post by TravisT6983 »

Ok i am kinda new to PHP and need some help

i am trying to accomplish is in the first string below i need $str to include 'realcomp:<and our agents MLS ID>

the MLS ID is coming from our database where REALCOMP is just the word or text

i know the string at the bottom will work if i manually put in the <?php $str = 'REALCOMP:<Manually putting in MLS ID here> but i need it to come from our database


<?php $str = 'REALCOMP:' echo $agentInfo['mlsnAgentID']; ?>


<a href="http://we.showingdesk.com/Redirector.as ... &ID2=<?php echo $agentInfo['mlsnAgentID']; ?>&SIG=<?php echo base64_encode($str); ?>&KEY=900499-48334:108" target="_blank"><img src="images/logos/ShowingDeskWE.jpg" width="190" height="46" border="0">[/url]


Please help i am sooooo stuck

Thanks
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: I am a newbie... Probably and easyone

Post by John Cartwright »

..and what is your question?
TravisT6983
Forum Newbie
Posts: 19
Joined: Wed Jul 02, 2008 2:15 pm

Re: I am a newbie... Probably and easyone

Post by TravisT6983 »

PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\Inetpub\wwwroot\century21today.com\team\agentTools2.php on line 117

...this is the error i am getting with that previous code i know the problem lies in the area highlighted in red

<?php $str = 'REALCOMP:' echo $agentInfo['mlsnAgentID']; ?>
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: I am a newbie... Probably and easyone

Post by John Cartwright »

two problems here..

1. You cannot echo in a string assignment.
2. Lack of string concatenation

Your end result would look like

Code: Select all

<?php $str = 'REALCOMP:'. $agentInfo['mlsnAgentID']; ?>
I would suggest you revise Strings in the manual
TravisT6983
Forum Newbie
Posts: 19
Joined: Wed Jul 02, 2008 2:15 pm

Re: I am a newbie... Probably and easyone

Post by TravisT6983 »

THANK YOU... THANK YOU... THANK YOU

Your the best!!! I owe u :drunk:
Post Reply