Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Wikitech

editpage error

 

 

Wikipedia wikitech RSS feed   Index | Next | Previous | View Threaded


qli at ica

Nov 9, 2009, 6:24 AM

Post #1 of 9 (1251 views)
Permalink
editpage error

hi,
I just added some code to the MonoBook.php.

function updateBox() {
?>
<div id="p-update" class="portlet">
<h5><label for="updateInput"><?php $this->msg('update') ?></label></h5>
<div id="updateBody" class="pBody">
<form action="..\includes\update\update.php" method="post"
id="updateform"><div>
<input type='submit' name="update" class="updatehButton"
id="updateButton" value="<?php $this->msg('dataupdate') ?>" />
</div></form>
</div>
</div>
<?php
}

This can add a button to the sidebar,but when i clicked the button,it can't
link to the update.php. It shows error instead"You can not access the
specified web page!".
update.php
just has the content of
<?php

echo "hello";

Why do these things happen? If I want to do the right thing that when I
click the button then there'll link to the page that has the same page
performance as wiki.

What should I do?

Hlep me !

Thanks a lot.

vanessa lee


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


roan.kattouw at gmail

Nov 9, 2009, 10:23 AM

Post #2 of 9 (1213 views)
Permalink
Re: editpage error [In reply to]

2009/11/9 李琴 <qli [at] ica>:
>   <form action="..\includes\update\update.php" method="post"
> id="updateform"><div>
* Replace the backslashes by forward slashes
* Verify that ../includes/update/update.php is the correct relative
path to update.php
* Verify that Apache isn't configured to deny access to the includes/ directory

Roan Kattouw (Catrope)

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Platonides at gmail

Nov 9, 2009, 3:10 PM

Post #3 of 9 (1202 views)
Permalink
Re: editpage error [In reply to]

Roan Kattouw wrote:
> 2009/11/9 李琴 <qli [at] ica>:
>> <form action="..\includes\update\update.php" method="post"
>> id="updateform"><div>
> * Replace the backslashes by forward slashes
> * Verify that ../includes/update/update.php is the correct relative
> path to update.php

Being for the sidebar, it won't be. The .. is very likely wrong (path is
relative to the entry point). And using tiny urls, it will break with
articles like [[Foo/bar]].
Use $wgScriptPath/includes/update/update.php Or better yet,
$wgScriptPath/extensions/update/update.php instead of touching includes
folder.


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


qli at ica

Nov 10, 2009, 4:38 AM

Post #4 of 9 (1193 views)
Permalink
Re: editpage error [In reply to]

If I verify the "..\includes\update\update.php" to
"$wgScriptPath/extensions/update/update.php"
and move update file to extensions.The address bar will show that
http://localhost/mediawiki/index.php/$wgScriptPath/extensions/update/update.php

I don't think this is right.

-----Original Message-----
From: Platonides <Platonides [at] gmail>
To: wikitech-l [at] lists
Date: Tue, 10 Nov 2009 00:10:07 +0100
Subject: Re: [Wikitech-l] editpage error


Roan Kattouw wrote:
> 2009/11/9 李琴 <qli [at] ica>:
>> <form action="..\includes\update\update.php" method="post"
>> id="updateform"><div>
> * Replace the backslashes by forward slashes
> * Verify that ../includes/update/update.php is the correct relative
> path to update.php

Being for the sidebar, it won't be. The .. is very likely wrong (path is
relative to the entry point). And using tiny urls, it will break with
articles like [[Foo/bar]].
Use $wgScriptPath/includes/update/update.php Or better yet,
$wgScriptPath/extensions/update/update.php instead of touching includes
folder.


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


qli at ica

Nov 10, 2009, 4:57 AM

Post #5 of 9 (1190 views)
Permalink
Re: editpage error [In reply to]

Do windows xp not using a backslash ?Apahe's conf is right.



-----Original Message-----
From: Roan Kattouw <roan.kattouw [at] gmail>
To: Wikimedia developers <wikitech-l [at] lists>
Date: Mon, 9 Nov 2009 19:23:21 +0100
Subject: Re: [Wikitech-l] editpage error


2009/11/9 李琴 <qli [at] ica>:
> <form action="..\includes\update\update.php" method="post"
> id="updateform"><div>
* Replace the backslashes by forward slashes
* Verify that ../includes/update/update.php is the correct relative
path to update.php
* Verify that Apache isn't configured to deny access to the includes/
directory

Roan Kattouw (Catrope)

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Simetrical+wikilist at gmail

Nov 10, 2009, 7:54 AM

Post #6 of 9 (1188 views)
Permalink
Re: editpage error [In reply to]

On Tue, Nov 10, 2009 at 7:57 AM, 李琴 <qli [at] ica> wrote:
> Do windows xp not using a backslash ?Apahe's conf is right.

I don't get the context here, but do not use backslashes in paths.
All remotely recent versions of Windows (certainly Windows XP) will
accept a forward slash in path names as equivalent to a backslash. On
the other hand, backslashes not only don't work on Unix-likes, they
also require escaping in string literals for Windows.

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


questpc at rambler

Nov 10, 2009, 11:07 AM

Post #7 of 9 (1195 views)
Permalink
Re: editpage error [In reply to]

* Aryeh Gregor <Simetrical+wikilist [at] gmail> [Tue, 10 Nov 2009
10:54:38 -0500]:
> On Tue, Nov 10, 2009 at 7:57 AM, 李琴 <qli [at] ica> wrote:
> > Do windows xp not using a backslash ?Apahe's conf is right.
>
> I don't get the context here, but do not use backslashes in paths.
> All remotely recent versions of Windows (certainly Windows XP) will
> accept a forward slash in path names as equivalent to a backslash. On
> the other hand, backslashes not only don't work on Unix-likes, they
> also require escaping in string literals for Windows.
>
Backslashes are twice bad, because sometimes larger pathes are produced
by concatenation of shorted "subpathes", and when one shorter subpath
uses slashes and another one backslashes, the concatenated path is
invalid even in Windows. For example, some MediaWiki extension failed in
Windows because it used slashes and dirname() or getcwd() returned
backslashes.
That's why my extension uses:
str_replace( "\\", "/", dirname(__FILE__) )
Dmitriy

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


gmane at kennel17

Nov 10, 2009, 2:24 PM

Post #8 of 9 (1193 views)
Permalink
Re: editpage error [In reply to]

"Dmitriy Sintsov" <questpc [at] rambler> wrote in message
news:1113144093.1257880032.161549468.45290 [at] mcgi27
> Backslashes are twice bad, because sometimes larger pathes are produced
> by concatenation of shorted "subpathes", and when one shorter subpath
> uses slashes and another one backslashes, the concatenated path is
> invalid even in Windows. For example, some MediaWiki extension failed in
> Windows because it used slashes and dirname() or getcwd() returned
> backslashes.
> That's why my extension uses:
> str_replace( "\\", "/", dirname(__FILE__) )
> Dmitriy

That's not my experience. I have been using PHP for quite some time on both
Linux and Windows, and will often use something like

include(dirname(__FILE__) . "/../foo.php");

The path on a Windows box may therefore end up as something like:

C:\some path\to\script/../foo.php

but this mixture of path separators has always worked fine for me, and
others[1]. (Mixing separators won't work on *nix boxes of course, but
that's not a problem in this case as dirname() returns paths in the local
format). The trick is to always use forward slashes, and it should work
fine on all systems, even if it displays a bit funny in some situations.

The point about having to double-escape is true though.

- Mark Clements (HappyDog)

[1] http://us2.php.net/manual/en/ref.filesystem.php#73954



_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Platonides at gmail

Nov 10, 2009, 3:27 PM

Post #9 of 9 (1192 views)
Permalink
Re: editpage error [In reply to]

李琴 wrote:
> If I verify the "..\includes\update\update.php" to
> "$wgScriptPath/extensions/update/update.php"
> and move update file to extensions.The address bar will show that
> http://localhost/mediawiki/index.php/$wgScriptPath/extensions/update/update.php
>
> I don't think this is right.

You're outside the PHP section, so $wgScriptPath isn't being replaced.

You would do something like:
<form action="<?php echo "$wgScriptPath/extensions/update/update.php";
?>" method="post" id="updateform">

and move update.php to a folder called update on extension folder.


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Wikipedia wikitech RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.