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 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2011
    Posts
    65
    Thanks
    1
    Thanked 0 Times in 0 Posts

    using var got from another page when refreshing the new page

    Hi, I been trying everything,
    I have on one page this code:
    <option value="precios_propiedades_uno_test.php?property=<?=$row["property"]?>"><?=$row["property"]?></option>

    This gives me from a mysql select a list of properties.
    when I choose a property I am taken to another page and do get the var correctly like this:
    precios_propiedades_uno_test.php?property=Casa_Blanca_4

    On that page I am suppose to update prices for several seasons for the same property so I want the var every time I update and send the form, and then I need the var for the next update on that same page as refreshes using a header.

    in the mysql select on the new page precios_propiedades_uno_test.php
    I use this WHERE property = '$_GET[property]' and it works perfect

    I added this to the form to get the var when I update:
    <input type="text" name="property" value="<?php print($_GET['property']); ?>" /><br>
    It print the property perfect,
    however when I submit the form, nothing is inserted, and when the page refreshed using a header I have the var both in the url and in the form.
    the mysql update is like this:
    $query = mysql_query("UPDATE calendar_table SET startdate='$llegada', enddate='$salida'
    WHERE cal_date='$llegada' and property='property'");

    I tried to change to ='$_GET[property]' but it is just the same does, not insert anything, so something is wrong.

    The header that is sent after the update that refreshes the page is like this:
    header ("Location: precios_propiedades_uno_test.php?property=$property");

    Thanks in advance,
    Helen

  • #2
    New Coder
    Join Date
    Oct 2011
    Posts
    65
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Puf, finally I managed, dont know why I had to do, but changing the name in the form and update query it works:
    <input type="text" name="property2" value="<?php print($_GET['property']); ?>" /><br>


  •  

    Posting Permissions

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