gamesmstr Posted August 27, 2009 Share Posted August 27, 2009 I have an interesting problem.. Basically I am sending a message to a news database informing the user that they have mail. Included in that message is a link to that message using an AJAX call. Don't worry, this isn't an AJAX question. I have that part working fine. The format for the AJAX call is this: AJAX('targetdiv','target_file','var1 var2 var3','field1 field2 field3'); Basically the var and field sections are a string with the variables separated by spaces. I strip those in the ajax call. It works perfectly in a html javascript line. Where I am running into trouble is this: $id = 1; $mail[id]=14; $news=addslashes("You have an <a href=javascript:AJAX('mainbox','mail/mail.php','$id readmail $mail[id]','');>imail message</a>."); The result is this: "You have an <a href=javascript:AJAX(\'mainbox\',\'mail/mail.php\',\'1" For some reason it cuts off everything past the space in the Vars section. Any ideas on why this is? Link to comment https://forums.phpfreaks.com/topic/172209-solved-trouble-with-spaces/ Share on other sites More sharing options...
gamesmstr Posted August 28, 2009 Author Share Posted August 28, 2009 solved it. I just replaced the spaces with + , reworked the AJAX function to accommodate the +s and it works fine... Link to comment https://forums.phpfreaks.com/topic/172209-solved-trouble-with-spaces/#findComment-908011 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.