Jump to content

RottNKorpse

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

RottNKorpse's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok here is what I am wanting to do: Host an image on Photobucket, Use PHP to generate the image with a url as if it is being hosted on my site and cache the php generated image for faster loading later. I am currently using a photobucket account to host my images so the original file I want to cache is actually at the following URL: http://i87.photobucket.com/albums/k126/WrestleMation/Brain_Rush_S01E01_DotNXT_DSR_XviD-E.gif I am wanting to display the image with a URL from my site so that it doesn't show the fact that it is on a photobucket account. http://wrestlemation.com/fa_Brain_Rush_S01E01_DotNXT_DSR_XviD-E.gif As you can tell the image from the second link is being generated to pretty much pull in information from the first one and the displaying of the first one under the new URL works just fine. To do what I've done, I used .htaccess rewriting to make the php image generation to use a standard image format url. The php I used to generate the php image is... //Get dynamic filename from rewritten url. --- which would be : Brain_Rush_S01E01_DotNXT_DSR_XviD-E $gif_file = "http://i87.photobucket.com/albums/k126/WrestleMation/".$_GET['file'].".gif"; //Load the image header("Content-Type: image/gif"); echo readfile($gif_file); die(); Ok so the image is generated just fine with my code but the problem is that it has to reload and redownload the image every time the browser is refreshed. Is there anyway I could force all browsers to cache the php generated image so when the generated url is called the next time it pulls from cache instead of pulling from the photobucket account?
  2. oh ok I didnt see the solved button...will do and thanks again
  3. that worked!!!...thanks dude... I used your suggestion of using mysql_fetch_assoc instead of fetch_row and it worked. now looks like $sql = "SELECT * FROM ".$prefix."_table"; $result = mysql_query($sql) or die('Query failed: ' . mysql_error()); $song_order_sql = mysql_fetch_assoc($result); $song_order = $song_order_sql['song_order']; echo $song_order; so thanks again dude.
  4. I appreciate your help jonsjava but I already stated the prefix variable works fine and is certainly not the issue but just to cooperate I hardcoded the prefix into the query and still same thing.
  5. thanks for cleaning it up but it still doesnt give me any data...I've tested the sql in phpmyadmin and it is fine...the prefix variable is defined, on a separate file as I stated in the first post.
  6. ahh...ok well I changed the variable and now I have $song_order_sql = @mysql_fetch_row(mysql_query("SELECT * FROM ".$prefix."_table") or die('Query failed: ' . mysql_error())); $song_order = $song_order_sql['song_order']; echo $song_order; yet it still wont work.
  7. I have been staring at just a few lines of code for over an hour and I don't see a single thing wrong with it so I wanted to get some new eyes looking at this to possibly shine some light on the issue. What I am wanting to do is simply fetch a single value from a table in my database, a table that only has 1 row and 4 columns. Then to insert that data into a variable and call the variable later in the file. The problem is for some reason when I call for the data it doesn't retrieve anything. // Database Connection $dbcnx = @mysql_connect("$dbhost","$dbuname","$dbpass"); $dbselect = @mysql_select_db("$dbname"); if ((!$dbcnx) || (!$dbselect)) { echo "Can't connect to database"; } // Fetching data from MySQL $order_sql = @mysql_fetch_row(mysql_query("SELECT * FROM ".$prefix."_table") or die('Query failed: ' . mysql_error())); $order = $order_sql['order']; echo $order; All of the variables for connecting to the database and the prefix are stored in a separate file and they are pulled from that file with no issue. I've even tested to see if it is even looking for the table correctly and it is because I deleted the table which caused it to tell me it didn't exist so I recreated it and still the same empty result. Here is my MySQL structure That's it, nothing special in either the code or the table yet it still refuses to pull the data...any idea what it could be? Thanks in advance
  8. well you could do this with a php variable... run sql to pull the values and make an if statement such as if ($variable_example = "") { $variable_example = "empty"; } This would save database space and only increase the script time by about 0.00003 percent. Anyway, I do understand why you did it but I think if you try that you will find that works just as well and doesn't take up any space to do it.
  9. sorry to bring this to your attention but you are probably going to want to kick yourself after I point it out. scr='index.php?img= should be src='index.php?img=
  10. If they are NULL, you need ... WHERE `column_to_change` IS NULL; true but either would work...I thought about updating the code for that but was waiting to see if he would explain explain why he would even want to do that. Maybe I'm clueless but I seriously don't see the point in doing that.
  11. oh snap my bad...I didn't even see "isset" in his code...I thought it was trying to run a multiple file form through one file.
  12. $row = mysql_fetch_row($result); should also work
  13. define('ACCESS_BLOCKED', true); if(!defined('ACCESS_BLOCKED')) { die ("You can't access this file directly..."); } well you could do it by IP but ONLY if you have a static IP address. You could use a membership system to check for logged in users and then username but you will need to get a system for that. IP would be easier but ONLY if you have a static one. You need to create 404.shtml in your root directory and then edit that file to display whatever you want...your host probably has a 404 generator script in your hosting panel and if your host uses cPanel then I guarantee you they have a script to generate it those files.
  14. we are going about it the wrong way...where did you get this script and if it is a shopping cart system what is it called...(examples: OSCommerce, CubeCart, ZenCart, etc.)
  15. By doing this you are making it look for one value instead of the tree value you want... instead do this <a href="index.php?id='.$PHP_SELF.'?id2=PS2">PS2</a> I haven't tested this because I don't have time to but that should make the id value to the filename of the page it is currently running through. Hope this does what you want it to. that jsut does this: index.php?id='.$PHP_SELF.'?id2=PS2 Sorry lol forgot something important... <a href="index.php?id=<?php echo $_SERVER['PHP_SELF']; ?>?id2=PS2">PS2 If the script doesn't like the PHP_SELF variable then you would have to do it manually by making the href value be "index.php?id=gh?id2=PS2" But laffin does bring up an interesting point...the site you linked to is using a database (DB) to store the data and calculate things. If you are trying to do something like them you will need to work with a database.
×
×
  • 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.