Lost Password?


Go Back   CodeCall Programming Forum > Web Development Forum > PHP Forum

PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old 07-24-2007, 05:29 PM
FlyByWire128 FlyByWire128 is offline
Newbie
 
Join Date: Feb 2007
Age: 21
Posts: 16
Rep Power: 7
FlyByWire128 is on a distinguished road
Default

The output to that was:

Fatal error: Can't use function return value in write context in E:\users\orchestra\Rehearsals\testPHP.php on line 27
PHP Fatal error: Can't use function return value in write context in E:\users\orchestra\Rehearsals\testPHP.php on line 27

If I take out the last 3 lines of code, I get:

E:\users\orchestra\Rehearsals\tuesdayR.txt
The file is readable...
The file is writable...
File exists...

Last edited by FlyByWire128; 07-24-2007 at 05:31 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 07-24-2007, 07:14 PM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,433
Last Blog:
Google Web Toolkit
Rep Power: 20
John has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond repute
Send a message via AIM to John Send a message via MSN to John
Default

How about this?

PHP Code:
$filename "tuesdayR.txt";
$filename realpath($filename);
$content "Yo sup!\n";

    if (!
$handle fopen($filename'w')) {
         echo 
"Cannot open file ($filename)";
         exit;
    }

    if (
fwrite($handle$content) === FALSE) {
        echo 
"Cannot write to file ($filename)";
        exit;
    }

    echo 
"Success, wrote ($content) to file ($filename)";

    
fclose($handle); 
One of my favorite things to do when I have a problem I cant solve is to use "debug statements" to find precisely where the the problem is.

Edit:
Also please post these:

PHP Version
Web server software [apache or IIS] and version
Operating System
Safemode enabled/disabled

Last edited by John; 07-24-2007 at 08:18 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP 4 end of life announcement Jordan Programming News 4 08-30-2007 10:55 AM
PHP Introduction clookid PHP Tutorials 10 01-16-2007 08:17 AM


All times are GMT -5. The time now is 04:46 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 98%

Ads