Jump to content

Adding php to a file, using another php file.


Short-URL

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.