PDA

View Full Version : somebody help me!!!!!



jvrlasso
27 Jul 2007, 5:44 PM
Hi!...... i need your help..... the follow code doesn't work for me:

html file:
<div id="msg" style="visibility: hidden"></div>
Name: <input type="text" id="name" /> <br />
<input type="button" id="oKButton" value="OK" />

js file:

Ext.get('oKButton').on('click', function(){
var msg = Ext.get("msg");
msg.load({
url: 'ex.php',
params: "name=" + Ext.get('name').dom.value,
text: "Wait..."
});
msg.show();
});

ex.php file

<?php
echo "trying to acces";
?>

Help me please!... what can i do?

cluettr
27 Jul 2007, 8:18 PM
That should work, is your php file in the same directory as this script?

evant
27 Jul 2007, 8:23 PM
Saying "doesn't work" doesn't help.

Specifically, what goes wrong? Do you get an error message? If so, what line?

BernardChhun
28 Jul 2007, 4:07 AM
Please change your title post as it doesn't add any relevant information on your problem. :-|

rtannert2
28 Jul 2007, 4:39 AM
I second the request for more complete information about the problem. Maybe we could see the entire HTML file and the entire JS file, as well as the error message you're getting and the browser you're getting it in.

In case the code you gave is all there is, it will execute before the page is rendered, so Ext.get() will fail to find the button. In this case simply wrap what you've got inside an Ext.onReady() call:


Ext.onReady(function(){

// your code here

});

If there's more to it, seeing the rest of the code will help.

jvrlasso
28 Jul 2007, 7:07 AM
yes CLUETTR!.

the php file is in the same folder.
also i try to create a sample file in the php file like this:
$s_f = fopen("sample.txr","w+");
fwrite($s_f,"something...");
fclose($s_f);

and the file not create.

i think that it's not accesing to the php file..... so... what can i do whit this situation.

jvrlasso
28 Jul 2007, 7:10 AM
everything it's ok, except the php file load.....

cluettr
28 Jul 2007, 8:38 AM
Run this in firebug and look at the Net tab, if it is not actually getting to your php file you'll see that... check the response too... see what if anything you are getting back... you may actually see the error in there too.