Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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.



  #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>
  #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="">


  #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 ?

  #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




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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.