i have this code in a page called process.php to create a page dynamically.

$_SESSION['z']=$post;
$string = '<?php
$p='.$_SESSION['z'].'; 
  ?> ';   
$fp = fopen("$post.php", "w");
fwrite($fp, $string);
fclose($fp);

if $post=big
then it creates a page big.php with this code

<?php
$p=big; 
  ?>

but i want to write $p='big' instead of $p=big on the big.php page ..so how can i do it ??

Did you try this:

$string = '<?php
$p="'.$_SESSION['z'].'"; 
  ?> ';

-Agarsia

thanx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.