Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 21st, 2004, 07:42 AM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems with the editor example in ch 10

Hello !

Most of the scipts in the book works ok, but I can not get the editor.php script in ch 10 to work.

The editor menu comes up. Its possible to edit on the screen, but the save function does not work. The only thing that is happening is that the text fields are blanked out. No text are stored. There are no error messages.

I have checked the security and privat tabs on IE. They are on normal.

To be sure it has nothing to do with user rights on the server, I made chmod 777 on all files.

Server Fedora core 2, in my home.

I have some other PHP applications that uploads files to the web server. No problems with them.

I have checked the php.ini file. Cant see any problems.

Still the editor.php scripts in ch 10 is not able to store or upload any text to the web server.

Any ideas or suggestions ?

Best reg Arne.



Reply With Quote
  #2 (permalink)  
Old August 21st, 2004, 08:11 AM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Some more info .. here is the code of the editor html page. Anything wrong here, that will meen that she page content are not saved ?

<HTML>
<HEAD><TITLE>Welcome to Web Text Editor</TITLE></HEAD>
<BODY>
<CENTER><STRONG>Editing a new file</STRONG></CENTER>
<CENTER>
<FORM NAME="edit_form" METHOD="POST" action="">
<INPUT TYPE="HIDDEN" NAME="action" VALUE="save_file">
<INPUT TYPE="HIDDEN" NAME="dir" VALUE="/var/www/html/phptest/wrox/ch10/docs">
<TEXTAREA ROWS="25" NAME="filebody"
      COLS="80" WRAP="soft">
</TEXTAREA><BR>
Filename: <STRONG>/var/www/html/phptest/wrox/ch10/docs/</STRONG><INPUT TYPE="TEXT" NAME="filename" VALUE="new.txt"
                              SIZE="30">
<INPUT TYPE="SUBMIT" VALUE="Save" NAME="Submit">
</FORM>
</CENTER>

</BODY>
</HTML>
Reply With Quote
  #3 (permalink)  
Old August 21st, 2004, 08:20 AM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This line has an empty action field. Is this right ??

<FORM NAME="edit_form" METHOD="POST" action="">


Reply With Quote
  #4 (permalink)  
Old August 21st, 2004, 08:33 AM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

When trying to run it, the webeditor.php scripts also say: "You can't edit me".

From the script:

if($filename == basename($PHP_SELF)) error_message("You can't edit me!");

Some incorrect configuration ?

Reply With Quote
  #5 (permalink)  
Old August 21st, 2004, 02:24 PM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Problem solved via danish discussion group eksperten.dk

Problem apeared to be that the php.ini file of Fedora Core 2 has register_globals set to off. After changing this to on, the scripts vere working.

From the php.ini file:

; You should do your best to write your scripts so that they do not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
register_globals = On

Well .. the book is prited in year 2000 and 4 year is a boit of time.

http://www.eksperten.dk/spm/531574


Reply With Quote
Reply


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C# Ch 10 Page 362 surefire BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 5 February 25th, 2008 01:55 PM
Ch. 10 Directory listing superkooi BOOK: Beginning ASP 3.0 1 March 3rd, 2005 07:39 AM
Chapter 10 Editor Problems kellenjb BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 4 June 8th, 2004 08:16 PM
Chapter 10 editor.php Tachyon BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 2 March 17th, 2004 10:37 PM



All times are GMT -4. The time now is 07:26 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.