Jump to content

Basic php question


Recommended Posts

Hey, I have a variable set up when a message is sent or a post is made on my website. Now i would like to spice it up and instead of just displaying a messagei found a script that creates a neat little popup on the right hand side. For this to work i tried someting like this:

<?php  if($messageSent){    echo '<script type='text/javascript'>    sNotify.addToQueue("You message has been sent");</script>';  };?>

But this doesnt seem to work. Any suggestions on what im doing wrong? Help would greatly be appreciated as im still quite new to this.Thanks

Link to comment
Share on other sites

Ah i found the solution

<?php  if($messageSent){    echo '<script type="text/javascript">    sNotify.addToQueue("Your message has been sent");</script>';  };?>

This code works, double quotes save the day!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...