Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-18-2011, 09:37 PM   PM User | #1
chubbypama
New to the CF scene

 
Join Date: Apr 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
chubbypama is an unknown quantity at this point
Exclamation how to call php/ajax page from asp

Let me start off by saying that what i'm trying to do might not be the best way to do things... but ??

PROBLEM
I need to display the contents of a php page in my asp page. The php stuff is maintained by another department.
i'm using asp's http web request object to get the rendered PHP page (all html) and i'm able to display it in a separate frame, no problem. But, the php page includes some logic that I can't seem to get to work from within my frame.
The idea is that when you click on a hyperlink in the main php page that i've embedded (i'll call this page PHP Page 1), it will send a tag value to php page 2.
PHP page 2 returns a success/fail ret value which is displayed in php page 1, without have to post back to the server or refresh the page. The ret value just "shows up" via ajax logic. (PHP Page 1 is using jquery.js)


My problem is that from the frame within my ASP page, I can't get it send the code properly to PHP Page 2...

Here's what PHP Page 1 looks like in part:

Code:
<div id="target22">&nbsp;</div>
<div id="source22">
      <a href="#" onclick="myfunction('22')">22</a>
</div>
"myfunction", in part, looks like this:

Code:
<Script>
myfunction(tagID){
 $("#target", + tagID).load("phpPage2.php?tagVal=" + tagID);
}
</script>
WHAT I'VE DONE SO FAR
I've modified function so that php page 2 includes a full path for the file.
eg: http://server1/Page2.php?tagVal= etc...

I've also tried changing the href in the hyperlink from:
<a href="#" onclick="myfunction('22')">22</a>to
<a href="http://serverA/Page1.php#" onclick="myfunction('22')">22</a>

I've also tried adding a copy of jquery.js into my web folder.

But call to page2.php is not successful. I know it's not working because when I launch page1.php in a separate browser, it doesn't show any return value at all -meaning that page2.php wasn't ever called.

I guess I need to know if this is even possible. I assumed it was because although I'm using an ASP page, by the time PHP page 2 is called by PHP 1, it's really just being called by an HTML page.

Any suggestions?
chubbypama is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 07:18 PM.


Advertisement
Log in to turn off these ads.