tarun
-
Posts
321 -
Joined
-
Last visited
Never
Posts posted by tarun
-
-
Yes I Did The Problem Is That The Script Is Not Actually Parsing The XML File
I Just Ouptuts Nothing
-
Page 1
<SCRIPT LANGUAGE="JavaScript"> <!-- function openChild(file,window) { childWindow=open(file,window,'resizable=no,width=200,height=400'); if (childWindow.opener == null) childWindow.opener = self; } //--> </SCRIPT> <FORM NAME="parentForm"> <INPUT TYPE="button" VALUE="Open child" onClick="openChild ('page2.html','win2')"> <BR><INPUT NAME="pf1" TYPE="TEXT" VALUE=""> <BR><INPUT NAME="pf2" TYPE="TEXT" VALUE=""> </FORM>
Page 2
<SCRIPT LANGUAGE="JavaScript"> <!-- function updateParent() { opener.document.parentForm.pf1.value = opener.document.parentForm.pf1.value + document.childForm.cf1.value; opener.document.parentForm.pf2.value = opener.document.parentForm.pf2.value + document.childForm.cf2.value; self.close(); return false; } //--> </SCRIPT> <FORM NAME="childForm" onSubmit="return updateParent();"> <BR><INPUT NAME="cf1" TYPE="TEXT" VALUE=""> <BR><INPUT NAME="cf2" TYPE="TEXT" VALUE=""> <BR><INPUT TYPE="SUBMIT" VALUE="Update parent"> </FORM>
That Should Do It Just Test It And Play Around With It
Thnx,
Tarun
-
BuuMMpp
-
Simple Rollover
<img src="img.gif" onmouseover="javascript:this.src='imgover.gif';" onmousedown="javascript:this.src='imgdown.gif';" onmouseout="javascript:this.src='img.gif';">
-
Try This:
<script> function printpreview() { var OLECMDID = 7; /* OLECMDID values: * 6 - print * 7 - print preview * 1 - open window * 4 - Save As */ var mydoc = document.getElementById('popup_schedule').innerHTML; var PROMPT = 1; // 2 DONTPROMPTUSER var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" ></OBJECT>'; document.getElementById('schedule').style.display='none'; document.getElementById('popup_schedule').style.display=''; document.body.insertAdjacentHTML('beforeEnd',WebBrowser); WebBrowser1.ExecWB(OLECMDID, PROMPT); WebBrowser1.outerHTML = ""; document.getElementById('schedule').style.display=''; document.getElementById('popup_schedule').style.display='none'; } </script> <a href="javascript:printpreview()">Print Preview</a> <div id="schedule"></div> <br> <div id="popup_schedule"></div> <br> <div id="beforeEnd"></div>
-
page1.html
<SCRIPT LANGUAGE="JavaScript"> <!-- function openChild(file,window) { childWindow=open(file,window,'resizable=no,width=200,height=400'); if (childWindow.opener == null) childWindow.opener = self; } //--> </SCRIPT> <FORM NAME="parentForm"> <INPUT TYPE="button" VALUE="Open child" onClick="openChild ('page2.html','win2')"> <BR><INPUT NAME="pf1" TYPE="TEXT" VALUE=""> <BR><INPUT NAME="pf2" TYPE="TEXT" VALUE=""> </FORM>
page2.html
<SCRIPT LANGUAGE="JavaScript"> <!-- function updateParent() { opener.document.parentForm.pf1.value = document.childForm.cf1.value; opener.document.parentForm.pf2.value = document.childForm.cf2.value; self.close(); return false; } //--> </SCRIPT> <FORM NAME="childForm" onSubmit="return updateParent();"> <BR><INPUT NAME="cf1" TYPE="TEXT" VALUE=""> <BR><INPUT NAME="cf2" TYPE="TEXT" VALUE=""> <BR><INPUT TYPE="SUBMIT" VALUE="Update parent"> </FORM>
Works Like A Charm Just Try It Out
An Example Is Also Available: Here
-
The Answer Is You Can't
Theres One Method...
<SCRIPT LANGUAGE="JavaScript"> function goNewWin() { //***Get what is below onto one line*** window.open("non59EC.htm",'TheNewpop','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1'); //***Get what is above onto one line*** self.close() } </SCRIPT> <A HREF="javascript:goNewWin()">Click to go to a new page</A>
It Opens A New Window And Then Close The Old One...Simple
There Are Plenty More Though... - Just Search Google
-
You Could Use CSS Position:Absolute;
More Info Available AtW3Schools
There Are Also Some Try-It-Yourself Demos
-
There Is No Error Appearing
I Meant As In There Is Nothing Coming Up
Despite The XML File Having The Right Data In It
Hmmm.... Any Help
-
<?php if (!($fp=@fopen("topics.xml", "r"))) { echo ("Forum Could Failed To Load"); return; } $usercount1=0; $usercount2=0; $usercount3=0; $userdata=array(); $state=''; function startElementHandler ($parser,$name,$attrib){ global $usercount; global $userdata; global $state; switch ($name) { case $name=="IMPORTANT" : { $userdata[$usercount]["type_i"] = $attrib["TYPE"]; $userdata[$usercount]["who_i"] = $attrib["WHO"]; $userdata[$usercount]["id_i"] = $attrib["ID"]; $userdata[$usercount]["date_i"] = $attrib["DATE"]; $userdata[$usercount]["time_i"] = $attrib["TIME"]; $userdata[$usercount]["title_i"] = $attrib["TITLE"]; $userdata[$usercount]["posts_i"] = $attrib["POSTS"]; break; } case $name=="STICKY" : { $userdata[$usercount]["type_s"] = $attrib["TYPE"]; $userdata[$usercount]["who_s"] = $attrib["WHO"]; $userdata[$usercount]["id_s"] = $attrib["ID"]; $userdata[$usercount]["date_s"] = $attrib["DATE"]; $userdata[$usercount]["time_s"] = $attrib["TIME"]; $userdata[$usercount]["title_s"] = $attrib["TITLE"]; $userdata[$usercount]["posts_s"] = $attrib["POSTS"]; break; } case $name=="TOPIC" : { $userdata[$usercount]["type_t"] = $attrib["TYPE"]; $userdata[$usercount]["who_t"] = $attrib["WHO"]; $userdata[$usercount]["id_t"] = $attrib["ID"]; $userdata[$usercount]["date_t"] = $attrib["DATE"]; $userdata[$usercount]["time_t"] = $attrib["TIME"]; $userdata[$usercount]["title_t"] = $attrib["TITLE"]; $userdata[$usercount]["posts_t"] = $attrib["POSTS"]; break; } default : {$state=$name;break;} } } function endElementHandler ($parser,$name){ global $usercount; global $userdata; global $state; $state=''; if($name=="REPLY") {$usercount++;} } function characterDataHandler ($parser, $data) { global $usercount; global $userdata; global $state; if (!$state) {return;} } if (!($xml_parser = xml_parser_create())) die("Couldn't Create Parser."); xml_set_element_handler( $xml_parser, "startElementHandler", "endElementHandler"); xml_set_character_data_handler( $xml_parser, "characterDataHandler"); while( $data = fread($fp, 4096)){ if(!xml_parse($xml_parser, $data, feof($fp))) { break;}} xml_parser_free($xml_parser); echo "\n<table class=\"forum\">\n"; echo "<tr>\n"; echo "<td>Topic Title:</td>\n"; echo "<td>Posts</td>\n"; echo "</tr>\n"; for ($i=0;$i<$usercount1; $i++) { if ($userdata[$i]["title_i"]) { echo "<tr>\n"; echo "<td>Important: ".$userdata[$i]["title_i"]."</td>\n"; echo "<td>".$userdata[$i]["posts_i"]."</td>\n"; echo "</tr>\n"; } } for ($i=0;$i<$usercount2; $i++) { if ($userdata[$i]["title_s"]) { echo "<tr>\n"; echo "<td>Sticky: ".$userdata[$i]["title_s"]."</td>\n"; echo "<td>".$userdata[$i]["posts_s"]."</td>\n"; echo "</tr>\n"; } } for ($i=0;$i<$usercount3; $i++) { if ($userdata[$i]["title_t"]) { echo "<tr>\n"; echo "<td>".$userdata[$i]["title_t"]."</td>\n"; echo "<td>".$userdata[$i]["posts_t"]."</td>\n"; echo "</tr>\n"; } } echo "</table>\n"; ?>
Well This Is The Code For A Forum.
Ive Used Virtually The Exact Same Code For Another Script
But Why Doesn't It Work...?
Thnx,
Tarun
-
Hmmm.....
This Account Has Been Suspended Please contact the billing/support department as soon as possible.
Seems Your Hosting Has Been Suspended
-
Sorry I Should Have Made It Clearer
I Meant To Create File Then Like Add Things To It Like
Add Another Member And Delete Another Member
-
Well How Can You Create XML Files Using PHP4
If You Can Plz Create This Example:
<MEMBERS> <MEMBER ID="45643" NAME="Maya" /> <MEMBER ID="53535" NAME="John" /> </MEMBERS>
Thnx,
Tarun
-
Okay lol
Thnx Anyway
-
Yes Same Error...
-
Okay But Now I Get This Error...
Warning: fopen(page.php?id=00001): failed to open stream: No such file or directory in /home/www/**********/index.php on line 3
-
$id = $_GET["id"]; if (!($fp=@fopen("page.php?id=$id", "r"))) die ("Page Does Not Exist");
This Code Peice Of Code Does Not Work
I Always Get Page Does Not Exist... I Think I Know Why But Hard To Explain
Any Ideas In How To Get Around It....?
THnx,
Tarun
-
Don't Mean To Be Picky
BUT PLEASE USE THE [ code ] & [/ code ] Tags (With Out The Spaces)
-
-
I Have A PHP Upload Script
It Works Fine When Uploading Using A Form
But I Doesn't Work When Creating An AJAX Post
Why...?
Is What I Would Like To Know
And If Possible How Can I Correct It
I Do Not Which To Display The Contents Of The PHP Script But The AJAX/HTML Is Fine
<script> var page = "upload.php"; function postAJAX(url, query, target) { var status = false; var contentType = "application/x-www-form-urlencoded; charset=UTF-8"; // Native XMLHttpRequest object if (window.XMLHttpRequest) { request = new XMLHttpRequest(); request.onreadystatechange = function() {ajaxDone(target);}; request.open("post", url, true); request.setRequestHeader("Content-Type", contentType); request.send(query); status = true; // ActiveX XMLHttpRequest object } else if (window.ActiveXObject) { request = new ActiveXObject("Microsoft.XMLHTTP"); if (request) { request.onreadystatechange = function() {ajaxDone(target);}; request.open("post", url, true); request.setRequestHeader("Content-Type", contentType); request.send(query); status = true; } } return status; } function ajaxDone(target) { if (request.readyState == 4) { if (request.status == 200 || req.status == 304) { results = request.responseText; document.getElementById(target).innerHTML = results; } else { document.getElementById(target).innerHTML="Ajax Error:\n" + req.statusText; } } } </script>
-
Well I Used A Different Method It Was Due To Windows Vista UAC (User Account Control)
Then I Did As Told And Then Restarted My Computer
But I Got "Internet Explorer cannot display the webpage" When Viewing An http://localhost Page
So I Reverted Back To The Old Files
Now I Shall Wait A While And Read Up On What I Did Wrong And Learn A Bit More
Then I May Try Again...
Anyway
Thnx For Your Help...
-
I Can't Save The hosts file once ive edited it
In Notepad It Says
Cannot create the C:\Windows\System32\drivera\etc\hosts file. Make sure the path and file name are correct.
And In EditPlus I Get
This is a read-only document.
I Think It's Because There Is No File Extension In The "hosts" File What Should I Do Now...?
-
Everything Has Worked An Ive Even Used My Own PHP Files In:
/xampp/htdocs/test/index.php - http://localhost/test
But How Do I Create A Sub-Domain Like http://test.localhost
Rather Than Using A Directory For My Test Files
Thnx,
Tarun
-
Ooopps Another Reply Was Posted Before I Did Mine
And I Didn't Even Realise LOL
Sorry
Javascript and CSS drop down menu
in Javascript Help
Posted
Can You Provide A Link
Or The Source Code And Mayby Someone Can Manipulate It
Into A 6 Level Menu