Welcome! Log In Create A New Profile

Advanced

Date & Time functions

Posted by DanielCilliers 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
avatar Date & Time functions
March 14, 2013 10:47AM
Hi, I would just like to know on what page in the text book does it tell you how to use the date function as well as the time function? And also where does it tell you how to make a numbered/bulleted list? I can't seem to find it and I'm therefore unable to do it for the assignment. Any help would be greatly appreciated. Thankx
avatar
Mac
Re: Date & Time functions
March 14, 2013 02:25PM
Date time is in the tut on the CD.

Making a list is HTML form a previous module.
avatar Re: Date & Time functions
March 15, 2013 10:20AM
I'm confused. The tutorial letter says "you must use PHP to generate the page in its entirety". So am i allowed to use HTML? Because its a little difficult without it.
avatar
Mac
Re: Date & Time functions
March 15, 2013 01:07PM
No, read further smiling smiley

• At the very top of the page, define and include all the content (including any HTML you use) as required in a series of variables, then echo the variables to produce the page (e.g. $time=xxxx; echo “The time is $time”;
• Thereafter, echo these variables to produce the page.

In other words, you put the HTML in variable/s which you echo using PHP.
avatar Re: Date & Time functions
March 18, 2013 11:27AM
I see. But I have no idea how to do that. My page consists of normal <html> tags and then i have my javascript inside the <head> tags for the link and my PHP code inside the <body> tags. All the variables i used are declared in the PHP tags and i then echoed them there.
avatar
Mac
Re: Date & Time functions
March 18, 2013 04:40PM
> you put the HTML in variable/s which you echo using PHP.
avatar Re: Date & Time functions
March 18, 2013 07:10PM
So I can put all my HTML in a PHP variable say for example:
<?php
$code = <html>
<head> my javascript code</head>
<body>...... </body>
</html>

echo $code?????
?>

Is that what you mean? This is something I havn't come accross yet in any of my subjects, I think Unisa should've covered this (putting HTML in PHP variables) before asking us to do it in an assignment.
avatar
Mac
Re: Date & Time functions
March 19, 2013 06:28AM
You can't be serious...... this is what programming is all about!!! Read your handbook page 26 - putting text into variables. HTML is nothing but text!!!
avatar Re: Date & Time functions
March 19, 2013 09:19AM
I know HTML is nothing but text , I did really well with my HTML and javascript last year. My question might have been a little unclear, when I put the HTML into a PHP variable, do I still include all the tags and such as I would for a normal HTML page? Sorry to be bothering you with this but the textbook(pg26) only tells you about variables in general and through out the text book the PHP code is in the <body> section of the HTML in all the examples - Thats where my confusion comes in.
avatar
Mac
Re: Date & Time functions
March 20, 2013 08:10AM
Yes, as long as you make use of double quotes to capture the HTML string. If the HTML also has double quotes, you can escape the double quote

Language: PHP
$li="<li class=\"g\" id=\"newsbox\">";
avatar Re: Date & Time functions
March 20, 2013 10:39AM
Ok thankx alot Marc, got it going now. Can i use a button instead of a link? I can't get the link to work with the onclick event.
avatar
Mac
Re: Date & Time functions
March 20, 2013 12:18PM
Whatever you want....!
avatar Re: Date & Time functions
March 20, 2013 01:03PM
Well in that case im done then smiling smiley Thankx alot for all your help and patience.
Sorry, only registered users may post in this forum.

Click here to login