Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default php string concat

    Hello,

    Simple question here....

    I am trying to concatenate 2 strings but it doesn't seem to work. My only
    experience in in C and VB 6.0.

    PHP newbie!

    I am getting a value from an option group for the exact shoe size , then
    appending it to the form action string, or at least I am trying to.

    The form calls a small fx to set a variable - $size - to the assigned
    value from document.order_shoe.size.value.



    Code:


    <form action = "../shop_cart.php?item='.$sansz." name='order_shoe'
    method = post onsubmit='return setsize();'>

    <br>&nbsp&nbspSize:&nbsp

    <select name=size>
    <option value="">Select a size</option>
    <option value="mhr0109">9</option>
    <option value="mhr0110">10</option>
    <option value="mhr0111">11</option>
    <option value="mhr0112">12</option>
    </select>
    <p align="left">
    &nbsp&nbsp
    <input type="submit" value="Add to cart" >
    </form>


    Thz for the help!


    anybody Guest

  2. Similar Questions and Discussions

    1. Concat two fields in SQL
      I am trying to concatenate two columns in an SQL statement but haven't been having much success: here is the portion of the SQL: ...
    2. Which version supports concat???
      I have a problem with different versions of MySQL supporting concat differently. The portion of the query that uses the concat function looks...
    3. Concat problem with SQL
      hi all I have a problem when I try to concat 2 fields with a dot, in a query (Oracle database). here an example : <query name="myquery"...
    4. String length/concat problems in Ruby 1.8.0?
      Has anyone run into Ruby string length/concatenation problems in Ruby 1.8.0? One of my associates encountered difficulties when storing the...
    5. HOW CAN I CONCAT TWO LINEAR LISTS
      I have two linear lists: temp1 = temp1 = I want to combine them into one list i.e result =
  3. #2

    Default Re: php string concat

    To concatenate two strings, use a period, eg:

    $completestring = $part1.$part2

    Hope this helps.


    "anybody" <tk@ev1.net> wrote in message
    news:IjNib.569$7a4.523@newsread4.news.pas.earthlin k.net...
    > Hello,
    >
    > Simple question here....
    >
    > I am trying to concatenate 2 strings but it doesn't seem to work. My
    only
    > experience in in C and VB 6.0.
    >
    > PHP newbie!
    >
    > I am getting a value from an option group for the exact shoe size , then
    > appending it to the form action string, or at least I am trying to.
    >
    > The form calls a small fx to set a variable - $size - to the assigned
    > value from document.order_shoe.size.value.
    >
    >
    >
    > Code:
    >
    >
    > <form action = "../shop_cart.php?item='.$sansz." name='order_shoe'
    > method = post onsubmit='return setsize();'>
    >
    > <br>&nbsp&nbspSize:&nbsp
    >
    > <select name=size>
    > <option value="">Select a size</option>
    > <option value="mhr0109">9</option>
    > <option value="mhr0110">10</option>
    > <option value="mhr0111">11</option>
    > <option value="mhr0112">12</option>
    > </select>
    > <p align="left">
    > &nbsp&nbsp
    > <input type="submit" value="Add to cart" >
    > </form>
    >
    >
    > Thz for the help!
    >
    >

    Max Guest

  4. #3

    Default Re: php string concat


    On 14-Oct-2003, "anybody" <tk@ev1.net> wrote:
    > I am trying to concatenate 2 strings but it doesn't seem to work. My
    > only
    > experience in in C and VB 6.0.
    >
    > PHP newbie!
    >
    > I am getting a value from an option group for the exact shoe size , then
    > appending it to the form action string, or at least I am trying to.
    >
    > The form calls a small fx to set a variable - $size - to the assigned
    > value from document.order_shoe.size.value.
    >
    >
    >
    > Code:
    >
    >
    > <form action = "../shop_cart.php?item='.$sansz." name='order_shoe'
    > method = post onsubmit='return setsize();'>
    >
    > <br>&nbsp&nbspSize:&nbsp
    >
    > <select name=size>
    > <option value="">Select a size</option>
    > <option value="mhr0109">9</option>
    > <option value="mhr0110">10</option>
    > <option value="mhr0111">11</option>
    > <option value="mhr0112">12</option>
    > </select>
    > <p align="left">
    > &nbsp&nbsp
    > <input type="submit" value="Add to cart" >
    > </form>
    I assume your <form...> is not enclosed in the PHP tags <?php ... ?>. It
    should read
    <form action = "../shop_cart.php?item='<? echo $sansz; ?>'
    name='order_shoe'
    Unless you are inside the PHP tags, you are dealing only with HTML. PHP
    simply echos everything in the file unless it's enclosed in the php tags,
    then it's interpreted as PHP code.

    You also have an HTML error:
    <br>&nbsp&nbsp;Size:&nbsp
    The semi-colon is required or the &nbsp will not be displayed as a space.


    --
    Tom Thackrey
    [url]www.creative-light.com[/url]
    tom (at) creative (dash) light (dot) com
    do NOT send email to [email]jamesbutler@willglen.net[/email] (it's reserved for spammers)
    Tom Thackrey Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139