Jump to content

Tr4mpldUndrfooT

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Tr4mpldUndrfooT's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Nah the problem was that I didn't have access... Stupid me doesn't know much about servers, trying to take it one step at a time. I had to go into the folder and take the "read only" off.
  2. My fault, that was my trying to fix the problem myself. I didn't get that originally. Warning: fopen(C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\files\counter.txt) [function.fopen]: failed to open stream: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\Counter.php on line 4 Warning: fgets(): supplied argument is not a valid stream resource in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\Counter.php on line 6 Warning: fclose(): supplied argument is not a valid stream resource in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\Counter.php on line 12 There is no invalid argument. The invalid argument was from me trying to mess around with things... Sorry.
  3. Well I don't know what to say then. Because the exact code that I Copied and pasted is the only thing I have in my counter.php file and it gives me that error. It has to be something with permissions because my book stated the exact error and said... "If you receive this error, you need to make sure that the user under which the script runs has permission to access the file you are trying to use. Depending on how your server is set up, the script might be running as the web server user or as the owner of the directory where the script is located. On most systems, the script runs as the web server user. If your script is on a Unix system in the ~/public_html/chapter/ directory, for example, you could create a world writeable directory in which to store the order by typing the following: mkdir ~/orders chmod 777 ~/orders " The problem is, I am running on a Windows server and I don't know if this pertains to me. And I am unsure if I want to use this command because I am not to sure exactly what it does. It says to bear in mind that directories and files that anybody can write to are dangerous. If it's dangerous to give permissions to a simple counter then why bother? This post got moved to PHP help and I am still wondering why. I am very noob but I am certain that my book is correct. The only problem is that it doesn't go in depth about apache and server permissions. Another thing is I am unsure why I need to use fseek because I thought w+ was meant to open the file for reading and writing starting from the begging of the document and if there was no file it would create one. and r+ would do the same as w+ besides it doesn't create a file if there isn't one.
  4. Sorry I was just assuming it was apache permisions and not a mistake in code. I basically duplicated the script in my book and the error I got is in the book but it doesn't really give a straight fix besides the "mkdir" and "chmod" commands with a note to bear in mind that world writable directories are dangerous. It also stated this problem was more of a Unix issue which I am running on Windows... <?php $document_root = $_SERVER['DOCUMENT_ROOT']; $countertxt = fopen('C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\files\counter.txt', 'w+'); $number = fgets($countertxt, 999); echo $number; $number++; fwrite($countertxt, $number); fclose($countertxt) ?> That is my script, now the counter wasn't part of a tutorial in the book but I wanted to see if I could make one following the same principle as the example in my book. I am very noob and I am sorry, if someone could explain to me
  5. Warning: fopen(C:\Program Files\Apache Software Foundation\Apache2.2 iles\counter.txt) [function.fopen]: failed to open stream: Invalid argument in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\Counter.php on line 4 I have apache2.2 installed on my computer and running it as localhost so I can practice php, the problem is... I cannot figure out why I can't set it to allow me to create files and read them. I tried to make a simple page hit counter and it's driving me insane.
  6. Alright I have almost 0 knowledge of MySQL. I have never worked with databases and I am at the beggining of my 1000 page "PHP and MySQL Web Development" book. My goal is to help a friend with a vision. I am not a complete noob when it comes to computers and have always wanted to dig past html so I decided to take on the challenge. We are developing a site and before we commit to a host I need to know exactly what our plans will require. Now I understand that I could just keep digging through my book finding answers but it's not that simple. We want to get started ASAP and obviously update like any individual. Question #1 What's a good guess on how many databases I will need? Very noob question. The web site will consist of appearances by sports figures around the world, (events, signings, and so on) Basically it would be who it is, where they are going to be, when, and cost. From my understanding that could be 1 database but I don't know so that is why I ask. It will also have users obviously with forums and a shopping cart for items we sell. I am guessing all the items can go into a database, and I don't know how the users and forums would work. We obviously want paid subscriptions and skimming through my book it looked like a sample business would split the users into one database with all their information and the shopping cart into another with all that information. I don't know if I am answering my own questions or not so please as noob as it sounds. Forums/Users/Shopping cart/events would consist of how many databases, a range if there is no real answer. Question #2 What is a good hosting service that will give me freedom with MySQL and PHP, my friend already bought a domain name from godaddy and then I started checking out the hosting service for it, I don't know if I am to thrilled about it. What do you guys think? I need something cheap to start off and obviously we can upgrade as need be.
  7. Honestly I haven't the slightest clue on how it works now but wallah, two days later and it opens the page with firefox, no changes made to the installs or ini files. Could it have been my cookies getting cleared? I did notice that when I came to this site today that I was logged out when I was supposed to be logged in forever.
  8. Ok I am sorry if this is a redundant topic here but I can not find my answer anywhere. I am trying to learn PHP and MySQL on my local machine and it's taking me forever just to get over this hiccup. After I installed MySQL, Apache2.2, and PHP5. I made the phpinfo test file only to find that when I typed in localhost/test.php firefox wanted to save it as a file. I searched for over an hour about this before I decided to open up IE... and IE actually opens it, go figure. What is the problem here? Why is firefox giving me a problem recognizing this and IE doing just fine? Is it because I am running locally? Please help.
×
×
  • 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.