a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Hosting from $3.99 per month!

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions. dd

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

copy() question

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> copy() question
Page: [1]
 
Tailslide

 

Posts: 6368
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
copy() question - 11/12/2006 11:57:22   
Hi folks

I had a nice little script set up which took the contents of a chosen file (chosen via a form) and copied it into another file which was included in a site - so a client could swap the contents of a particular div around as they wished.

It all worked beautifully until now - I've used it on another site and I'm sure it was working, but it's not now and I'm not sure why. I think it might be the permissions set up incorrectly but I've been going round and round so much that I'm not sure what I'm doing!

Here's the form:

<form name="eventform" method="post" action="event.php"><div id="form">
					                                         
<fieldset>
<legend>Choose the Event</legend>
<input type="radio" id="event1" name="event" value="valentines.php"  /><label for="event1" class="check" >Valentines</label><br />
<input type="radio" id="event2" name="event" value="mothersday.php"/><label for="event2" class="check">Mothers' Day</label><br />
<input type="radio" id="event3" name="event" value="easter.php"  /><label for="event3" class="check" >Easter</label><br />
<input type="radio" id="event4" name="event" value="jewishnewyear.php"  /><label for="event4" class="check" >Jewish New Year</label><br />
<input type="radio" id="event5" name="event" value="christmas.php"  /><label for="event5" class="check" >Christmas</label><br />
</fieldset>
<br />			
 <input class="submit" type="submit" value="Submit this form"  />	 
</div>
</form>


And here's the contents of event.php

<?php
echo '<h2>Event Box Updated</h2><p><a href="index.html">Back to the Homepage</a></p>'; 
$file = $event;
$newfile = 'current.php';

if (!copy($file, $newfile)) {
   echo "failed to copy $file...\n";
}
?> 


current.php is blank. The php files making up the values of the form just contain normal HTML markup, nothing clever.

Can anyone see anything glaringly wrong? If not, what CHMODs would you have set for the various files?

Thanks!

_____________________________

Little Blue Plane Web Design | Land Rover project

:)
Page:   [1]
OutFront Discoveries

All Forums >> Web Development >> ASP and Database >> copy() question
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts