Jump to content

Speedysnail6

Members
  • Posts

    25
  • Joined

  • Last visited

Speedysnail6's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This is my php code if(mysqli_query($con,"INSERT INTO transactions (ID, Amount, To, From, Description, Type) VALUES ('23', '46', 'hello', 'hello', 'hell1', 'asddsa')")) { return "success"; } echo mysqli_error($con); I get this error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'To, From, Description, Type) VALUES ('23', '46', 'hello', 'hello', 'hell1', 'asd' at line 1 What am i doing wrong?
  2. Is it still safe if I dont use the $allowedExts in the if statement?
  3. Ah... I se what you mean Ch0cu3r I had $allowedExts = array("gif", "jpeg", "jpg", "png"); but i forgot about css. Thanks
  4. Thanks! I decided to use Psycho's code instead and it worked. Thanks so much though.
  5. Should I use a different set of code? Because the code I used worked for everything I needed BUT css...
  6. What other code do you need? I thought that that was all that was important
  7. That's strange. It says Invalid file Array ( [file] => Array ( [name] => bootstrap-theme.css [type] => text/css [tmp_name] => /tmp/php9QKeIm [error] => 0 [size] => 17202 ) ) but my code is || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/jpg") || ($_FILES["file"]["type"] == "image/pjpeg") || ($_FILES["file"]["type"] == "image/x-png") || ($_FILES["file"]["type"] == "text/css") || ($_FILES["file"]["type"] == "image/png")) I don't see what's going wrong
  8. Hi. I have a file upload script and I want to allow css files to be uploaded as well. Here is my code allowing the certain filetipes allowed to be uploaded. || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/jpg") || ($_FILES["file"]["type"] == "image/pjpeg") || ($_FILES["file"]["type"] == "image/x-png") || ($_FILES["file"]["type"] == "image/png")) When I tried doing this code to allow css files through || ($_FILES["file"]["type"] == "text/css")) it didn't work. Should it? If not, what did I do wrong?
  9. There are many ways to make a registration script in PHP. Does your site have a mysql database. I suggest if you're new, to install a premade script.
  10. Hi. I don't know how to have the code </textarea> INSIDE of a textarea using PHP. $edit_content_de = "<textarea>Text</textarea>asd"; <p><?php echo '<textarea name="content" id="codeTextarea" style="width:90%; height:500px;">'. $edit_content_de; .'</textarea>'; ?></p> But obviously what happens is the textarea ends and BELOW the textarea it says "asd". How do I stop this and have it say </textarea> INSIDE textarea instead of closing it?
  11. Thanks! I used trim() and it worked. New code is... //Decryption Function function decrypt($mprhase) { global $encryptionkey; $MASTERKEY = $encryptionkey; $td = mcrypt_module_open('tripledes', '', 'ecb', ''); $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init($td, $MASTERKEY, $iv); $decrypted_value = mdecrypt_generic($td, base64_decode($mprhase)); mcrypt_generic_deinit($td); mcrypt_module_close($td); return trim($decrypted_value); }
  12. Hi. This is a function to decrypt text. Please do not worry about the masterkey, that is called upon from outside. //Decryption Function function decrypt($mprhase) { global $encryptionkey; $MASTERKEY = $encryptionkey; $td = mcrypt_module_open('tripledes', '', 'ecb', ''); $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init($td, $MASTERKEY, $iv); $decrypted_value = mdecrypt_generic($td, base64_decode($mprhase)); mcrypt_generic_deinit($td); mcrypt_module_close($td); return $decrypted_value; } Although this works normally, it does decrypt text with some weird encoding or something. I've tried decrypt() multiple times in an IF statement and was very confused why it does not work. It seems to look alike in code and in words when I echo it directly on a page, but when I tried putting the decrypt content in a textarea, and I get Decrypted Text��� in the textarea. What is my decription function doing with the encoding or whatever, and please tell me how to correct it. Thanks in advance and please tell me if I am not being clear enough.
×
×
  • 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.