SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast vaiod's Avatar
    Join Date
    Jan 2001
    Location
    Chandler, Arizona
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am trying to compile a message, I want the body of the message to display the data but also create a link to a page with the same data. The problem is when I try to make the link, I get a broken link due to the spaces. Here is the example:

    ------
    body of message with the variables shown like
    Name: John Doe
    ...
    ...
    but the link looks like this

    http://www.mydomain.com/admad_prj.ph...NAME&name=John (and Doe is not part of the link)

    I am trying to combine the two parts together like this but have had no success:

    $msg1 = (Name: $name);

    $name = (urlencode($name));

    $msg2 = (link?name=$name);

    $message = ("$msg1" + "$msg2");
    -----

    this doesn't work, any suggestions?

  2. #2
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What language is your code?
    If it's in PHP, the plus willl consider both side of it as integers, and not string concatenation. Use "." (dot) instead

    Also, quoting the string within () and w/o quotes (single/double) will produce parse errors.

    And after fixing these problems, I believe you should get "...link=John+Doe"
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy

  3. #3
    SitePoint Enthusiast vaiod's Avatar
    Join Date
    Jan 2001
    Location
    Chandler, Arizona
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It worked, thanks!

  4. #4
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    Washington State
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Vaiod,

    You'll want to read and print out this tutorial :

    http://www.zend.com/zend/tut/using-strings.php

  5. #5
    SitePoint Enthusiast vaiod's Avatar
    Join Date
    Jan 2001
    Location
    Chandler, Arizona
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very helpful information, thanks for the link.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •