Jump to content

Need help with JS & PHP


Recommended Posts

Im new to PHP/JS ...  I searched everywhere and the only answer Im getting is ajax... which I do not under stand at all! 

 

 

I have this Birthday (Javascript) Script.. which works... but I need the result from that birthday script to work with my PHP script..  here is the birthday.php

 

 

<script language="JavaScript">



var arrBday = [
['@user1','10/12/1984'],
['@user2','1/1/1900'],
['@user3','10/12/1984'],
['@user4','10/12/1984'],
];

function displayBdayList(today){
var bday,strList='';
for (var i=0;i<arrBday.length;i++){
bday = new Date(arrBday[i][1]);
if (!isNaN(bday) && bday.getMonth()==today.getMonth() && bday.getDate()==today.getDate())
strList+=' '+arrBday[i][0]+" ";
}
if (strList=='') strList='- Nobody Has a Birthday Today'
document.write("Happy Birthday: "+strList)
}


displayBdayList(new Date());



</script>

 

 

The outcome will be "Happy Birthday: @user @user @user"  I want that outcome to be sent to another PHP file to be used as a variable. But dont know how to use ajax at all....  Im aware that PHP works before Javascript...    so is there anybody that can help me out with this?  Would greatly appreciate it

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.