Jump to content

Ninjakreborn

Members
  • Posts

    3,922
  • Joined

  • Last visited

Everything posted by Ninjakreborn

  1. perfect finally someone who had something to say about the mcrypt library, perfect, this should fix all my problems, I was thinking it had something to do with that, if that doesn't work then I am taking off the srand at the top and trying it that way, thanks.
  2. I already went over that tutorial 6-7 times there are 2 problems I am having, when I run my functions together, on the same page, it encrypts it, decrypts it, and shows the output of both.  When I encrypt on one page, $password, then enter it into the database, it's encrypted in the database, it even shows it, but hten when I pull anotehr page up, pull the data, decrypt it, it stays encrypted anyone, I use what I showed above, I don't understand why it's not decrypting?
  3. [code]echo "<img alt=\"\" src=\"{$imageArr[$imageshow]}\"> <a href=\"{$imagelink[$imageshow]}\">";[/code]
  4. Also like he said above, copy and paste the exact full error message 505, not just 505 internal server error, but if there's more copy and paste the entire thing.
  5. http://wordpress.org/support/topic/73138 http://bugs.php.net/bug.php?id=35970&edit=1 http://gallery.menalto.com/node/48174 http://bugs.php.net/bug.php?id=9981&edit=1 http://support.netfirms.com/idx.php/8/002/article/How-do-I-fix-a-500-Internal-Server-Error-on-my-website.html here is your code [code]if (isset($_POST['addfile'])){ $error = 0; $catid = $_POST['category']; $bigimg_path = "/address/photos/img/"; $linkimg_path = "/address/photos/linkimg/"; $bigimg_path = $bigimg_path . basename( $_FILES['bigfile']['name']); $linkimg_path = $linkimg_path . basename( $_FILES['linkfile']['name']); $bigimg = "http://address/photos/img/". basename( $_FILES['bigfile']['name']); $linkimg = "http://address/photos/linkimg/".basename( $_FILES['linkfile']['name']); if(move_uploaded_file($_FILES['bigfile']['tmp_name'], $bigimg_path)) {     echo "The large file ".  basename( $_FILES['bigfile']['name']).     " has been uploaded<br />"; } else{     echo "There was an error uploading the large file, please try again!";     $error = 1; }; if(move_uploaded_file($_FILES['linkfile']['tmp_name'], $linkimg_path)) {     echo "The link file ".  basename( $_FILES['linkfile']['name']).     " has been uploaded"; } else{     echo "There was an error uploading the link file, please try again!";     $error = 1; }; if ($error == 0) { $conn = mysql_connect($dbhost,$dbuser,$dbpass) or die('Error connecting to mysql'); mysql_select_db($dbname,$conn);     $query = "INSERT INTO galimg (catid, img, linkimg) VALUES ('$catid', '$bigimg', '$linkimg')";     mysql_query($query) or die('Error, query failed');     mysql_close($conn); }; };[/code] do this below [code]if (isset($_POST['addfile'])){ $error = 0; $catid = $_POST['category']; $bigimg_path = "/address/photos/img/"; $linkimg_path = "/address/photos/linkimg/"; $bigimg_path = $bigimg_path . basename( $_FILES['bigfile']['name']); $linkimg_path = $linkimg_path . basename( $_FILES['linkfile']['name']); $bigimg = "http://address/photos/img/". basename( $_FILES['bigfile']['name']); $linkimg = "http://address/photos/linkimg/".basename( $_FILES['linkfile']['name']); /* block out all of this, try it see if it works if(move_uploaded_file($_FILES['bigfile']['tmp_name'], $bigimg_path)) {     echo "The large file ".  basename( $_FILES['bigfile']['name']).     " has been uploaded<br />"; } else{     echo "There was an error uploading the large file, please try again!";     $error = 1; }; */ if(move_uploaded_file($_FILES['linkfile']['tmp_name'], $linkimg_path)) {     echo "The link file ".  basename( $_FILES['linkfile']['name']).     " has been uploaded"; } else{     echo "There was an error uploading the link file, please try again!";     $error = 1; }; if ($error == 0) { $conn = mysql_connect($dbhost,$dbuser,$dbpass) or die('Error connecting to mysql'); mysql_select_db($dbname,$conn);     $query = "INSERT INTO galimg (catid, img, linkimg) VALUES ('$catid', '$bigimg', '$linkimg')";     mysql_query($query) or die('Error, query failed');     mysql_close($conn); }; };[/code] Copy and paste the above over your other code.  THen if it still gives you error do this. [code]if (isset($_POST['addfile'])){ $error = 0; $catid = $_POST['category']; $bigimg_path = "/address/photos/img/"; $linkimg_path = "/address/photos/linkimg/"; $bigimg_path = $bigimg_path . basename( $_FILES['bigfile']['name']); $linkimg_path = $linkimg_path . basename( $_FILES['linkfile']['name']); $bigimg = "http://address/photos/img/". basename( $_FILES['bigfile']['name']); $linkimg = "http://address/photos/linkimg/".basename( $_FILES['linkfile']['name']); if(move_uploaded_file($_FILES['bigfile']['tmp_name'], $bigimg_path)) {     echo "The large file ".  basename( $_FILES['bigfile']['name']).     " has been uploaded<br />"; } else{     echo "There was an error uploading the large file, please try again!";     $error = 1; }; /* Block out this one completely. if(move_uploaded_file($_FILES['linkfile']['tmp_name'], $linkimg_path)) {     echo "The link file ".  basename( $_FILES['linkfile']['name']).     " has been uploaded"; } else{     echo "There was an error uploading the link file, please try again!";     $error = 1; }; */ if ($error == 0) { $conn = mysql_connect($dbhost,$dbuser,$dbpass) or die('Error connecting to mysql'); mysql_select_db($dbname,$conn);     $query = "INSERT INTO galimg (catid, img, linkimg) VALUES ('$catid', '$bigimg', '$linkimg')";     mysql_query($query) or die('Error, query failed');     mysql_close($conn); }; };[/code] try that one above if it doesn't work then do this [code]if (isset($_POST['addfile'])){ $error = 0; $catid = $_POST['category']; $bigimg_path = "/address/photos/img/"; $linkimg_path = "/address/photos/linkimg/"; $bigimg_path = $bigimg_path . basename( $_FILES['bigfile']['name']); $linkimg_path = $linkimg_path . basename( $_FILES['linkfile']['name']); $bigimg = "http://address/photos/img/". basename( $_FILES['bigfile']['name']); $linkimg = "http://address/photos/linkimg/".basename( $_FILES['linkfile']['name']); if(move_uploaded_file($_FILES['bigfile']['tmp_name'], $bigimg_path)) {     echo "The large file ".  basename( $_FILES['bigfile']['name']).     " has been uploaded<br />"; } else{     echo "There was an error uploading the large file, please try again!";     $error = 1; }; if(move_uploaded_file($_FILES['linkfile']['tmp_name'], $linkimg_path)) {     echo "The link file ".  basename( $_FILES['linkfile']['name']).     " has been uploaded"; } else{     echo "There was an error uploading the link file, please try again!";     $error = 1; }; /* if ($error == 0) { $conn = mysql_connect($dbhost,$dbuser,$dbpass) or die('Error connecting to mysql'); mysql_select_db($dbname,$conn);     $query = "INSERT INTO galimg (catid, img, linkimg) VALUES ('$catid', '$bigimg', '$linkimg')";     mysql_query($query) or die('Error, query failed');     mysql_close($conn); }; */ };[/code] try all of these just like that, it will single out, take note if any of these stop the error, if one of them stops the error then the coded out part is the thing we need to concentrate on, then after that, show us the code again and tell us the results of this test.
  6. also paypal emails, I want to encrypt those, maybe even emails just for fun.
  7. Ah very good point thank you, I had no idea such a thing exists, so now i have choosen what I am going to do about that, I will do external processing, now the last thing, what about other stuff, I still need to get this to work, 2 way encryption/decryption, social security numbers, and passwords, and if nothing else session id's.  I still need to get it to encrypt, send to database, pull from database, decrypt, but it's not decrypting, and thanks for enlightenment, now I understand about the credit cards, I will study up on that later.
  8. exec() and system() are dangerous when running through user input, make sure you never give the end users the ability to run anything through exec or system without severe cutting down, and checking there text, also I don't know how to help on this specifically but some advice.
  9. is it blank, if it is then is error viewing off in php.ini if so it's syntax error, is it returning a specific error or what.
  10. but setting it on would be dumb, register globals is a severe security flaw the only reason they are like that is because they are too lazy to rewrite there damn code, I think you should find another one that didn't require this, and to make it compatible just change all teh post variables to $_POST['variable'] and get to $_GET['variable'] There is one thing you can do to make it compatible without doing anythign but inserting some code at hte top, it's a quick technique to allow you to still use it, and prevent you from touching the code find out where all the form variables are and reinitialize those into single variables like if someone was submitting a form that had username, and password, and email then do this at the top $username = $_POST['email']; $password = $_POST['password']; $email = $_POST['email']; THa'ts it the entire form will run now with register_globals still set to off. Do that for all get, post variables, cookies and sessions, it will run smoothly after that. Also if you have no choice, or want to, what you do is open your php.ini file it should open it up in word, you click find at the top. Copy and paste the following register_globals THen it will have a set beside it, it will be either on or off set it like you need it then save the document and reupload it back to the server simple.  If you don't have access ot it, then set your editor, or whatever to open the extension .ini as a text file the same you would do with .htaccess if it's dreamweaver open extension handler, and put in .ini put the default editor as word, if it's frontpage(I hate frontpage), or something else, it'll do the same thing.
  11. How else do you expect to do online processing, you have to have a credit card to do that, are you going to call the person each time, and say hey what is your credit card number, I need to give it to my credit card processor here so I can charge you, but we have to call to recieve that.  I don't htink my client has that time, yes credit card numbers ALWAYS get stored on e-commerce websites where credit card transactions take place, that is the only way.  And even if you don't use it in the database, they have to enter it, and when it goes back and forth from teh server, it can be detected if not encrypted so either way it needs to be encrypted.  The same with social security numbers, working on high profile sites, that is the best form of identification to take.
  12. Think about this, it pulls features with one way encryption, no remind you of the password, no what is your secret question for retrieving your password.  The other thing, think about what happens when you 1 way encrypt credit card numbers, social security numbers, session id's how do you expect to pull the information, this isn't for passwords, I don't even care about the passwords, I could do an mdhash on that, but that's not going to help me later on in this project, when i Have to record credit card numbers.  That is why i am trying to get this to work.
  13. Also you can ONLY interpolate with double quotes, here is an example [code]$message = "   <h1>HTML E-mail</h1>   <p>This is an <b>HTML</b> e-mail.</p>   <p>try to put php in the html php page" . $variable1 . "</p>   <p>Then you continue your message here</p>    <p>Then you try to add more here" . $variable2 . "</p>   <p>Then you continue down here even more</p>";[/code]   Also keep in mind this will look retarded, atleast in the email it will be like this say variable1 is here, and variable 2 is there it will look like this [quote]HTML E-Mail This is an html email try to put php int he html php pagehere then continue your message here then try to add more herethere then you continue down here even more[/quote] You see how they run together, the way to fix this, one way is that hte end of each one leave a blank line like this [code]$message = "   <h1>HTML E-mail</h1>   <p>This is an <b>HTML</b> e-mail.</p>   <p>try to put php in the html php page " . $variable1 . "</p>   <p>Then you continue your message here</p>    <p>Then you try to add more here " . $variable2 . "</p>   <p>Then you continue down here even more</p>";[/code] That should fix your problem, if you are sending more than 20-30 emails at once, drop the html email with php, and use the pear package, it opens up a constant stream unstead of killing server power by opening up 20-2000 streams, one for each email.  You can check that at php.net  just search pear
  14. inserting the variables are the same, if it doesn't work break up the message, end a section with " . variable . "begin message again it will add them in there, in the proper places, it wouldn't be that hard you should be able to substitute them like this anyway {$variable} or if it's post or get you do the same thing, but when you are enterpolating those you leave off the single quotes normally its $_POST['variable'] $_GET['variable'] when you are interpolating it's $POST[variable] $_GET[variable] Be careful of html mail, because php always sends the mail 2 times, atleast what php.net says, it ALWAYS sends 2 emails so if it's a mailing list, they get 2 emails.  
  15. There has to be someone here with atleast some mcrypt experience. I have the thing set up on one page, it encrypts the data, decrypts it properly, but when I put it in the database encrypted, and decrypt it on the otehr page it's not working, here is my encryption encrypt [code]srand((double)microtime()*1000000 ); $td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_CFB, ''); $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND); $ks = mcrypt_enc_get_key_size($td); $key = substr(sha1('bullshit'), 0, $ks); mcrypt_generic_init($td, $key, $iv); $password = mcrypt_generic($td, $password); mcrypt_generic_deinit($td); mcrypt_module_close($td);[/code] decrypt [code]<?php $connect = mysql_connect("localhost", "#####", "####"); $select = mysql_select_db("elostand_general"); $select = "SELECT username, password FROM userinfo WHERE username = 'joyel';"; $query = mysql_query($select); $rows = mysql_num_rows($query); while($array = mysql_fetch_array($query)) { extract($array); srand((double)microtime()*1000000 ); $td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_CFB, ''); $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND); $ks = mcrypt_enc_get_key_size($td); $key = substr(sha1('bullshit'), 0, $ks); mcrypt_generic_init($td, $key, $iv); $decrypteddata = mdecrypt_generic($td, $password); mcrypt_generic_deinit($td); mcrypt_module_close($td); echo "{$decrypteddata}"; } ?>[/code]the key is just an example. What's wierd is it works on the same page, together, but when it's on different pages it's not decrypting the data, am I setting up something wrong.  i like php, I am doing everything with it, even insecure stuff, I already played with cookies, I am learning sessions today or tomorrow, the only thing is, I want to use some of these libraries, I know this is heavy encryption, I also saw it on php.net, this is very heavy encryption, any 2 way forms can be decrypted by a hacker but there not easy, and php does not support assimetrical encryption, meaning keeping a private key, and giving a public key away to someone, allowing them to encrypt it with that key, and you decrypt it wiht your key, but there key can only encrypt, not decrypt, php doesn't support this, it only supports symmetrical, and 1 way encryption, I want 2 way symmetrical encryption, it works perfectly on the same page, what is keeping this from working in different pages.
  16. $select = "SELECT * FROM tablename"; $query = mysql_query($select); //2 functions mysql_num_rows and mysql_fetch_array $num_rows = mysql_num_rows($query); while ($rows = mysql_fetch_array($query)) { //format the data for viewing, with tables or lists or whatever. //for instance lists echo "<ul type=/"disc/">"; echo "<li>" . $rows['variable'] . "</li>"; echo "<li>" . $rows['variable2'] . "</li>"; echo "<li>" . $rows['variable3'] . "</li>"; echo "</ul>"; // this displays the data as a list, then if you wanted it as tables, something like this echo "<table>"; echo "<tr><td>" . $rows['variable'] . "</td></tr>"; echo "<tr><td>" . $rows['variable2'] . "</td></tr>"; echo "<tr><td>" . $rows['variable3'] . "</td></tr>"; echo "</table>"; } // I didn't have a lot of time so these are a little off, for example , it's going to create a new list for every row, then a new table for every row so instead if you use the list have the echo "<ul>"; or whatever before the while statement and the end tag after it, the same with table start and finish also while and foreach are roughly the same thing, after asking hundreds of developers none of them notice a difference so you can safely use either. As for updating, you can set up a straight update, where you have fields, and  they update the stuff automatically, without testing, or test for hte existence of first, then update if it doesn't exist. to update it's just the exact same query above just with alter or insert if you are just adding data, you could also use update, which is what I always use. $select = "UPDATE columnname FROM tablename WHERE whatever. You get the point as soon as that query hits mysql query it's run automatically so be carefuly if you do $select = "UPDATE mycolumn SET whatever it allows you to set it but as soon as you use mysql_query($select) then the data is updated.
  17. This is the thing, I am trying to get a heavy form of decryption, and no I doubt if any of you could decrypt this in a substantial amount of time, that's what mcrypt is for, it can be decrypted by a hacker, but there just not going to piss on it, and decrypt it without substantial effort, above and beyond what it would be worth.  I want the ability to encrypt and decrypt, I want to get these to work, because I have put this together off thousands of examples, and researched each algorithm to try and get the right one for what I am trying to do, I am trying to create a general encryption and decryption process, I use some "whitening" before encryption so even if it's decrypted, they have to sort through the whitening process before getting to the readable data, so there are 2 things for them to go through, I ahve an idea of building these, getting them to work then running them through functions for me to easily use.  later I want to try building encryption insdie of encryption, using 3-4 different algorithms, 1 at a time, and running the subsequent algorithm through the next, encrypting the encryption. And encrypting the encryption that is encrypting the data, I am wanting to create functions, where you can put in 1 key, and 1 string of information you want encrypted, then it creates a random seed number between 1 and 1000000 Then i am going to have the function run through a series of encryption process, full open module, encrypt, close module, then open another in the same function, and encrypt the data that was encrypted int he other functions with a different key, the funciton will have 4 variables 3 keys, 1 for each algoritm, and the data to insert into the first algorithm right now I have my eyes on these 4 algoritms to encrypt, then decrypt them the same way, decrypt the last one used, then the third, then second, t hen first to get the data, I might even run all through a base 64 incryption.  The idea is once I have the functions in place, when i encrypt the data, I will use it to encrypt anything even session id's When I run sessions I am going to pull the user's browser make, model, ip address, windows operating system, javascript enabled/disabled, and create a function to initialize all of that at the start of the session, and recheck all the properties for every page they visit, if one of them don't match up the session is killed.  The session dies after 1hour, the 4 algorithms I am wanting to run it through is MCRYPT_RIJNDAEL_256 MCRYPT_SAFER128 MCRYPT_TRIPLEDES MCRYPT_TWOFISH256 these are the ones as I am seeing being most popular, and most powerful What do you think, the only problem is, I can't get even the first to work, it encrypts it, but it doesn't decrypt it, I was just wondering if it had something to do with the way I am decrypting or if I forgot something.
  18. I retook apart, and rebuilt my decryption agani, but I still get wierd shit when I try to display my password again, once I master this setup, I am going to start playing with different algorithms, but something is keeping it from decrypting, any advice?
  19. Actually this would be fairly simple, on both pages start a session, then register all your session variables to whatever you wanted to record, remove the expiration, the max_life_time session time, remove it completey, if you can, I see people having permanent counters.  What I would do, is have sessions do it, ifn ot then just database it all and pull it from the database when you are ready, eitehr one will work.  Or you could create your own idea, like create a .txt file somewhere like log.txt, and have it write all that information to a file, and call the informationf rom the file when you need it, have it update it, whenever you need, and just write over the old data with autoincrementing calculations.
  20. Try This [code]function BOX_exists( $BOX_id ) {     $sql = "SELECT IDBOX FROM box ".           "WHERE IDBOX='".$BOX_id."';";     $this->query($sql);     return ($this->num_rows() == 1); } function insert_BOX( $BOX_id, $Description) {     if (BOX_exists( $BOX_id ))     {         $sql =  "INSERT INTO box (IDBOX, Description )".                 "VALUES ('$BOX_id', '$Description');";         $this->query( $sql );         return true;     }     else     {         return false;     } }[/code] That should make it stop doing that.
  21. or regular expressions, but I like c-type the most.
  22. Well what I did this time, was look for some troubleshooting, and change around my database table some, but it's still not decrypting, still searching, still playing with it, advice appreciated.
  23. Now I think it's just the encryption worked, but the encryption won't I will build something else to encrypt, and see if I can come up with a nother way to encrypt and decrypt.
×
×
  • 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.