Problem related to PHP and Javascript

Hello ppl, i am coding for a website and i want to run this code. But i dont know why its not running.





Username: Password:
It should redirect on page welcome.php, but the result is the page itself. Can anyone plz help me with this, or if you know any other method to redirect to a PHP page after validation from Javascript.

Replies

  • slashfear
    slashfear
    Hi Peeyush,

    I am not able to run and test this code ๐Ÿ˜” for some reason my Apache is not working... any way I run through your script and found that You have used input type of submit button so when you use the submit button by default it will take you to the location what you have specified in the action attribute in the form since you have not specified any action attribute its is showing you the same page so, you can change the input type to be button and then use the onClick event handler or you can specify onSubmit event handler in the form definition.

    And also in the javascript function check(), in order to redirect to another page you can use window.location = "somelocation"

    If you have any doubts please feel free to ask..... ๐Ÿ˜€

    -Arvind
  • Pensu
    Pensu
    well...onclick() is working fine....and i tried window.location. Same result...๐Ÿ˜”
  • Rahulmarkan
    Rahulmarkan
    i am beginner of shopping cart application. i am installed os commerce downloaded code in my local computer. It is up some extent working, but before checking page i stuck on same page.
    i am trying to pass variable information to javascript function, it is working. And i required to set java script variable set to session. how can ?
    i am trying to those values to appending with url path, i.e add & to url and append those variables. but its not appending in my web browser address bar. but that variable information is perfectly shown in alert box of javascript function.
    so i think creating form is something better, how can i?
    how to create form in oscommerce application?
  • Morningdot Hablu
    Morningdot Hablu
    use
    insted of
    on more thing it's window not windows.Window is default so you can also write location.href.
    And if again it's not working(may be the reason your server is on different port then 80(default)).
  • slashfear
    slashfear
    nicepeeyush
    well...onclick() is working fine....and i tried window.location. Same result...๐Ÿ˜”
    Why its not working ?? It will work!! Here is my modified code (with the changes I told you in my previous reply) which is tested and working!!

    
    
    
    
    
    Username: Password:
    -Arvind

You are reading an archived discussion.

Related Posts

i have read this topic about producing electricity from shoes by using piezo electric effect..i am very inquisitive to know how that happens?can any one explain me the principle and...
I pose this highly debatable question to you : Why do you think that slums exist in India? Note that here I am not talking about their origin but their...
There are two poles of equal height 15mts. One cable with length 16mts is hanging between that two poles. The height from center of the cable to earth is 7mts...
I wish CEan - Praveenscience, A Many More Happy Returns of the Day! ๐Ÿ˜ ๐Ÿ˜ ๐Ÿ˜ ๐Ÿ˜ :myparty: :myparty: :myparty: :myparty: Hope you have a Successful, Brightful and Fruitful Year...
can any one tell me how to make a ubuntu live usb please...thankyou