Jump to content

[SOLVED] trouble with spaces......


gamesmstr

Recommended Posts

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

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.