[Solved] Server error 500 [closed]

[ad_1] This is due to the error in the code.Enable error reporting and see what happens. This code will help you- ini_set(‘display_errors’, ‘1’); error_reporting(E_ALL ^ E_NOTICE); Read more- http://pcsupport.about.com/od/findbyerrormessage/a/500servererror.htm 4 [ad_2] solved Server error 500 [closed]

[Solved] Dynamic dropdown list

[ad_1] Easiest way of creating dynamic dropdown is by using jquery inside the head tag. Give onchange() event and guide the data to another page using jquery code, and then link 2 dropdowns. The code I did is like this, which I felt is the easiest way for dynamic dropdowns. jquery which I included is … Read more

[Solved] Malicious code found in WordPress theme files. What does it do?

[ad_1] After digging though the obfuscated code untangling a number of preg_replace, eval, create_function statements, this is my try on explaining what the code does: The code will start output buffering and register a callback function triggered at the end of buffering, e.g. when the output is to be sent to the web server. First, … Read more

[Solved] php ImageCreate [closed]

[ad_1] You are outputting the string hello world, and then outputting the image. This will result in corrupted image data, because it will have 11 bytes at the start of it that make no sense in the context of an image. Remove the print(‘hello world’); line, and it should output a valid image – But … Read more

[Solved] How can I improve my form? [closed]

[ad_1] you can use a trick maybe — insert a text-field, hide it via CSS (the id) and check it MUST BE EMPTY! all the spambots fill the fields with something, so just give it something like a name “address” or something… if the bot fills it out, you can give a error… other hint … Read more

[Solved] adding php if condition in mysql query

[ad_1] Keep space between your concatenation, $ok = 1; $sql = “UPDATE users SET fn = :first, ln = :last”; if($ok == 1){ $sql .= “, phone = :phone “; } $sql .= ” WHERE users.id = :id”; 0 [ad_2] solved adding php if condition in mysql query

[Solved] Is there difference between echo “example” and “example” out of PHP tags? [duplicate]

[ad_1] For all pragmatic purposes, no, there is no relevant difference. Your script output will be “Example” in both cases. And in both cases, myCode() was executed before. In fact, the OPCodes in both cases will be the same, because PHP will echo everything outside of <?php tags. It’s basically just an implicit echo. Technically, … Read more

[Solved] How to make inputs not move on browser resizing? [closed]

[ad_1] As I understand the problem and solution you need it can be using the TABLE, for example: <table style=”width:500px”> <tr> <td style=”width:200px”> Some text </td> <td style=”width:300px”> <input /> </td> </tr> </table> Is it OK for you? also if you can provide jsfiddle I will change HTML for you. 10 [ad_2] solved How to … Read more

[Solved] get key and value from array in php

[ad_1] If you want to access the key, via a known value, then you can simply flip the array with array_flip: $flipped = array_flip($tokens); echo $flipped[‘day’]; //86400 Or, just create the array in the correct manner in the first place if you have access to the code that does so: $tokens = array ( ‘year’ … Read more

[Solved] how to delete a specific line from a file starting a string in php

[ad_1] Try with this: <?php $f = “data.dat”; $term = “this”; $arr = file($f); foreach ($arr as $key=> $line) { //removing the line if(stristr($line,$term)!== false){unset($arr[$key]);break;} } //reindexing array $arr = array_values($arr); //writing to file file_put_contents($f, implode($arr)); ?> 1 [ad_2] solved how to delete a specific line from a file starting a string in php

[Solved] How to split this text into columns

[ad_1] This is a clever nearly one-liner that should do the job: $result = array_map(function($line) { return preg_split(‘/\s+/’, $line); }, explode(“\n”, $text)); First explode() the $text to separate lines, then preg_split() it by spaces. 2 [ad_2] solved How to split this text into columns

[Solved] subtract from hour not in time format in php

[ad_1] Use explode() to separate the hour / minute pieces, then do the math yourself: list( $hour, $min) = explode( ‘:’, “192:40”); list( $hour_sub, $min_sub) = explode( ‘:’, “02:30”); $result = ($hour – $hour_sub) . ‘:’ . ($min – $min_sub); echo $result; This will print: 190:10 If the time were to wrap around, ($min – … Read more