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
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. :)

[Image: banner3.jpg]
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. :)

[Image: banner3.jpg]
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. :)

[Image: banner3.jpg]
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


Possibly Related Threads...
Thread Author Replies Views Last Post
  Coding Help Needed Qoins 4 285 2017-04-27, 02:14 PM
Last Post: dbiz
  Help with little Coding Qoins 1 178 2017-04-25, 06:04 PM
Last Post: rinkidi
  CPAGrip MediaFire Locker Help! Basic Coding Skills f1rew1re 3 380 2017-02-05, 11:27 PM
Last Post: f1rew1re
  OGads Content Locking coding (Help) n3kr0 6 2,752 2016-12-12, 07:47 AM
Last Post: OGAds
  Need very Minor help with coding. [CPAGrip] Qoins 4 708 2016-06-07, 09:31 AM
Last Post: Qoins




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

© 2013-2017 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top