Azzyh Posted November 22, 2009 Share Posted November 22, 2009 Hello. I have made this script: <? $msg = $_GET['testc']; if($_GET["testc"]) { if(mkdir(strtolower($msg), 0775)) { if(fwrite(fopen(strtolower($msg)."/index.php", "w+"), "CONTENT FOR THE INDEX FILE")) { print "Done: <a href='http://azzyh.dk/$msg'>$msg.azzyh.dk</a>"; }else{ print "Error #8 contact admin, and report please."; } }else{ print "Error #9 contact admin, and report please."; } } ?> But i want to have a PHP script in the index.php file that the script above ^ is writing. How should i do that ? Here's the script i want in: <? $msg = $_GET['test']; $logfile= 'log.html'; $fp = fopen($logfile, "a"); fwrite($fp, $msg); fclose($fp); ?> Should i go like this: <? $msg = $_GET['testc']; if($_GET["testc"]) { if(mkdir(strtolower($msg), 0775)) { if(fwrite(fopen(strtolower($msg)."/index.php", "w+"), ?> <? $msg = $_GET['test']; $logfile= 'log.html'; $fp = fopen($logfile, "a"); fwrite($fp, $msg); fclose($fp); ?> <? )) { print "Done: <a href='http://azzyh.dk/$msg'>$msg.azzyh.dk</a>"; }else{ print "Error #8 contact admin, and report please."; } }else{ print "Error #9 contact admin, and report please."; } } ?> That wouldn't work i believe!? unexpected syntax. Thanks in forward! Link to comment https://forums.phpfreaks.com/topic/182465-solved-php-code-in-a-php-code/ Share on other sites More sharing options...
Azzyh Posted November 22, 2009 Author Share Posted November 22, 2009 I've solved it myself by including a file with the codes in. Link to comment https://forums.phpfreaks.com/topic/182465-solved-php-code-in-a-php-code/#findComment-962950 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.