Jump to content

RottNKorpse

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Everything posted by RottNKorpse

  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.
  16. <?=$_SESSION['customer_id']?></p>[/url] Please fix the code you provided in your post...because that doesn't make any sense at all. Also yes...as cooldude832 said, turn on error reporting.
  17. <td> <?php echo $total_quantity ?> </td> <td></td> <tr></tr> <td></td> <td>Total Price</td> <td><?php echo $total_cost_of_order ?></td> You need to close your echos... echo $total_quantity; without the ; the echo never ends thus breaking the code. Ps. PLEASE take off your caps lock...that is annoying. There are a lot of people here to help and capping everything to get attention to your question is just going to irritate people.
  18. Yes and No...it could be done that way or through one file as well. Yes, it would be easier to have multiple files to pass the information...one file have the form and the other file run the php script and to parse the form information. No, you could do it all through one file by using cases and the switch function to switch to different cases through operations. the latter option would be more complicated to do. Either way you do it jkewlo is correct in saying that it needs to have method="get" action="otherpage.php" in the form tag otherwise it won't actually do anything. If you decide to learn switching between cases the action will just be the filename of the same file running the script but if you do the separate files you will need to make the action value whatever you name the php file that runs the script.
  19. well most columns that are null are null for a reason so if you don't know whether or not it will affect it negatively I would suggest researching it before doing anything. If you are just putting empty into them that is a complete waste of time and database space because whether it is '' or 'empty' it will do the exact same thing except 'empty' will take up more space and depending on the amount of empty column values that could be a big difference. Anyway, good luck and hope it works out for ya.
  20. Well I dont know what you mean by "as checked"... I do have two questions though, (1) Why is the code calling to alter a php file, if you just want it to email someone why is it writing to a file? (2) Did you write this script or did someone give it to your or did this come include with some other type of script such as a CMS?
  21. why would you want to do that? you would be adding unnecessary data to your database but sure it's possible. the following code is NOT a php script...just the SQL. To use the following code you need to run the sql directly into phpMyAdmin or whatever database management system you use. UPDATE `database_name`.`table_name` SET `column_to_change` = 'empty' WHERE `column_to_change` = ''; I didn't give you a php script because if you probably don't want to run this more than once because after you alter them I doubt you would be making any more values be blank.
  22. I'm not interested in looking at the code to find the flaw straight up so please provide errors or what is happening when using that code?
  23. do you know how to build sessions? because this is not a simple thing to learn and I would just suggest finding an open source php membership system to start out with such as any open source CMS. You could also find barebones membership systems that are designed for only that but still if you want one built from scratch you will need to hire and pay someone to do that or spend quite a bit of time learning how to do it yourself.
  24. well this is very dependent on the membership system you are using because most (if not all) are going to work differently...some use sessions to fetch data from DBs and some use cookies.
  25. 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.
×
×
  • 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.