|
| 06 Jan 2012 05:09 PM |
How would I redirect to a page, without actually redirecting to it? Let me explain. I want a PHP script to run when a certain JS function is added. Would I use `window.location`?
[ SCARS DON'T HEAL WHEN YOU KEEP CUTTING ] |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2012 05:11 PM |
i dont understand what you're asking
HE'S HACKIN' AND WHACKIN' AND SMACKIN' |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2012 05:14 PM |
Let me explain my scenario. I have a form, and it has one `<input>` in it. Using the `onchange` HTML attribute, it will run a function called `validateEmail()`, and I want it to run a PHP script INSIDE the index.php without redirecting to another page.
[ SCARS DON'T HEAL WHEN YOU KEEP CUTTING ] |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2012 05:17 PM |
are you trying to make sure the email is real or not? ?_?
HE'S HACKIN' AND WHACKIN' AND SMACKIN' |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2012 05:18 PM |
Yes, I know how to do that with PHP. But I'm trying to get the PHP script to RUN.
[ SCARS DON'T HEAL WHEN YOU KEEP CUTTING ] |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2012 05:19 PM |
Within the index.php page (homepage). [ SCARS DON'T HEAL WHEN YOU KEEP CUTTING ] |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2012 05:22 PM |
"[ SCARS DON'T HEAL WHEN YOU KEEP CUTTING ]"
Scars don't heal at all. Ever. |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2012 05:26 PM |
Thanks for the relevant comment by the way, Arceus.
[ SCARS DON'T HEAL WHEN YOU KEEP CUTTING ] |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2012 05:34 PM |
that's a really inefficient way to do that though.. lol
HE'S HACKIN' AND WHACKIN' AND SMACKIN' |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2012 05:43 PM |
Okay, how would you rather me do it?
[ SCARS DON'T HEAL WHEN YOU KEEP CUTTING ] |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2012 05:49 PM |
search "PHP Tutorial // Registration V3." on youtube
HE'S HACKIN' AND WHACKIN' AND SMACKIN' |
|
|
| Report Abuse |
|
|
rcm
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 621 |
|
|
| 06 Jan 2012 06:00 PM |
I'm learning javascript too!
According to w3schools (don't hate me for saying that) if you have the following inside of the form tag you can prevent a webpage from actually submitting:
onsubmit="return false;"
Of course you'd replace the script with if statements and stuff, and if somethings wrong return false. |
|
|
| Report Abuse |
|
|