Hi everyone,

I have a question, first of all. I run a PHP, but instead of using

header("Location: index.php");

I'm using this one,

echo("<script type='text/javascript'> window.location = 'index.php' </script>");

And this is worked.

I have a new project now, and it have ajax, load PHP files inside <div> tag.

I can't use this javascript redirect code to my new project. because I am using this line of code.

onclick=\"javascript: DoAjax('indexpage.php', 'Page');

We call the indexpage.php to run inside of the Page div tag., now I do have a login form ajax. how can I redirect the new page. to run it to specific <div> tag only just the example above?

Guys, please help.

Thanks.

Inside onsomething attributes, you need not prefix code with javascript:.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.