Attention: Server maintenance in progress. - Please click [here] to read more! (Last update: Friday, 19th of April, 09:04 PM/21:04, UTC+2, Europe)


Need A LITTLE help with coding.
2016-06-05, 06:49 AM,
#1
Hi, I am currently working real hard on my landingpage. Its almost over.. Just this last step.

I took a code from a template here, and it said {%today_date%}

and it works. but when i type {%yesterday_date%} it doesn't can anyone guide me to how automatically change the date to current and asle yesterday and day before yesterday and even before.. please thanks

i can use HTML and CSS. unfornately avoid javascript plz.

A Career in Digital Marketing with CPA, Thats sounds like LIFE!
Reply
Share This Thread :

2016-06-05, 07:03 AM, (This post was last modified: 2016-06-05, 07:04 AM by MoneyCashers.)
#2
(2016-06-05, 06:49 AM)Qoins Wrote: Hi, I am currently working real hard on my landingpage. Its almost over.. Just this last step.

I took a code from a template here, and it said {%today_date%}

and it works. but when i type {%yesterday_date%} it doesn't can anyone guide me to how automatically change the date to current and asle yesterday and day before yesterday and even before.. please thanks

i can use HTML and CSS. unfornately avoid javascript plz.

You should use PHP for this when ever possible:

If you wanted today's date you would go with:
PHP Code:
<?php

echo date("Y-m-d");

?>

For yesterday it would look like:
PHP Code:
<?php

$Date 
date("Y-m-d");

$Yesterday date('Y-m-d'strtotime($Date' - 1 days'));

echo 
$Yesterday;

?>

Also you can add as many days as you'd like:
PHP Code:
<?php

$Date 
date("Y-m-d");

$Tomorrow date('Y-m-d'strtotime($Date' + 1 days'));

echo 
$Tomorrow;

?>

Hope that answers your question mate.

To Your Success,

~MoneyCashers

Even if you don't believe in yourself... I will. :)
Reply
2016-06-05, 07:08 AM, (This post was last modified: 2016-06-05, 07:16 AM by Qoins.)
#3
(2016-06-05, 07:03 AM)MoneyCashers Wrote:
(2016-06-05, 06:49 AM)Qoins Wrote: Hi, I am currently working real hard on my landingpage. Its almost over.. Just this last step.

I took a code from a template here, and it said {%today_date%}

and it works. but when i type {%yesterday_date%} it doesn't can anyone guide me to how automatically change the date to current and asle yesterday and day before yesterday and even before.. please thanks

i can use HTML and CSS. unfornately avoid javascript plz.

You should use PHP for this when ever possible:

If you wanted today's date you would go with:
PHP Code:
<?php

echo date("Y-m-d");

?>

For yesterday it would look like:
PHP Code:
<?php

$Date 
date("Y-m-d");

$Yesterday date('Y-m-d'strtotime($Date' - 1 days'));

echo 
$Yesterday;

?>

Also you can add as many days as you'd like:
PHP Code:
<?php

$Date 
date("Y-m-d");

$Tomorrow date('Y-m-d'strtotime($Date' + 1 days'));

echo 
$Tomorrow;

?>

Hope that answers your question mate.

To Your Success,

~MoneyCashers
hi, thanks but I am pasting this in html and it shows nothing. also, i am using cpagrip file/link lockers.

A Career in Digital Marketing with CPA, Thats sounds like LIFE!
Reply
2016-06-05, 07:36 AM, (This post was last modified: 2016-06-05, 07:40 AM by MoneyCashers.)
#4
(2016-06-05, 06:49 AM)Qoins Wrote: hi, thanks but I am pasting this in html and it shows nothing. also, i am using cpagrip file/link lockers.

Without seeing it I'm going to guess that you're not separating the two coding formats properly... For example:

PHP Code:
<?php

$Date 
date("Y-m-d");

$Yesterday date('Y-m-d'strtotime($Date' - 1 days'));

?>

<html>
<body>

<h1>The Time is:</h1> <p><?php echo $Yesterday?></p>

</body>
</html> 

Also make sure your index file is a .php not .html...
If it must be an .html take a look at this work around: http://stackoverflow.com/questions/11312...html-files

To Your Success,

~MoneyCashers

Even if you don't believe in yourself... I will. :)
Reply
2016-06-05, 07:41 AM, (This post was last modified: 2016-06-05, 07:43 AM by Qoins.)
#5
(2016-06-05, 07:36 AM)MoneyCashers Wrote:
(2016-06-05, 06:49 AM)Qoins Wrote: hi, thanks but I am pasting this in html and it shows nothing. also, i am using cpagrip file/link lockers.

Without seeing it I'm going to guess that you're not separating the two coding formats properly... For example:

PHP Code:
<?php

$Date 
date("Y-m-d");

$Yesterday date('Y-m-d'strtotime($Date' - 1 days'));

?>

<html>
<body>

<h1>The Time is:</h1> <p><?php echo $Yesterday?></p>

Sir, like i said. I am using file locker, hence not able to change any of that. Only got 2 boxes to write in. 1 CSS and another for Html codes
</body>
</html> 

Also make sure your index file is a .php not .html...
If it must be an .html take a look at this work around: /questions/11312316/how-do-i-add-php-code-file-to-html-html-files

To Your Success,

~MoneyCashers
I am using cpagrip locker, hence i have 2 boxes to write code within, 1 for html and another for css. Nothing about index or anything

A Career in Digital Marketing with CPA, Thats sounds like LIFE!
Reply
2016-06-05, 09:57 AM, (This post was last modified: 2016-06-05, 09:58 AM by MoneyCashers.)
#6
(2016-06-05, 07:41 AM)Qoins Wrote:
(2016-06-05, 07:36 AM)MoneyCashers Wrote:
(2016-06-05, 06:49 AM)Qoins Wrote: hi, thanks but I am pasting this in html and it shows nothing. also, i am using cpagrip file/link lockers.

Without seeing it I'm going to guess that you're not separating the two coding formats properly... For example:

PHP Code:
<?php

$Date 
date("Y-m-d");

$Yesterday date('Y-m-d'strtotime($Date' - 1 days'));

?>

<html>
<body>

<h1>The Time is:</h1> <p><?php echo $Yesterday?></p>

Sir, like i said. I am using file locker, hence not able to change any of that. Only got 2 boxes to write in. 1 CSS and another for Html codes
</body>
</html> 

Also make sure your index file is a .php not .html...
If it must be an .html take a look at this work around: /questions/11312316/how-do-i-add-php-code-file-to-html-html-files

To Your Success,

~MoneyCashers
I am using cpagrip locker, hence i have 2 boxes to write code within, 1 for html and another for css. Nothing about index or anything

You are limiting your options then quite a bit.

PS. Just got your PM and added you.

~MoneyCashers

Even if you don't believe in yourself... I will. :)
Reply
2016-06-05, 10:27 AM,
#7
(2016-06-05, 09:57 AM)MoneyCashers Wrote:
(2016-06-05, 07:41 AM)Qoins Wrote:
(2016-06-05, 07:36 AM)MoneyCashers Wrote:
(2016-06-05, 06:49 AM)Qoins Wrote: hi, thanks but I am pasting this in html and it shows nothing. also, i am using cpagrip file/link lockers.

Without seeing it I'm going to guess that you're not separating the two coding formats properly... For example:

PHP Code:
<?php

$Date 
date("Y-m-d");

$Yesterday date('Y-m-d'strtotime($Date' - 1 days'));

?>

<html>
<body>

<h1>The Time is:</h1> <p><?php echo $Yesterday?></p>

Sir, like i said. I am using file locker, hence not able to change any of that. Only got 2 boxes to write in. 1 CSS and another for Html codes
</body>
</html> 

Also make sure your index file is a .php not .html...
If it must be an .html take a look at this work around: /questions/11312316/how-do-i-add-php-code-file-to-html-html-files

To Your Success,

~MoneyCashers
I am using cpagrip locker, hence i have 2 boxes to write code within, 1 for html and another for css. Nothing about index or anything

You are limiting your options then quite a bit.

PS. Just got your PM and added you.

~MoneyCashers
yeah i figured some more things out, maybe you can help now.. waiting for you to reply on skype ^^

A Career in Digital Marketing with CPA, Thats sounds like LIFE!
Reply


Related Threads
Thread Author Replies Views Last Post
  Urgent! I need (...) chr0sy 1 125 2019-04-14, 10:18 PM
Last Post: CharlieHarper
  Adult Traffic From Trafficjunky - Help ptcclicker27 2 202 2019-03-23, 05:21 AM
Last Post: ptcclicker27
  Need Smartlink CPI Networks tradesol 1 109 2019-03-21, 01:26 PM
Last Post: Elites_Mate
  Need this (...) FRENCHINDAHOOD 1 133 2019-03-19, 06:05 AM
Last Post: CharlieHarper
  I need a bing ads coupon for old account hunlion 7 1,433 2019-03-18, 04:10 PM
Last Post: muvikaonline





About Us | Contact Us | CPA Elites | Advertise | Stats

Copyright © 2013 - 2019 by (company to be announced later)
Enhanced by MyBB
Return to top