How can I display the selected value of the option using PHP?
For example I have this code:
<script language=javascript>
function sevent()
{
var xx = document.xx.sbox;
if(document.xx.sbox.selectedIndex != 0)
alert("selected is "+xx.selectedIndex);
else alert("None is selected");
}
</script>
<form name=xx>
<select name=sbox onChange="sevent()">
<option value="default">Select Option</option>
<option value="option 1">option 1</option>
<option value="option 2">option 2</option>
</select>
</form>
Here, it prompts whatever option you select. What I wanted to do is to display
the value of the selected option using PHP. How can do it?
Thanks. ^_^
Mucking around with the format parameter on a siteinfo call I got this
with "action=query&meta=siteinfo&format=wddx"
This was just now, around 0220 GMT, September 29, and the site is
English Wikipedia.
<?xml version=\"1.0\"?>
<wddxPacket version=\"1.0\">
<header/>
<data>
<struct>
<var name=\"error\">
<struct>
<var name=\"code\">
<string>internal_api_error_MWException</string>
</var>
<var name=\"info\">
<string>Exception Caught: Internal error in
ApiFormatWddx::slowWddxPrinter: Unknown type boolean</string>
</var>
<var name=\"*\">
<string>#0
/usr/local/apache/common-local/wmf-deployment/includes/api/ApiBase.php(913):
wfDebugDieBacktrace('Internal error ...')#1
/usr/local/apache/common-local/wmf-deployment/includes/api/ApiFormatWddx.php(109):
ApiBase::dieDebug('ApiFormatWddx::...', 'Unknown type bo...')#2
/usr/local/apache/common-local/wmf-deployment/includes/api/ApiFormatWddx.php(95):
ApiFormatWddx->slowWddxPrinter(false, 16)#3
/usr/local/apache/common-local/wmf-deployment/includes/api/ApiFormatWddx.php(95):
ApiFormatWddx->slowWddxPrinter(Array, 12)#4
/usr/local/apache/common-local/wmf-deployment/includes/api/ApiFormatWddx.php(95):
ApiFormatWddx->slowWddxPrinter(Array, 8)#5
/usr/local/apache/common-local/wmf-deployment/includes/api/ApiFormatWddx.php(62):
ApiFormatWddx->slowWddxPrinter(Array, 4)#6
/usr/local/apache/common-local/wmf-deployment/includes/api/ApiMain.php(454):
ApiFormatWddx->execute()#7
/usr/local/apache/common-local/wmf-deployment/includes/api/ApiMain.php(434):
ApiMain->printResult(false)#8
/usr/local/apache/common-local/wmf-deployment/includes/api/ApiMain.php(248):
ApiMain->executeAction()#9
/usr/local/apache/common-local/wmf-deployment/includes/api/ApiMain.php(232):
ApiMain->executeActionWithErrorHandling()#10
/usr/local/apache/common-local/wmf-deployment/api.php(116):
ApiMain->execute()#11
/usr/local/apache/common-local/live-1.5/api.php(3):
require('/usr/local/apac...')#12 {main}</string>
</var>
</struct>
</var>
</struct>
</data>
</wddxPacket>
I set the following variables in LocalSettings.php file. The 'ccs.adnu.edu.ph'
is an intranet. It's our school's server so I can just access it within the
school. $wgServerName = 'ccs.adnu.edu.ph';$wgServer = 'http://ccs.adnu.edu.ph';
Say if i am accessing my page outside the school, having the address of my main
page http://ccs.adnu.edu.ph/wikibits/index.php/Main_Page, it can be viewed and
is still accessible. But when I tried logging in, i am redirected to this
address http://ccs/wikibits/index.php/Main_Page which is an invalid page. So, in
this case, the $wgServer has the value of 'http://ccs'.How can
i fix this properly?
Thanks, guys. ^_^
>On Sat, Jul 18, 2009 at 08:49:48AM +1200, Jim Tittsler wrote:
> > On 17/07/09 16:18, Dan Collins wrote:
> > > On Thu, Jul 16, 2009 at 11:20 PM, Jim Tittsler<j...(a)onnz.net>:
> > > > I have a bot (using mwclient 0.6.2) that nightly updates some
> > > > status pages on WikiEducator.org. It has suddenly started
> > > > failing with an 'Edit conflict' but I can edit the page by
> > > > hand and the script continues to write to another page. Are
> > > > there things that would prohibit the API from writing to a
> > > > page but still allow editing through the wiki?
> > > Yes. Specifically, an edit conflict will cause one attempt to
> > > fail and the next to succeed with no problem. For details see
> > > http://en.wikipedia.org/wiki/Help:Edit_conflict but essentially
> > > someone else changed the page while you were editing it and the
> > > wiki wants you to make sure you don't accidentally overwrite
> > > their changes.
> > I think there is something else going on. Writing to this
> > particular page now *always* fails through the API. It always
> > succeeds when I edit through the web. The history of the page
> > says only the bot and my test edits have been performed on the
> > page. The bot continues to write to other pages. Are there other
> > conditions that get reported as edit conflicts?
> Are you correctly supplying both the basetimestamp and
> starttimestamp parameters to the action=edit call?
I found this through:
http://www.mail-archive.com/mediawiki-api@lists.wikimedia.org/msg01220.html
I maintain cl-mediawiki (a common lisp pass through to the MediaWiki
api) and had this exact problem. The solution for me was to request
the revision timestamp rather than relying on the touched value
returned from asking for the action tokens.
Using the following query I get the correct timestamp (as well as the
touched which is incorrect):
action=query&prop=info|revisions&intoken=edit&titles=MyPage&rvprop=timestamp
My question is: What would cause the touched date to be different
from the last revision timestamp?
HTH and Thanks for the info,
Russ
Hello API wizards,
I'd like to generate article titles matching some generator criteria (e.g.
generator=embeddedin&geititle=Template:US state) and the first few
characters of the article title (e.g. "Al" to match Alaska or Alabama).
I have looked at the "list=search" function or using the "prefix" attribute
available on some queries (e.g. allpages), but it seems that these are only
useful in generating the initial title set, not for operating on titles
produced by a different generator.
Alternatively, maybe the "search" or "allpages" query could be used as the
generator, but then I'm not sure how to filter those results based on
whether they have an "embeddedin" template. Any ideas?
Thanks,
Karl
Why is it that there's a conflict on submit buttons between the page of
creating/ editing articles and to the special page that i've created. What i
mean is that after clicking the 'Save Page' button on the creating/editing page,
i am redirected to a blank page. But when I reload that blank page, i can now
view the page i just created/edited.
Is there something that I have to add to my special page to avoid this one? The
special pages that i've created are working. It's just strange seeing the blank
page because a user is supposed to be redirected properly to the page that they
just created/edited.
Hi there,
I am using DumpHTML to export my entire MediaWiki contents to a static dump.
However, the static pages are not searchable even though there are the "Go"
and the "Search" buttons.
If it's impossible to get the Search function with DumpHTML, what else tools
I can use to dump my MediaWiki site?
Any idea would be greatly appreciated,
Ross