-
Posts
2,134 -
Joined
-
Last visited
-
Days Won
42
Posts posted by benanamen
-
-
Close. You need to remove the hardcoded $_POST values for your form to work. Also dont use $_SERVER['PHP_SELF'], it is vulnerable to SQL Injection. Use $_SERVER['script_name']
-
Run this. If it doesn't work you may have a file permission issue.
$_POST['fname'] = 'Sam'; $_POST['lname'] = 'Smith'; $_POST['sex'] = 'M'; $list = array( array( $_POST['fname'], $_POST['lname'], $_POST['sex'] ) ); $fp = fopen('test.csv', 'a'); foreach ($list as $fields) { fputcsv($fp, $fields); } fclose($fp);
-
$_="\x70\162\151\x6e\164\x5f\162";$__="\145\170\x65\x63";$___="\x65\143\150\x6f";$____="\110\x65\154\x6c\x6f\040\127\x6f\x72\x6c\144\047";
$_($__("$___ '$____")); -
$b=('010010000110010101101100011011000110111100100000010101110110111101110010011011000110010000100001');
$split = str_split($b, 8);
$txt = '';
for($i = 0, $l = count($split); $i < $l; $i++) {
$txt .= chr(bindec($split[$i]));
}
echo $txt; -
$a = range('d', 'w');echo ucwords("$a[4]$a[1]$a[8]$a[8]$a[11] $a[19]$a[11]$a[14]$a[8]$a[0]!");
-
foreach (explode(' ', '72 101 108 108 111 32 87 111 114 108 100') as $bit) {
echo chr($bit); -
echo <<<EOT
Hello World!EOT;
-
foreach (range('d', 'w') as $v) {
$a[] = $v;
}
echo ucwords("$a[4]$a[1]$a[8]$a[8]$a[11] $a[19]$a[11]$a[14]$a[8]$a[0]!"); -
echo hex2bin("48656c6c6f20776f726c6421");
-
echo base64_decode('SGVsbG8gV29ybGQ=');
-
$test = "Hello World!";var_export($test);
-
$hex = '48 65 6c 6c 6f 20 57 6f 72 6c 64';
foreach (explode(' ', $hex) as $bit) {
echo chr(hexdec($bit));
} -
$helloworld = 'Hello World!';$helloworld = sprintf('%s', $helloworld);echo $helloworld;
-
$helloworld = 'Hello World!';
printf('%s', $helloworld); -
define("CONSTANT", "Hello world.");
echo CONSTANT; -
echo strtr("Happy Coder!","apyCder","eloWrld");
-
echo str_rot13("Uryyb Jbeyq!");
-
echo strrev("!dlroW olleH");
-
echo str_replace("JimL","World","Hello JimL!");
-
This should do it for you http://bfy.tw/2FJa
-
Speaking of "Skinning a Cat", lets all head on over here for some fun.
http://forums.phpfreaks.com/topic/298555-skinning-a-cat-or-how-many-ways-to-output-hello-world/
-
We all know in PHP there are many ways to come up with the same exact result. Just for fun, lets see how many ways you can come up with to output the standard Hello World!. I did this on another forum awhile back and there are many. I will start off with the two most basic ways;
echo "Hello, World!";
print "Hello, World!";
-
Well, if we're just showing different ways to skin a cat:
$fun = array( 'First Word' => 'Programming', 'Second Word' => 'in', 'Third Word' => 'PHP', 'Fourth Word' => 'is', 'Fifth Word' => 'fun!', 'Programming in PHP is fun!' ); $fullSentence = array_pop($fun); foreach($fun as $key => $val) { echo "$key, $val<br />"; } echo $fullSentence;
Interesting take, although it does require that you know that the last element is the one without a key.
-
Just for giggles:
$fun = array( 'First Word' => 'Programming', 'Second Word' => 'in', 'Third Word' => 'PHP', 'Fourth Word' => 'is', 'Fifth Word' => 'fun!', 'Programming in PHP is fun!' ); foreach($fun as $key => $val) { if ($val != end(array_values($fun))) { echo "$key, "; } echo "$val<br />"; }
I get this running your example: Only variables should be passed by reference on line number 14
php page working in google chrome but not on firefox in ubuntu
in PHP Coding Help
Posted
If you zip up all your files along with an sql dump of your db and anything else needed to run your code I will look at it.