Jump to content

xtekuta

New Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About xtekuta

  • Rank
    Newbie
  1. I have this ajax function in my PRS.php that whenever i select a value from dropdown, a text field will show an output based on the value which selected. In my console i see there was a POST everytime theres a select value from the drop down. But im getting an error 'Undefined Variable' in ff.php which fetching the POST value from PRS.php Im new in jQuery so im stuck here in this problem. Any solution for this ? Thanks in advance. Here is my code in PRS.php <?php $drp = mysqli_query($conn,"SELECT productcode FROM products"); ?> <td><select name="drpcode" onchange="getState(this.value)" class="form-control name_list"><?php while ($dp = mysqli_fetch_array($drp)) { ?> <option value="<?php echo $dp['productid']; ?>"><?php echo $dp['productcode']; ?></option><?php } ?></select></td> <td><input type="text" id="brandss" name="brand" placeholder="Brand" class="form-control name_list" required value=" "></td> My code in ff.php <?php require_once("conn.php"); $id = $_POST['productid']; $query = mysqli_query($conn,"SELECT productbrand FROM products WHERE productid = '$id' "); while($rs = mysqli_fetch_array($query,MYSQLI_BOTH)) { $brand = $rs['productbrand']; } echo $brand; ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.