Jump to content

ajax/php help


c_pattle

Recommended Posts

I'm wanting to use AJAX to update a form.  I have a javascript function that is called and sends this url.  The input is the id of an input field and inputvalue is the value in that field. 

 

var url = "ajaxformupdate.php?input=" + escape(input) + "&inputvalue=" + escape(input_value);

 

The server then runs this script.  I want it to return two values seperated by a "|".  However the problem is that I can never get it to add "|images/tick.png" to the variable "src".  Can anyone help. 

 

$input=$_GET["input"];
$inputvalue=$_GET["inputvalue"];

if ($input == "company_name") {
$src .= "company_name_img";
if ($inputvalue) {
$src .= "|images/tick.png";
}
echo $src;
}

if ($input == "contact_name") {
$src .= "contact_name_img";
if ($inputvalue) {
$src .= "|images/tick.png";
}
echo $src;
}

 

If I haven't explaining anything very well please let me know. 

 

Link to comment
https://forums.phpfreaks.com/topic/208783-ajaxphp-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.