Short-URL Posted August 27, 2006 Share Posted August 27, 2006 Hello,I am trying to create a php file, and add some php coding to that file, using another php file. Heres the code that I am using:[code]$add = "<?php $handle3 = fopen(\"$short/status.php\", \"w\"); fputs($handle3, \"Ip Adress here\"); fclose($handle3); header(\"Location: http://$long\"); ?>";mkdir("/home/smallurl/public_html/$short", 0777);$handle = fopen("$short/index.php", "w");fputs($handle, "$add"); fclose($handle); $handle2 = fopen("$short/status.php", "w");fputs($handle2, ""); fclose($handle2); [/code]The code that is in the var $add, is the bit added to the file. But when added to the file it comes out as this:[code]<?php = fopen("plugworld/status.php", "w"); fputs(, "Ip Adress here"); fclose(); header("Location: http://www.plug-world.net"); ?>[/code]The Vars are no longer there.Can anyone help?Cheers. Link to comment https://forums.phpfreaks.com/topic/18795-adding-php-to-a-file-using-another-php-file/ Share on other sites More sharing options...
Orio Posted August 27, 2006 Share Posted August 27, 2006 Try escaping the dollar sign on every var:$handle3 becomes \$handle3Orio. Link to comment https://forums.phpfreaks.com/topic/18795-adding-php-to-a-file-using-another-php-file/#findComment-81071 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.