Jump to content

WolfRage

Members
  • Posts

    647
  • Joined

  • Last visited

    Never

Everything posted by WolfRage

  1. Although I am not sure I totally understand your request. I believe the best solution to your problem is to use sessions. Then you can make a query to the database and extract all of the $imgid 's at the same time and feed them to an array. Save that array in the user’s session and then access them by page 6 at a time. Then you are reducing the number of request that you are making to the database and you will have an array with the correct $imgid 's. You could even cache this value and have it updated every so often to further reduce the number of queries being processed on the database.
  2. Echo $path; Is it a vaild file location for linux? Ex: no spaces?
  3. I am throwing the B/S flag on that one. I can ftp, sftp, upload via form and dowload via form with out an issue any .pdf file and still open it with out any corruption on my server. Tell your provider you need better than that. Passing the blame is unacceptable. Other wise I would tell them if that is the best they have got, then it is time to switch hosts.
  4. Instead do a file_put_contents() and wrap it to check and see if it returns false like so: <?php if(file_put_contents('avats/'.$id.'.png',$contents)===FALSE ) { echo 'You are encountering a problem writing to the disk on this server!'; exit; } This will be a definitive answer if it is a write issue, if not then let me know and we will do some more trouble shooting.
  5. You told it to die, it is just doing what you told it to. My guess is you do not have permission to write the file you are trying to write. Turn on error reporting and set E_ALL.
  6. Use isset() and remove your redundant function. The functionality you want is provided by isset(). empty() is the opposite of (boolean) var, except that no warning is generated when the variable is not set. Return Values Returns FALSE if var has a non-empty and non-zero value. The following things are considered to be empty: "" (an empty string) 0 (0 as an integer) "0" (0 as a string) NULL FALSE array() (an empty array) var $var; (a variable declared, but without a value in a class)
  7. You could get the content from the other site and then when the form is submitted, simply post this back to the other website for your verification. CURL is best for this practice. Aren't you a large web design company "DP"?
  8. Did you actually try my recomendation? Because that was pretty fast. You can also try creating a new file and then pasting the code, perhaps that file is corrupted. Beyond that not sure, good luck.
  9. You can not get around that warning because the browser is letting the user know that data external to the website they are on is being imported to the page they are about to veiw. It has nothing to do with the other site having SSL, just the fact that they data is external to the website serving the page.
  10. I know it will screw up the way your document looks, but try getting rid of the tab and space that is prior to the code. Basicly remove all indenting. Then save and try to execute it agian see if that solves the problem. If so then the special characters is the issue. It might have been a glitch though so you can try indenting it correctly agian after you have it working and save and execute to see if the glitch is still causing the problem. I can't be sure this is the issue just an educated guess.
  11. If you look at your code as it is posted you will see you have several special characters of which are probably being added by your text editor. These special characters are probably giving PHP the error.
  12. Don't do it. Don't waste your time. Simple as that. Legitimate users do not give a crap about your source code. But alot of the time they may want to open one of your links in a new window or a new tab. But you decided to disable that option! Now they are pissed as I would be and I leave your site and say screw them any ways. On top of which users that want to see your code know that you can always choose page->veiw Source. Also what if I use Firefox, Chorme, Opera, Safari, or a screen reader, you can not stop me. I have so many ways of obtianing the source that you can not stop me, except by not sending me your page in the first place. Don't forget I can also disable javascript or even save your page to my desktop and open it with a text editor. If you are going to use javascript to disable the right click just don't send me your page because I do not want the annoyance and neither do 98% of your normal users!
  13. Don't wrap the default in the while statement.
  14. First pick a method, no method is better than any other it just depends on which is best for your case. However I would rule out $_GET, although you could have the submit button pass the user ID as the actionand make sure that PHP includes the user ID everytime. If you use $_POST you need to use a hidden field and make sure that PHP includes the user ID everytime. $_SESSION is my personal favorite. In that case make sure you are using session_start() before any other code, and simply set the user ID once and call it for each use. $_SESSION['user_ID']=????;
  15. What? ???? What kind of error did you get? Remove the if statement around your file creation and just create the file. <?php if($fp = fopen($file, 'a')){ fwrite($fp, $content."\n"); fclose($fp); } ?> Should just be: <?php $fp = fopen($file, 'a'); fwrite($fp, $content."\n"); fclose($fp); ?> If you want to test for the failure of the fopen check to see if $fp is equal to FALSE.
  16. It's XHTML, I hope you are not serious. Please note the DTD of XHTML 1.0 Strict.
  17. <?php error_reporting(E_ALL); ini_set("display_errors", 1); $num = rand(1, 9999999999); $file = "activation/".$num.".".$subuser.".php"; $content = "<?phpnn" . 'require_once \'../include/constants.php\';' . "nn" . '$link = mysql_connect(DB_SERVER,DB_USER,DB_PASS) or die(mysql_error());' . "nn" . 'mysql_select_db(DB_NAME,$link) or die(mysql_error());' . "nn" . '$q = "UPDATE `users` SET `userlevel` = 1 WHERE `username` = '' . $subuser . "'\";\n\n" . 'mysql_query($q, $link);' . "\n\n" . ?>'; if($fp = fopen($file, 'a')){ fwrite($fp, $content."\n"); fclose($fp); } ?>
  18. Include an else statement and see if it is due to a file error. Also use fileputcontents it will save you some time and code. Edit: Make sure you have error reporting on to catch the error in your code. E_ALL...
  19. I think your database is spitting out an error, thus the headers are being sent. You should run that page by it's self.
  20. Where is $with2 defined? With out that you can not ever trigger the if statement. The if statement should look like this: <?php if(isset($with2)) { echo 'Your link here.'; } ?> However this will only work if $with2 is defined.
  21. CURL is your best bet. But if you want an alternative try this: <?php $data=array('foo'=>'bar','bar'=>'baz'); $data=http_build_query($data); $context_options=array('http'=>array('method'=>'POST', 'header'=>"Content-type: application/x-www-form-urlencoded\r\n". 'Content-Length: '.strlen($data)."\r\n", 'content'=>$data)); $context=stream_context_create($context_options); $fp=file_get_contents('http://127.0.0.1/test2.php', FALSE, $context); var_dump($fp); ?>
  22. You need to use an if statement to detect if the form has been submitted if so you display the page but with the corresponding message. Else you display the form.
  23. Change this to: <?php $fp = fopen($FileName,"rb"); fpassthru($fp); fclose($fp); ?> <?php readfile($FileName); ?> Other than that you are good. But if your login becomes more complex you will need to improve the authentication portion. Also Make sure your username and Password are solid, because that is your only line of defense in this case.
×
×
  • 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.