Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Using JavaScript with PHP...
Old 06-07-2007, 12:42 PM Using JavaScript with PHP...
The PHP Professor

Posts: 340
Name: Alex
Location: Behind You
Trades: 0
I was going to use Ajax and probaly will in the future, but for now i need to know how to do this:

I want to be able to click a link and as soon as the link is clicked a PHP page is executed, but not opened. So somthing like this:

PHP Code:
<html>
<
head>
<
title>example</title>
<
script language="javascript">
function 
execphp('page')
{
var 
execphp page;
... and 
some more scirpt or somthing
}
</script>
</head>

<body>
<a href="javascript:void(0)" onclick="execphp('examplepage.php')">
</body>
</html> 


...where execphp() would execute the PHP page, so it would be like Ajax, execpt it does not send requests to the server. Is this possible and if so how?
__________________
Go Kirby! <(" . "<) (^" . "^) (>" . ")> Talkupation!
microcolt is offline
Reply With Quote
View Public Profile Visit microcolt's homepage!
 
 
Register now for full access!
Old 06-07-2007, 02:41 PM Re: Using JavaScript with PHP...
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
You could:

1) Set the target to _blank and then have the php scripts send a JS close window.
2) Have a hidden frame and change it's location.
3) Use Ajax - sending a request to the server is exactly what you're trying to do. The only difference is that you don't want the results, so you can skip the handler.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 06-20-2007, 03:50 PM Re: Using JavaScript with PHP...
willcode4beer's Avatar
Super Moderator

Posts: 1,533
Name: Paul Davis
Location: San Francisco
Trades: 1
You could also load an image.
Take a look at my javascript logging page.

Even if your goal is not logging, the concept remains. Just use the url for your php page.
__________________

Please login or register to view this content. Registration is FREE

willcode4beer is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Using JavaScript with PHP...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.43088 seconds with 12 queries