Advertisement

08.08.2008 at 03:30AM PDT, ID: 23632210
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.3

Problems with AJAX uploader script

Asked by capsoftuk in Asynchronous Javascript and XML (AJAX), PHP Scripting Language

Tags: ,

Hi there,

I'm currently writing a PHP/MySQL/Ajax enabled script that allows members of our team upload forms to a website for public consumption. I'm nearly there, thanks to the help of EE members, but I'm having a strange problem with one of the final steps. I'm an AJAX newbie, but I've got it all working pretty harmoniously - save for one issue.

I've set an onsubmit tag on my form so that it calls one of my several php pages through the wizardry of AJAX. However, when I click the submit button, the form created by the back-end php through ajax appears for a second and then disappears again, to be replaced by the text that was shown in the div in the first place. If there is no text in the div, it appears and disappears in an instant.

I've posted the javascript here and the php code for the page - if anyone can help please let me know.

Cheers Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
-----JS-----
function showUploader()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="showUploader.php"
url=url+"?sid="+Math.random()
xmlHttp.onreadystatechange=uploader
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
 
function uploader() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("upload").innerHTML=xmlHttp.responseText 
 } 
}
------END JS------
 
------PHP------
 
<?php
session_start();
 
include('../../includes/dbfunc.inc');
 
$q=$_GET["q"];
 
 
$_SESSION['fpID'] = $q;
 
db_connect("xxxxxxxx");
 
echo "This is totally rubbish man";
 
?>
 
-----END PHP-----
 
-----Form Tag-----
<form method=POST onsubmit="showUploader();">
-----Div tag-----
<div id="upload"></div>
[+][-]08.08.2008 at 09:53PM PDT, ID: 22195102

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Asynchronous Javascript and XML (AJAX), PHP Scripting Language
Tags: PHP/AJAX, IE6+ Firefox 3
Sign Up Now!
Solution Provided By: b0lsc0tt
Participating Experts: 2
Solution Grade: A
 
 
[+][-]08.09.2008 at 01:00PM PDT, ID: 22197499

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.01.2008 at 08:53AM PDT, ID: 22361213

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42 / EE_QW_2_20070628