Jump to content

Casalen

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Everything posted by Casalen

  1. What is the code? Post at least some of it here. What error messages show up?
  2. I'd probably do a file, but performance wise it's probably more server dependent. If both are running off of the same server it shouldn't be much different (from my understanding), SQL would need to look a little more but not enough to change anything. Also, if it's just one email, a file would be slightly easier to work with.
  3. It closes itself after the script runs, so no. Unless you want to close it for some other reason, of course.
  4. . [edit] I had an issue with posting this, but it's a bit late anyway. Nevermind.
  5. I'm working on creating a gallery script. It calls up a database file and finds out what thumbnail to use in selecting a gallery, then displays it. The thumbnails should be kept in gallery/gal_th/image.jpg. They aren't showing. First I had this: echo "<td><img src=\"./gal_th/$gal_arr[0]\"> Then: $gal_th = "./gal_th/" . $gal_arr[0]; echo "<td><img src=\"$gal_th\"> Then: echo "<td><img src=\"./gal_th/people.jpg"> Then: echo "<td><img src=\"http://www.kgpnet.net/kgpphoto2/gallery/gal_th/people.jpg\"> So, I think I've used every way to call the image I can. In each I case I checked properties on the image; the script is finding the image name, but is ignoring the directory gal_th. Even when I put the absolute path it was ignored, as though I had only put the filename. Any ideas why? Here's the script up to that point: //First, let's get the options. include './db/settings.db'; //In case there are rows, we offset to check which will be new, not the end //This tells us we haven't done anything yet. $set = 1; //First, we need to choose a gallery. Let's find the data: $gal_file = file("./db/gals.db"); //Now we list in sets, names without descriptions, depending on settings. if($mode == "grid"){ foreach($gal_file as $gal_line){ $gal_arr = explode("|",$gal_line); $gal_th = "./gal_th/" . $gal_arr[0]; if($set == "1"){ echo "<table><cellspaceing=\"6\"><tr><td><img src=\"http://www.kgpnet.net/kgpphoto2/gallery/gal_th/people.jpg\"> <br> $gal_arr[1]</td>"; }
  6. Put a semicolon after rsort($files), see what that does. Not ending things properly is the most common problem I have constantly, so it makes sense.
  7. So you have separate HTML pages for each update? What exactly are the updates? I would use a database for most anything. You can use a text file if you don't have SQL access, but some more information on what exactly you're going for would help. If you still want to have separate pages, I think you'd want to have a database with the filenames of each update. The exception would be a directory listing could be changed into an array, but I doubt it can.
  8. By that I'm referring to the 'w', etc. Sorry I wasn't much more detailed, but my eyes were glazing over at that point. Here is the first part of the script, right up to the first error message- could not open file. The second error message is that it couldn't write to the unopened file, but this is the part that causes me issues. It decides what number is up next for the client's images, $dird tells me if it finished or not. As you can see, the fopen uses the same type of path as the mkdir, which should make it work pretty simply. <? $num = 1; $dird = 1; if($dird == 1){ echo "";} while($dird == 1){ echo ""; $filename = "http://www.kgpphoto.com/sales/$num"; if(!is_dir("./sales/$num")){ mkdir("./sales/$num"); chmod("./sales/$num", 0777); $path = "./sales/$num/"; $dird = 2; } $num++; } $handle = fopen("./sales/$num/order.txt", "w");
  9. I would like to create a text file containing order information. I'll spare you the rest of the code, but the script creates a directory where people can upload images. With each upload the information of the filename and order is put into two variables, $order_text and $order_table, the first for my text file, the second for display. My goal is to then write to the text file that I made after creating the directory. Unfortunately, fopen is giving me 'file does not exist' errors. The file doesn't exist, but I'm using modes that are supposed to create a file if it isn't found. $handle = fopen("./sales/$num/order.txt", "w"); And w+, x, x+, etc. And yes, the directory is chmodded so it's not a permission problem. Help would be greatly appreciated.
  10. I would love to compare two servers (or more) and have my script decide which one is working best, then pass that to my video player so it knows which one to use. Pinging makes sense in this. However, the only way I see to do it is with the system command, and I can't figure out how to get a usable result from this instead of a printed output. Besides continuing to mess with that, any other way to accomplish the same thing (mirror comparisons) would be nice. Or suggestions on a low priced, reliable, somewhat fast server to host these videos on, which would probably be better.
  11. I've never really used SQL. Right now I'm trying to install textual verification to PHPbb2. The script connects to the database, then tells me there's a syntax error in the following: CREATE TABLE phpbb_textual_confirmation (id INTEGER NOT NULL AUTO_INCREMENT, question TEXT NOT NULL, answers TEXT NOT NULL, PRIMARY KEY (id) ); INSERT INTO phpbb_textual_confirmation(question,answers) VALUES ('Are you human?', 'yes\nja\noui'); INSERT INTO phpbb_textual_confirmation(question,answers) VALUES ('Say hello', 'hello\nhi\nhallo'); Specifically, the first line. I've moved stuff around a bit in it to no avail, but I'm really not sure how this stuff is supposed to look yet.
  12. Okay, so I'm expanding the user data functions on a script. It now creates a directory for each new user, including a few files. Each of the database files starts with a die command so that it can't be easily read from the browser. After the die command is written the character \n, which should translate into a new line in the text file. So I take a file, open it in notepad++ to see if the data wrote, and find the data written... except that I see \n instead of a new line. All except for one file, base.db.php, which works perfectly. Any suggestions? I don't really need that part, but it's frustrating anyway. I'm pretty tired right now, so forgive me if it's something I should have seen. [code]$new_index_file = fopen("$userdir" . "/index.php", "a"); $new_base_file = fopen("$userdir" . "/base.db.php", "a"); $new_profile_file = fopen("$userdir" . "/profile.db.php", "a"); fwrite($new_base_file, "<?PHP die(\"You cannot access this file.\"); ?>|\n"); fwrite($new_base_file, "$add_time|$reglevel|$regusername|$regpassword|$regnickname|$regemail|$regusergroups|0|0||||\n"); fwrite($new_profile_file, "<?PHP die(\"You cannot access this file.\"); ?>|\n"); fwrite($new_profile_file, "$firstname|$lastname|$birthday|$hidemail|$title|$description|$status|0|0|||\n"); $new_calendar_file = fopen("$userdir" . "/calendar.db.php", "a"); fwrite($new_calendar_file, '<?PHP die("You cannot access this file."); ?>\n');[/code]
×
×
  • 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.