hi is it possible to post a variable like this either with javascript or php i tried here with javascript but didnt work is there a similiar way of doing with php?? query.php <?php include("../../includes/config.php"); mysql_connect($db_address, $db_username, $db_password);mysql_select_db($db_name) or die(mysql_error()); $fid = $_GET['fid']; $fid = mysql_real_escape_string($fid); $query10 = "SELECT * FROM films WHERE (film_id = '$fid')"; $qry_result10 = mysql_query($query10) or die(mysql_error()); while($row10 = mysql_fetch_array($qry_result10)) { $urlfid="http://www.onfilm.biz/streaming/home/".$row10['client']."/".$row10['client_office']."/".$row10['filename'].".mp4";?> <a class="hofwhite14" href="#" onclick="loadNplay('<?php echo $urlfid; ?>')"><u></u>Property Film</u></a> <?php }mysql_close(); //EDIT 290510 ?> <script type="text/javascript"> var video= $urlfid; $.post('indextest.php', {urlfid:video}); </script> Code (markup):
<script type="text/javascript"> var video= <?php echo $urlfid; ?>; $.post('indextest.php', {urlfid:video}); </script> HTML: Is it what you're looking for?
yes i think so but so if i have that will post post that variable into the indextest.php <script type="text/javascript"> var video= <?php echo $urlfid; ?>; $.post('indextest.php', {urlfid:video}); </script> so the overall code would be film.php <?php include("../../includes/config.php"); mysql_connect($db_address, $db_username, $db_password);mysql_select_db($db_name) or die(mysql_error()); $fid = $_GET['fid']; $fid = mysql_real_escape_string($fid); $query10 = "SELECT * FROM films WHERE (film_id = '$fid')"; $qry_result10 = mysql_query($query10) or die(mysql_error()); while($row10 = mysql_fetch_array($qry_result10)) { $urlfid="http://www.onfilm.biz/streaming/home/".$row10['film_client']."/".$row10['film_client_office']."/".$row10['film_filename'].".mp4";?> <a class="hofwhite14" href="#" onclick="loadNplay('<?php echo $urlfid; ?>')"><u></u>Property Film</u></a> <?php }mysql_close(); //EDIT 290510 ?> <script type="text/javascript"> var video= <?php echo $urlfid; ?>; $.post('indextest.php', {urlfid:video}); </script> PHP: and indextest.php <?php $urlfid = $_GET['urlfid']; echo $urlfid; ?> PHP: is that right if so is not working
In indextest.php you get urlfid variable in $_POST table, so: <?php $urlfid = $_POST['urlfid']; echo $urlfid; ?> PHP:
so wher ethis POST line meant to be on the indextest.php or on the film.php film page is where the database query is and the indextest.php is where i am trying to display the query?
yeah but the data is coming from fillm.php are you sure you dont mean to put this script <script type="text/javascript"> var video= <?php echo $urlfid; ?>; $.post('../bellway/indextest.php', {urlfid:video}); </script> PHP: on the film.php where the data is and how does the indextest.php grabs or echo the data that came from the film.php and do i need a from with that cz i am trying to do without using from?
indextest.php has that variable in $_POST table beacuse it's sent by AJAX function from film.php in line: $.post('indextest.php', {urlfid:video}); HTML:
Hi thanks for the help but maybe is me trying the hard way perhaps you can help me the reason i am trying to do this is to try achieve something i have posted on another thread can you help me out please this the thread http://forums.digitalpoint.com/showthread.php?t=2272591