6 Replies - 950 Views - Last Post: 05 July 2009 - 08:56 PM Rate Topic: -----

#1 meneltour27  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 40
  • Joined: 30-June 09

PHP and javascript

Post icon  Posted 05 July 2009 - 03:11 PM

I haven't started yet to learn PHP but i started learning javascript. Does PHP support javascript?? and if yes how do i use a function in the PHP code?? i have tried googling it but the only examples i found of javascript is in html ...(maybe i am not using the right keywords...)
Is This A Good Question/Topic? 0
  • +

Replies To: PHP and javascript

#2 peter yianni  Icon User is offline

  • D.I.C Regular

Reputation: 2
  • View blog
  • Posts: 310
  • Joined: 04-June 09

Re: PHP and javascript

Posted 05 July 2009 - 03:27 PM

View Postmeneltour27, on 5 Jul, 2009 - 02:11 PM, said:

I haven't started yet to learn PHP but i started learning javascript. Does PHP support javascript?? and if yes how do i use a function in the PHP code?? i have tried googling it but the only examples i found of javascript is in html ...(maybe i am not using the right keywords...)


yes u can use both
as long as u close your php then start javascript
then u can put more php if u want
same as using php with html
as long as u start and close them
Was This Post Helpful? 0
  • +
  • -

#3 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3099
  • View blog
  • Posts: 10,888
  • Joined: 08-August 08

Re: PHP and javascript

Posted 05 July 2009 - 03:28 PM

Javascript is like html from php's perspective: both get executed on the client side. Php is run on the server.
Was This Post Helpful? 0
  • +
  • -

#4 meneltour27  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 40
  • Joined: 30-June 09

Re: PHP and javascript

Posted 05 July 2009 - 03:32 PM

View PostCTphpnwb, on 5 Jul, 2009 - 02:28 PM, said:

Javascript is like html from php's perspective: both get executed on the client side. Php is run on the server.


So if i understand what you say correctlly PHP doesn't really need javascript because javascript gives HTML the flexibility that PHP allready has. am i right?
Was This Post Helpful? 0
  • +
  • -

#5 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3099
  • View blog
  • Posts: 10,888
  • Joined: 08-August 08

Re: PHP and javascript

Posted 05 July 2009 - 03:43 PM

Javascript is a programming language just as php is one, but php is done running by the time javascript begins running. There is some overlap, but generally javascript is better suited for user interaction and php is better for dealing with back end issues like databases.
Was This Post Helpful? 0
  • +
  • -

#6 meneltour27  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 40
  • Joined: 30-June 09

Re: PHP and javascript

Posted 05 July 2009 - 04:00 PM

soz but i wanna be sure i get what you say
for example u will use javascript to get from a user some info and then with php you will edit and send those data in a SQL database

EDIT: never mind i thing i get what you say ty a lot for the info u have given me

This post has been edited by meneltour27: 05 July 2009 - 04:24 PM

Was This Post Helpful? 0
  • +
  • -

#7 noorahmad  Icon User is offline

  • Untitled
  • member icon

Reputation: 209
  • View blog
  • Posts: 2,290
  • Joined: 12-March 09

Re: PHP and javascript

Posted 05 July 2009 - 08:56 PM

i think you are asking about AJAX, before learning AJAX you should learn javascript, if you are able to work in javascript then PHP and AJAX will help you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1