Jump to content

RudeYute

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Everything posted by RudeYute

  1. Well, that shows how much I still have to learn! Seems amuch easier way of doing it, and it works perfectly! Thank you very much - hopefully that is all the PHP I will require, but I am kind of warming to it now, so who knows what this site may have!
  2. Not sure if that helped or not, still get the following errors: Warning: include(modules/did-you-know/) [function.include]: failed to open stream: No such file or directory in /home/uocopstt/public_html/test2/index.php on line 107 Warning: include(modules/did-you-know/) [function.include]: failed to open stream: No such file or directory in /home/uocopstt/public_html/test2/index.php on line 107 Warning: include() [function.include]: Failed opening 'modules/did-you-know/' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/uocopstt/public_html/test2/index.php on line 107
  3. I didn't censor it that time (it slipped my mind lol) - That is the exact error message it displayed, which seemed strange to me too. But the fact that it displays the page sometimes, but error messages other times suggests it is reading at least some of the files. EDIT: It sometimes displays one dot (.), sometimes two (..) and sometimes none at all as the filename. What does that mean?
  4. Hmm, I have now changed it to the following: <?php $i=0; $myDirectory = dir("modules/did-you-know"); while($file=$myDirectory->read()) { $array[$i]=$file; $i++; } $myDirectory->close(); $num = count($array); $random = rand(0, $num); $file = $array[$random]; include "modules/did-you-know/$file"; ?> And it works sometimes, but sometimes gives me the following error (line 104 is the includes line again) Warning: include(modules/did-you-know/..) [function.include]: failed to open stream: No such file or directory in /home/uocopstt/public_html/test2/index.php on line 104 Warning: include(modules/did-you-know/..) [function.include]: failed to open stream: No such file or directory in /home/uocopstt/public_html/test2/index.php on line 104 Warning: include() [function.include]: Failed opening 'modules/did-you-know/..' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/uocopstt/public_html/test2/index.php on line 104 Thanks
  5. Hi, Please bear with me, I have no real experience with PHP but am using it for the first time in a page for maintenance purposes. One of the things I am trying to do is include a random page from within a certain folder (folder: 'modules/did-you-know'). Inside this folder there are currently three files named in this format 'did-you-know-###.php' - where ### is the page number. I have no problems including the named page individually, but it is when randomising it where it causes errors. The code I am using is the following: <?php $i=0; $myDirectory = dir("modules/did-you-know"); while($file=$myDirectory->read()) { $array[$i]=$file; $i++; } $myDirectory->close(); $num = count($array); $random = rand(0, $num); include "$array[$random]"; ?> When I load the page, I get numerous errors, as follows: Warning: include(..) [function.include]: failed to open stream: Operation not permitted in /home/{USERNAME}/public_html/test2/index.php on line 103 Warning: include(..) [function.include]: failed to open stream: Operation not permitted in /home/{USERNAME}/public_html/test2/index.php on line 103 Warning: include() [function.include]: Failed opening '..' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/{USERNAME}/public_html/test2/index.php on line 103 Warning: include(did-you-know-002.php) [function.include]: failed to open stream: No such file or directory in /home/{USERNAME}/public_html/test2/index.php on line 103 Warning: include(did-you-know-002.php) [function.include]: failed to open stream: No such file or directory in /home/{USERNAME}/public_html/test2/index.php on line 103 Warning: include() [function.include]: Failed opening 'did-you-know-002.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/{USERNAME}/public_html/test2/index.php on line 103 Now, it's clear from the above that it is (at least sometimes) reading the files from within the 'did-you-know' directory, so not sure why I am getting these errors. (Especially the last one, as that would suggest an error to do with permissions, would it not?) Line 103 is the "include" line. Any help would be appreciated. Thanks
  6. Yep, created right database name - Not sure if it was actually created tho - didn't get any response from the command. If I go to http://localhost/phpmyadmin I just get "coould not connect" or similar message in my browser.
  7. Hi Dan, I did use the CREATE DATABASE command, but the application didn't see the database - database name, IP address, port and username and password were all correct. As for WAMP - That's that I thought, but for some reason couldn't connect to anything on localhost or 127.0.0.1, not phpMyAdmin or MySQL. Just got "could not connect message".
  8. Hi, I'm required to set up MySQL on my XP machine in order to use an application I need. I have tried installing the MySQL from their site, and installed fine, but configuring was a pain... have just installed WAMP to see if that's any easier. Anyway, here's what I did (no errors with these commands, although I think i'm missing semi colons at end). > mysql -u root -p > CREATE DATABASE aw_hsc > GRANT INSERT,SELECT,UPDATE on aw_hsc.* to username@127.0.0.1 identified by 'password' > mysql -D aw_hsc -u root -p < hsc.v104.sql > mysql -D fwevents -u root -p < hsc.v104.sql > GRANT SELECT on fwevents.* to username@127.0.0.1 identified by 'password' > GRANT SELECT, DELETE on fwevents.* to username@127.0.0.1 identified by 'password'; So it seems to have worked, but when I try connecting, the applications says it doesn't exist. The commands I have used are from the user guide of the application I'm trying to use it with. Can someone help me please? Thanks
×
×
  • 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.