Jump to content
faure

VERY EASY FOR YOU (js with php) !!

Recommended Posts

Hello (bonjour from PARIS)

 

<script>

I have a function  with

var abc="REF1";

I have here a  <?php 

I need the  value of  abc  here

what is the solution  ? (an exemple if possible)

 

?>

</script>

Share this post


Link to post
Share on other sites

Why? php in JavaScript gives impression you want to produce JavaScript code within script tags, why not produce JavaScript code directly. you can only send value of abc to php by using JavaScript to reload the page with ?abc=REF1 querystring if php code is internal, or send to a external php file with same querystring. check out AJAX tutorials.

Share this post


Link to post
Share on other sites

You already asked the same question in this thread

 

Share this post


Link to post
Share on other sites

 

DSONSUK WROTE :

 

Why? php in JavaScript gives impression you want to produce JavaScript code within script tags, why not produce JavaScript code directly. you can only send value of abc to php by using JavaScript to reload the page with ?abc=REF1 querystring if php code is internal, or send to a external php file with same querystring. check out AJAX tutorials.

can you give me an exemple in ajax to send  the value of a element html and retrieve it  in a variable like $x=

is my question well formuled ?

how reload the page in middle of script ? strange !

 

 

 

Share this post


Link to post
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

×