/    Sign up×
Community /Pin to ProfileBookmark

use php to change page instead of javascript (ajax question)

I know how to use ajax to change a pages appearance without reloading the whole page again. I want to know if anyone knows of a way to change a pages appearance with php instead of javascript. Below is the method I use to initially make my page work.

<div id=”contactboxdiv” style=”display:<?php echo [COLOR=”SandyBrown”]$colors[‘contactdisplay’][/COLOR];?>;left:<?php echo $colors[‘contactleft’];?>”></div

As you can see, I call certain php variables to fill in my html. I want to change these attributes by updating the php. In Ajax, you use javascript to ultimately change the appearnce. I want to know if I can reload just the php with the new styleing attributes, instead of document.getElementById(‘contactbox’).style.display…….
I would like to update my [COLOR=”SandyBrown”]$colors[‘contactdisplay’][/COLOR] php variable and have it re-print it. Is this possible? Did I make any sense?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@Declan1991Sep 28.2007 — No. I may be wrong, but I don't know how you would communicate the change to the server without Javascript. I'm almost sure that what you ask is impossible.
Copy linkTweet thisAlerts:
@lehulaauthorSep 28.2007 — ya thats what I figured. I was just trying to save myself a lot of javascript writing. 'sigh' oh well. here we go.
×

Success!

Help @lehula spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...