Speedysnail6
Members-
Posts
25 -
Joined
-
Last visited
Speedysnail6's Achievements
Newbie (1/5)
0
Reputation
-
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?
-
Is it still safe if I dont use the $allowedExts in the if statement?
- 14 replies
-
- file upload
- php
-
(and 2 more)
Tagged with:
-
Ah... I se what you mean Ch0cu3r I had $allowedExts = array("gif", "jpeg", "jpg", "png"); but i forgot about css. Thanks
- 14 replies
-
- file upload
- php
-
(and 2 more)
Tagged with:
-
Thanks! I decided to use Psycho's code instead and it worked. Thanks so much though.
- 14 replies
-
- file upload
- php
-
(and 2 more)
Tagged with:
-
I'll try that.. Thanks
- 14 replies
-
- file upload
- php
-
(and 2 more)
Tagged with:
-
Should I use a different set of code? Because the code I used worked for everything I needed BUT css...
- 14 replies
-
- file upload
- php
-
(and 2 more)
Tagged with:
-
What other code do you need? I thought that that was all that was important
- 14 replies
-
- file upload
- php
-
(and 2 more)
Tagged with:
-
It works fine with images.
- 14 replies
-
- file upload
- php
-
(and 2 more)
Tagged with:
-
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
- 14 replies
-
- file upload
- php
-
(and 2 more)
Tagged with:
-
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?
- 14 replies
-
- file upload
- php
-
(and 2 more)
Tagged with:
-
Thanks!
-
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?
-
Decryption function doing something weird with encoding
Speedysnail6 replied to Speedysnail6's topic in PHP Coding Help
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); } -
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.