???Migration from JavaScript to PHP???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
beath
Forum Newbie
Posts: 2
Joined: Sun Jun 27, 2004 6:10 am
Location: Zurich - Switzerland
Contact:

???Migration from JavaScript to PHP???

Post by beath »

hi

during the migration of some javascript-modules to PHP, i'm looking for a simple answer to the following question:

how can i access a defined value (image-source-value) of a defined object (identified by the id-attribute)?

HTML

Code: Select all

<img  &#1111;b]id&#1111;/b]="photoContainerImage" src="06_normal.jpg" width="400" height="300" class="photoFrame" />
JAVASCRIPT-implementation

Code: Select all

var currentImage = document.getElementById('photoContainerImage');
  currentHref = currentImage.src;
  Result currentHref -> 06_normal.jpg
8O ???PHP-implementation??? 8O

I'm aware of the fact, that client- and server-scripts are different things. regardless of this fact, i think it should be possible for PHP, to access the document-elements while parsing the document huh?

anyway, I'm thankful for any hint
hang loose
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Re: ???Migration from JavaScript to PHP???

Post by scorphus »

Hi beath, welcome to DevNetwork Forums!
beath wrote:I'm aware of the fact, that client- and server-scripts are different things. regardless of this fact, i think it should be possible for PHP, to access the document-elements while parsing the document huh?
Anything in a PHP script is processed in server side, there is no way to run PHP in the client's browser, like JavaScript or ActionScript (Flash).

It seems to me you know the difference between server- and client-scripts. So you can figure out if you can migrate this part of the JavaScript or not.

Regards,
Scorphus.
Post Reply