2

example (this is not working)

location.href = 'freecreate?fname=+fname+"&Mnumber="+Mnumber+"&sitename="+sitename';
1
  • 1
    use an ide with a syntax highlighter. Commented Jun 10, 2016 at 4:37

2 Answers 2

5

Add double quotes(") after fname= , Use this:

location.href = "freecreate?fname="+fname+"&Mnumber="+Mnumber+"&sitename="+sitename;
Sign up to request clarification or add additional context in comments.

Comments

2

If you are working with php variables just Declare them, assign values and append them

using . operator

See the example below:

<?php 

    $fname="bhansa";
    $Mnumber ="number";
    $sitename ="stack";
    echo "<script>window.location = 'freecreate?fname=".$fname."+&Mnumber=".$Mnumber."+&sitename=".$sitename."'</script>";

?>

Use @Dhara Parmar's method if you want to use in javascript.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.