Dynamic Paragraph (with PHP)?
# January 10, 2009 at 4:00 pm
This could probably be done a few different ways, but I want to figure out how to use PHP to accomplish this.
So, I want to be able to have the text contained in a certain p element change when the corresponding image is clicked.
I want to do this so that everything will happen on the one page instead of having to created x amount of pages for all the images/text I have.
I’m probably making this harder than it really is. Any help/advice is appreciated. Thanks.# January 10, 2009 at 6:15 pm
Ok well, now I have a new issue.
The way I got it to work is by setting different variables for each new block of text. I used a switch statement to have the blocks of text change when the corresponding image is clicked. However, when you first load the page, all you see are the images you can click to show the text.
Now I’m trying to figure out how to have text already be on the page and then be replaced when an image is clicked and not seen again until the entire page is reloaded.
Any ideas?# January 14, 2009 at 9:25 pm
Well, like I said before, I accomplished this by using a switch statement. However, on this same page, I have a tiny contact form that is also using PHP. My problem now is when you click "send" to submit the form, the page reloads/refreshes instead of staying in the current state.
If anyone knows how to make the page stay at whatever is currently loaded instead of refreshing when the "send" button is pressed, please enlighten me. Thanks!
You must be logged in to reply to this topic.