beanymanuk Posted April 25, 2010 Share Posted April 25, 2010 I am getting value from url using $video = $_GET['v'] ; but it is not working in this file below it just echo's blank <?php include('../core.php'); $video = $_GET['v']; echo $video; $sql2="SELECT tag, videoId FROM generaltags Where videoId = '$video' ORDER BY id DESC"; $result2 = mysql_query($sql2); echo 'Tags: '; while($row2 = mysql_fetch_array($result2)) { ?> <?php echo $row2['tag'] . " "; ?> <?php } ?> but it is working in this file and is echoing the corrent value <?php //Get video id from url variable v $video = $_GET['v']; echo $video; ?> Anyone got any idea's what this problem could be? Link to comment https://forums.phpfreaks.com/topic/199675-php-video-_getv-not-working/ Share on other sites More sharing options...
jskywalker Posted April 25, 2010 Share Posted April 25, 2010 i'll bet is had something to do with the contents of your core.php, whicch are included before the $_GET[... What happens if you do this?: $video = $_GET['v']; include('../core.php'); Link to comment https://forums.phpfreaks.com/topic/199675-php-video-_getv-not-working/#findComment-1047996 Share on other sites More sharing options...
beanymanuk Posted April 25, 2010 Author Share Posted April 25, 2010 no I tried that and still nothing I dont know if the problem is anything to do with the file being loaded by ajax showpeople.php <script type="text/javascript"> $(document).ready(function() { showrecords(); function showrecords() { $("#display").load("http://www.peter-gosling.com/tagit/people/demo_show.php"); //Simple jquery load command, loads up demo_show.php document.getElementById('content').value=''; $("#flash").hide(); } </script> demo_show.php <?php include('../core.php'); include('../videoinfo.php'); $video = $_GET['v']; echo $video; ?> Code that does work is contained in videoinfo.php <?php //Get video id from url variable v $video = $_GET['v']; echo $video; ?> Link to comment https://forums.phpfreaks.com/topic/199675-php-video-_getv-not-working/#findComment-1048013 Share on other sites More sharing options...
beanymanuk Posted April 25, 2010 Author Share Posted April 25, 2010 Does anyone have any idea's of anything I could try? Link to comment https://forums.phpfreaks.com/topic/199675-php-video-_getv-not-working/#findComment-1048091 Share on other sites More sharing options...
Pikachu2000 Posted April 25, 2010 Share Posted April 25, 2010 Is the proper variable name and value showing in the URL string when the page loads? Link to comment https://forums.phpfreaks.com/topic/199675-php-video-_getv-not-working/#findComment-1048094 Share on other sites More sharing options...
beanymanuk Posted April 25, 2010 Author Share Posted April 25, 2010 Yes it is showing all ok I think it may be because the file demo_show.php is loaded in seperately by ajaz method and therefore the page is loaded seperately without the nessary variable being available. Hope this makes sense Link to comment https://forums.phpfreaks.com/topic/199675-php-video-_getv-not-working/#findComment-1048099 Share on other sites More sharing options...
beanymanuk Posted April 25, 2010 Author Share Posted April 25, 2010 Is there a way in javascript I could do this? and pass the php get url value http://www.peter-gosling.com/tagit/people/demo_show.php?v=$_GET['v'] Link to comment https://forums.phpfreaks.com/topic/199675-php-video-_getv-not-working/#findComment-1048104 Share on other sites More sharing options...
Pikachu2000 Posted April 25, 2010 Share Posted April 25, 2010 That's quite possible. I just don't know jack about AJAX. Link to comment https://forums.phpfreaks.com/topic/199675-php-video-_getv-not-working/#findComment-1048106 Share on other sites More sharing options...
beanymanuk Posted April 25, 2010 Author Share Posted April 25, 2010 okey dokey I have posted a question in ajax forum now so see if I have any better joy. Thankyou for your help Link to comment https://forums.phpfreaks.com/topic/199675-php-video-_getv-not-working/#findComment-1048110 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.