Connecting Tech Pros Worldwide Help | Site Map

strange things happened in mexico..

Newbie
 
Join Date: Dec 2007
Posts: 4
#1: Dec 11 '07
i have a menu.php, which calls login.php inside a <div>, then login.php calls aother-file.php to check the usr and psw in a database... if the user is logged on, i need to change the status div.. the status div is in the same page of menu.php.. but doesnt work.. how can i refresh the status div? i tried to use ajax.updater and nothing, directly write in the file $('usr_status').innerHTML='admin'; and nothing happened...


please.. help!!!!
Newbie
 
Join Date: Dec 2007
Posts: 4
#2: Dec 11 '07

re: strange things happened in mexico..


i resolve this.. now.. how can i call a function automatically, when a file is running?

i mean...in the second file, i put a <input type=button onclick=funcion1();>
i put function funcion1 in the menu.php and. it works.. now.. i want funcion1 runs when this file loads...
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,126
#3: Dec 11 '07

re: strange things happened in mexico..


hi ...

you may use the body's onload method:

[HTML]<script type="text/javascript">
function func() {
alert('now running on load');
}
</script>
<body onload="func();">
testtext
</body>
[/HTML]
kind regards
Newbie
 
Join Date: Dec 2007
Posts: 4
#4: Dec 12 '07

re: strange things happened in mexico..


hi..
thnx.. didnt work..


Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $valid=$_GET['valid'];
  3. if ($valid=='adm')
  4. {
  5.  
  6.     echo"login..";
  7.     echo"<input type=button onclick='alerta();'>";
  8.  
  9. }
  10. ?>
  11. <script type="text/javascript">
  12.  
  13.     function func()
  14.     {
  15.         alert('dentro');
  16.     }
  17. </script>
  18. <body onLoad="func()";>
  19. some text here
  20. </body>
--
i have this, if i type mydmain.com/this.php it works but.. inside the program , it's called from a login.php with header("location: this.php?valid=adm");

and doesnt works... :(

thanks anyway.. ithink i need to spread my page into 2 frames :(

Quote:

Originally Posted by gits

hi ...

you may use the body's onload method:

[HTML]<script type="text/javascript">
function func() {
alert('now running on load');
}
</script>
<body onload="func();">
testtext
</body>
[/HTML]
kind regards

Reply