Jump to content

How to make code go to another page, without page reloading


jjmusicpro

Recommended Posts

Here are a few option that may help you.

 

Use an <iframe></iframe>.

 

You may also want to try calling a

 

function somefunction() {

     enter script Here...

     }

 

 

Call the function:

 

<php

   somefunction();

?>

 

I am not sure if this is what you want but the should be able to do what you want.

Link to comment
Share on other sites

Yeah, this really is one where you just want to go and do an ajax tutorial - w3schools is the one I used:

 

http://www.w3schools.com/Ajax/ajax_intro.asp

 

What you trying to do is the very definition of Ajax, and the tutorial posted shows you how to do it in a way that works for all the browsers, with error handling. Don't let the fact it uses asp worry you - your just printing out a few simple lines, which you can do in any language.

 

To make debugging easier, I'd go get Firefox if you don't have it, and add file_put_contents('request.txt', print_r($_REQUEST, true)); at the top of my scripts.

Link to comment
Share on other sites

Ive looked through the ajax turtorials...

 

ok say im not going to do this in AJAX

 

I want to make a page where i put in some data, it send that data to another page, where the code in that page, actually goes to another site, and puts in the data, and presses "submit" just as if i were to go to that page and do it.

 

 

Link to comment
Share on other sites

cURL?

 

Yeah, but that makes the server do it, not the browser.  How about we start at the root of the question?  What exactly do you want to do this for, and be specific.

 

Maybe cURL is what im looking for.

 

I wanted to have a page that has "title" and "body" check box's.

Then i fill those in, hit submit, and it will go to some other website that has those fields on the page, it puts those values into that page, hits the submit on that page, and then search the results page for "your post has been submitted", or something in the return text.

 

Then put "worked" if it found that text in the respone, or "not worked" if it didnt find text.

 

Hope that helps.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.