Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to change an HTML element property using its ID with PHP?

Tags:

html

php

I want to do something like this:

page A has a link to page B
page B gets content from a database and processes it
the result from page B is displayed on a div in page A

Please notice that I don't want to leave page A while page B processes the information of the database.

What I'm really trying to do is avoid using frames in the site, and I want to make the pages appear in a div. Is this possible?

I'm guessing its kinda of a newbie question, but it's really bugging me and i don't even know where to start looking.

like image 591
Joum Avatar asked Feb 02 '26 23:02

Joum


2 Answers

You want AJAX!

AJAX will do that, but the steps will be a little different from what you describe

  • page A has a link that calls a javascript function
  • the javascript function makes an AJAX call to page B which gets content from a database and processes it
  • the result from page B is returned to the javascript function
  • page a displays it in a div
like image 169
Tom Ritter Avatar answered Feb 05 '26 11:02

Tom Ritter


What you are looking for is JavaScript and AJAX.

like image 39
Scott Bevington Avatar answered Feb 05 '26 12:02

Scott Bevington



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!