runnerjp Posted February 14, 2009 Share Posted February 14, 2009 ok i have a tab area set up shown below <ul id="countrytabs" class="shadetabs"> <li><a href="#" rel="#default" class="selected">About me</a></li> <li><a href="hobbies.php" rel="countrycontainer">Hobbies</a></li> <li><a href="include/profiletab/external3.htm" rel="countrycontainer">Goals</a></li> <li><a href="include/profiletab/external4.htm" rel="#iframe">Films and Books</a> </li> </ul> <div id="countrydivcontainer" style="border:1px solid gray; width:800px; margin-bottom: 1em; padding: 10px"> <?php echo $getuserprofile['about_me']?></div> <script type="text/javascript"> var countries=new ddajaxtabs("countrytabs", "countrydivcontainer") countries.setpersist(true) countries.setselectedClassTarget("link") //"link" or "linkparent" countries.init() </script> when i look at hobbies.php my php just wont show! any1 know why? hobbies.php <?php include '../../../settings.php'; include "../../../info.php"; // sets username/id ect $getuser = mysql_fetch_assoc(mysql_query("SELECT * from users where Username='$username'")); $getuserprofile = mysql_fetch_assoc(mysql_query("SELECT * from profile where ID='" .$getuser['ID'] . "'")); ?> <div align="center"> <p>About me <?php echo $id;?> </p> <p> <textarea onKeyPress="return taLimit(this)" onKeyUp="return taCount(this,'myCounter')" name="Description" rows=7 wrap="physical" cols=60><?php echo $username ?></textarea> <br> <br> You have <B><SPAN id=myCounter>255</SPAN></B> characters remaining</p> </div> Quote Link to comment https://forums.phpfreaks.com/topic/145199-solved-cant-get-php-to-work-within-my-tab/ Share on other sites More sharing options...
DeanWhitehouse Posted February 14, 2009 Share Posted February 14, 2009 $id isn't defined, add error_reporting(E_ALL); to the top to see why there is a problem Quote Link to comment https://forums.phpfreaks.com/topic/145199-solved-cant-get-php-to-work-within-my-tab/#findComment-762126 Share on other sites More sharing options...
runnerjp Posted February 14, 2009 Author Share Posted February 14, 2009 thats intresting and coinfusing ok so i got Notice: Undefined index: id in /home/runningp/public_html/info.php on line 7 Notice: Undefined index: pagenum in /home/runningp/public_html/info.php on line 8 Notice: Undefined index: forum in /home/runningp/public_html/info.php on line 9 Notice: Undefined index: notify in /home/runningp/public_html/info.php on line 10 Notice: Undefined index: username in /home/runningp/public_html/info.php on line 12 Notice: Undefined index: HTTPS in /home/runningp/public_html/getuser.php on line 11 Notice: Undefined index: HTTPS in /home/runningp/public_html/getuser.php on line 11 but info.php relys on sessions <?php /* user sessions */ $username= get_username($_SESSION['user_id']); // gest username of online user $id = $_SESSION['user_id']; // gets the online users id /* forum sessions */ $forumpostid=$_GET['id'];// gets the forum post id $pagenum=$_GET['pagenum'];// gets the page number of the forum thread $forum=$_GET['forum']; // gets the forum board name $notify=$_GET['notify']; // see if users doesnt want any more replys $profilename=$_GET['username'];// gets the page number of the forum thread /* time and date functions */ $thedate=date("U"); //get unix timestamp /* get user info from profive via $getuserprofile['gender'] or $getuser['Username']*/ $getuser = mysql_fetch_assoc(mysql_query("SELECT * from users where Username='$profilename'")); $getuserprofile = mysql_fetch_assoc(mysql_query("SELECT * from profile where ID='".$getuser['ID']."'")); ?> Quote Link to comment https://forums.phpfreaks.com/topic/145199-solved-cant-get-php-to-work-within-my-tab/#findComment-762128 Share on other sites More sharing options...
runnerjp Posted February 14, 2009 Author Share Posted February 14, 2009 even why i just try <?php error_reporting(E_ALL); include '../../../settings.php'; echo get_username($_SESSION['user_id']); ?> i get blank area within my tab Quote Link to comment https://forums.phpfreaks.com/topic/145199-solved-cant-get-php-to-work-within-my-tab/#findComment-762129 Share on other sites More sharing options...
DeanWhitehouse Posted February 14, 2009 Share Posted February 14, 2009 You should use some if statments for the $_GET vars, or use a ternary (or whatever it is) like $var = (isset($_GET['id']) ? $_GET['id'] : ""); Quote Link to comment https://forums.phpfreaks.com/topic/145199-solved-cant-get-php-to-work-within-my-tab/#findComment-762130 Share on other sites More sharing options...
runnerjp Posted February 14, 2009 Author Share Posted February 14, 2009 the thing is iv never had this problem before... only with this tab function Quote Link to comment https://forums.phpfreaks.com/topic/145199-solved-cant-get-php-to-work-within-my-tab/#findComment-762131 Share on other sites More sharing options...
DeanWhitehouse Posted February 14, 2009 Share Posted February 14, 2009 Try (in the hobbies script) putting print_r($_GET); and see if the correct $_GET vars are there Quote Link to comment https://forums.phpfreaks.com/topic/145199-solved-cant-get-php-to-work-within-my-tab/#findComment-762132 Share on other sites More sharing options...
runnerjp Posted February 14, 2009 Author Share Posted February 14, 2009 ok this is very wired... i tried making a page called text.php and entering a bit of code to show my id so i did <?php require_once 'settings.php'; echo $_SESSION['user_id']; ?> and it shows nothing :S i go to an onld page and enter the code and it shows it??? how/why is this happening Quote Link to comment https://forums.phpfreaks.com/topic/145199-solved-cant-get-php-to-work-within-my-tab/#findComment-762139 Share on other sites More sharing options...
DeanWhitehouse Posted February 14, 2009 Share Posted February 14, 2009 You are forgetting session_start(); Quote Link to comment https://forums.phpfreaks.com/topic/145199-solved-cant-get-php-to-work-within-my-tab/#findComment-762142 Share on other sites More sharing options...
runnerjp Posted February 14, 2009 Author Share Posted February 14, 2009 ermmm lol thats might have helped... you see i have been using it on all files through a diff file and seems i didnt use the file on this page then sessions did not start lol... i was really puzzeld lol ty Quote Link to comment https://forums.phpfreaks.com/topic/145199-solved-cant-get-php-to-work-within-my-tab/#findComment-762145 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.