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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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