Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Louisville, KY
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    multiply variable

    Is there some way to multiply a variable gotten from the url? Here's what I'm trying to do:
    Code:
    <img src="images/photo<?php ($_GET['page']*1) ?>-t.jpg">

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    As you did, you might need to add an echo/print infront of the multplication so it gets written to the output. However, what shall a multiplication by one accomplish?
    De gustibus non est disputandum.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Louisville, KY
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts
    By 1? Nothing I guess. Lol wasn't thinking. But the same page will also have times 2, times 3, and times 4 (4 pictures per page).

    Added echo and it works great. Again, I guess I wasn't thinking. I have so much coding to do right now my brain is fried. Thanks for helping.


  •  

    Posting Permissions

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