Jump to content

aleX_hill

Members
  • Posts

    143
  • Joined

  • Last visited

    Never

Everything posted by aleX_hill

  1. Thank you very much for the in depth replies. I will take a look at the code when I get a spare moment and take a look at the things you mentioned. If it doesnt make any difference I will post some code up for more specific troubleshooting. Cheers, Alex
  2. And so the plot thickens. Two different users on different computers get different errors. User 1: Warning: include() [function.include]: Unable to access ../profiles/singleton.php in /path/pages/login.php on line 16 Warning: include(../profiles/singleton.php) [function.include]: failed to open stream: No such file or directory in /path/pages/login.php on line 16 Warning: include() [function.include]: Unable to access ../profiles/singleton.php in /path/pages/login.php on line 16 Warning: include(../profiles/singleton.php) [function.include]: failed to open stream: No such file or directory in /path/pages/login.php on line 16 Warning: include() [function.include]: Failed opening '../profiles/singleton.php' for inclusion (include_path='.:/usr/share/php5/') in /path/pages/login.php on line 16 Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13) in /path/includes/sqlConnect.php on line 5 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /path/includes/sqlConnect.php on line 6 Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13) in /path/pages/login.php on line 22 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /path/pages/login.php on line 22 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /path/pages/login.php on line 23 User 2: Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13) in /path/includes/menu.php on line 3 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /path/includes/menu.php on line 3 Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /path/includes/menu.php on line 4 Followed by general SQL errors further down the page. The user 1 stuff makes sense to a degree. The SQL login details are in one of the include files, so when it cant find that there will be SQL errors. But user 2 can include the files (lack of errors and the session details stored in one of the included files are active), but cannot connect to the SQL server. The SQL connect statement uses information from the SESSION vars, which are all active and populated with the correct details. And like I said in my first post, the errors are not happening when I am not on the work network, so I doubt its a code issue as such.
  3. The include is right at the top of the page. All that comes before it are the open php tag and session_start. The file worked fine on the work network for a long time, but just recently stopped. I think the server it was hosted on needed to change nameservers due to a DoS attack, but as far as I can tell that shouldnt be the issue considering I can still access the site, just the servers are having issues accessing the included files. And correct, not on the home network. It seems that the work network is the only place where it wont work.
  4. OK, so I dont think this is a code issue as such, but I am completely stumped as to where the issue could be. I have a page with some standard include() functions at the top. When I access the page from home, everything operates as it should, when I access it from work (on multiple machines), I get the standard "unable to open stream" and "unable to access" warnings for the include statements. I have tried hard refreshing and deleting cache (not that it should make a shred of difference) etc, but the error is still there after a week or so. Does anyone know what could be causing this issue?
  5. I do realise I am a bit vague on the code. The function file is over 600 lines long, hence me not posting it here. I will try removing all other functions and see how that goes...
  6. Thanks thorpe. I know that, which is why I am so puzzled...
  7. OK, this is a strange one I am hoping someone can help with. I have a file with a heap of functions which work fine. This file is included in my other files, and the function to display the content is called. For example I include the master file in guestbook.php, which calls showGuestbook(). Same with contact.php, it calles showContact(); etc. The file is outside the web root of the website calling it. So I went to add another function called downloadFile(). When I try to call the function, it gives me the "call to undefined function" error. I have tried renaming it to a few diff things, same error. So I thought there could be a brace error somewehere in the file. This is the strange bit.... When I put that function at the top of the file, the page seems to fail to parse. None of the functions are available... The function so far is simply: function downloadFile() { echo "Download File"; } Can anyone shed some light on this strange behaviour, especially the errors that occur just because I move the code higher up the file.
  8. $sql = "SELECT * FROM skills WHERE id='$sid'"; --> include quotes around '$sid' and see if that changes things.
  9. I cant see why it wouldnt be working with that code, so I am stumped. @PFMaBiSmAd: Glad you can see the problem with the session and paths etc now. I dont let users send through an upload path, more that one of my session variables is used in a switch statement to find the correct path, so there are a defined, limited number of places that they can upload to. And of course I restrict files to "safe" extensions, ie gif and jpg. @dschuett: We were all learning at one point (and still contantly learn), and I am sure if you go back and look at my first few posts then you will see I started in the same position. If you still cant get it to work, try my other suggestion where you pass through just the email rather then the whole session, and see how that comes out, assuming you dont need the other session vars.
  10. I am a bit out of touch with this code, havent touched it since the original post, but try using exactly this: scriptData: { <?php echo session_name(); ?>: '<?php echo session_id();?>'} And then: $session_name = session_name(); session_id($_POST[$session_name]); session_start(); From memory this will set the entire $_SESSION variable. Or try editing your line to match this: scriptData :{current_email:'<?php echo $_SESSION['current_email']; ?>'} //removed some quotes as well as changed session var Then in the processing see what $_POST['current_email'] holds...
  11. This is how I got the session variable into the flash uploader: <input id="fileInput" name="fileInput" type="file" /> <script type="text/javascript">// <![CDATA[ $(document).ready(function() { $('#fileInput').uploadify({ 'uploader' : '/uploadify/uploadify.swf', 'script' : '/uploadify/uploadify.php', 'cancelImg' : '/uploadify/cancel.png', 'auto' : true, 'folder' : 'uploads/', 'multi' : true, 'sizeLimit' : '800000', 'fileDesc' : 'Image Files', 'fileExt' : '*.jpg;*.gif;*.png;*.bmp', scriptData: { <?php echo session_name(); ?>: '<?php echo session_id();?>', albumID : <?php echo $_GET['albumID']; ?>} }); }); // ]]></script> The obvious change is the scriptData being passed in. With the corresponding session_start() called at the beginning of the file. Then I had this in the file which loads the uploadify.php: $x = $_POST; // your method type $session_name = session_name(); if (!isset($x[$session_name])) { // not logged exit; } else { session_id($x[$session_name]); session_start(); } Hope this is what you were after.
  12. Turns out there were some malicious lines of code inserted into my remote copy (hence the more lines in the remote copy then my own). All fixed now, thanks.
  13. Does your webserver have read access to the include directory and the specific file. The "Permission Denied" would suggest that there is a permission error, not a filepath error.
  14. OK, im not too crash hot on classes, so hoping someone can help me with this error: This is from an osCommerce application (I know someone will probably tell me to post in 3rd party scripts, but I am more interested in whats generally causing the error). The thing that confuses me is that application_top.php is only 236 lines long.
  15. If you mean without re-loading the page, you will need some sort of client side AJAX script, I use jQuery. The other option is to submit to itself (like you are) and then put the echo command after the form (remove the if statement to check if it has been submitted). If you wanted the values to stay in the form, use value="<?php echo $_POST['numa']; ?>" to set the values of the field.
  16. To implement a rich text editor you would probably want to use one of the following (google them) CKEditor tinyMCE jQuery Editor dojo.editor (probably not the best option)
  17. Basically what is happening is that when you run the query you should get a resource stored in $result, but if there is an error int the query (which there is in your case) then it stores false in $result, which is why the error is telling you it has been given a boolean. OK, so are you sure that your table is called Game (with a capital). Are you sure that you can sort by number? Try $query = "SELECT * FROM Game"; first, then slowly add in other components (ie ORDER and LIMIT) to see what the problem is.
  18. in that case you will also need to use if($_POST['submit'])
  19. Assuming that you fixed my error where i had a dash instead of an equal sign for $result = mysql_query... then there is probably a syntax error with your query. To troubleshoot I would replace "XP" in the query with * and see what happens.
  20. I think you might be looking at it the wrong way. <?php if(date("D") == "Mon") { $currentDay = time(); //note that strtotime("today") is ignored } else { $currentDay = strtotime("last Monday"); } //Now we have a timestamp in the first day of the week (Mon) ?> <table> <?php for($i=0; $i<7; $i++) //Do this for 7 days { echo "<tr><td>".date("l",$currentDay)."</td><td>".date("d-M-Y",$currentDay)."</td></tr>"; //Output each line in the table $currentDay += 24*60*60; //add 24 hours to the timestamp to get the next day (Tue, then Wed etc) } ?> </table>
  21. Try passing the id to the tutorial page through the URL, and then use the tutorial.php page to search the database and display the content. The other thing that may be causing the problem is what your field in the database is set as. I normally use TEXT of BLOB for page content in my databases. For example VARCHAR will only display 256 characters, give or take if I am not mistaken.
  22. Try using date("D"); So: if(date("D") == "Mon") $startOfWeek = date("d-M-Y"); //note that strtotime("today") is ignored else $startOfWeek = date("d-M-Y",strtotime("last Monday"));
  23. Try this? $query = "SELECT XP FROM Game ORDER BY number DESC LIMIT 1"; $result - mysql_query($query); $row = mysql_fetch_assoc($result); echo "The the highest XP is". $row['XP'];
  24. http://www.google.com.au/search?q=php+to+pdf
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.