Jump to content

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


jjmusicpro

Recommended Posts

I wanted to make a page where you put in details like, title, description etc.

and hit go..

 

Then it will send that data to some ajax page that will post this data say into a forum etc.

 

I dont know how to navigate pages without it changing the main page.

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.

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.

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.

 

 

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.