start date insertion for pHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

listguy
Forum Newbie
Posts: 12
Joined: Sun Jul 01, 2007 5:46 pm

start date insertion for pHP

Post by listguy »

Heh everyone,

I know very little about this stuff.

I have a question, is it possible to "change" the date on this code as needed.
It's a subscription form and needs a "start date" changed to match the actual calendar date, each time the form is filled out.

Here is the code snippet in question:

<input type="hidden" name="orderPage_transactionType" value="subscription">
<?php InsertSignature("0", "usd") ?>

<?php InsertSubscriptionSignature("20.00", "20070207", "monthly", "12", "true") ?>


<input type="hidden" name="billTo_firstName" value="John">

<input type="hidden" name="billTo_lastName" value="Doe">

<input type="hidden" name="billTo_email" value="jdoe@cybersource.com">

<input type="submit" name="submit" value="Next">
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Where are you storing this data? What do those Insert*() functions do?
listguy
Forum Newbie
Posts: 12
Joined: Sun Jul 01, 2007 5:46 pm

Post by listguy »

data is stored on a secure server
listguy
Forum Newbie
Posts: 12
Joined: Sun Jul 01, 2007 5:46 pm

Post by listguy »

This is a form for a subscription form.

Just wanted to see if the "date" could be updated in the code.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

listguy
Forum Newbie
Posts: 12
Joined: Sun Jul 01, 2007 5:46 pm

Post by listguy »

not sure how to change or modify this string to make that date change.

<?php InsertSubscriptionSignature("20.00", "20070207", "monthly", "12", "true") ?>

I saw the link you sent but still unsure how to do it.

I'm very newbie to the core.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Which is why I asked you where the data is stored and what those functions do. If we don't know what they do or how they work, we can't really help you.

"Stored on a secure server" means nothing.
listguy
Forum Newbie
Posts: 12
Joined: Sun Jul 01, 2007 5:46 pm

Post by listguy »

I guess what I'm asking is this

Is it possible to force an update date change, in this string of code.

<?php InsertSubscriptionSignature("20.00", "20070207", "monthly", "12", "true") ?>
listguy
Forum Newbie
Posts: 12
Joined: Sun Jul 01, 2007 5:46 pm

Post by listguy »

the data is stored at Cybersource.

The functions tell it :
how much the subscription costs
the date the order was placed
the length of time (months)
whether or not to renew after so many months (i.e. true,false)

Not sure if I'm communicating this properly
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Do you have the inner workings of this function?

If the second parameter is indeed the date, look at the link I gave you to the date() function's documentation and make the date.
listguy
Forum Newbie
Posts: 12
Joined: Sun Jul 01, 2007 5:46 pm

Post by listguy »

Thats the problem.

I don't know how to do it.

Yes, the second parameter is the date.





I can compensate someone that can make it work. Reasonable Paypal compensation..
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

If you're too lazy to read, you're not going to get anywhere with PHP. The manual is the reason it's such a friendly language. The documentation describes everything you need in order to do this.

Code: Select all

date('Ymd')
listguy
Forum Newbie
Posts: 12
Joined: Sun Jul 01, 2007 5:46 pm

Post by listguy »

it's not a matter of being "lazy", it's a matter of doing something I know nothing about.
I know enough about HTML to get me into trouble and none about PHP.

I am not sure of what to do with that string of code to continue to make it work, but yet make the date change automatically.

I understand what you just sent, but i DO know that certain things have to be placed in strings of code in certain perticular ways.

And I do appreciate your time and effort to make me understand. I admire you coding guys.
listguy
Forum Newbie
Posts: 12
Joined: Sun Jul 01, 2007 5:46 pm

Post by listguy »

this is what it's calling for:

recurringSubscriptionInfo_startDate
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Once again, if you read the documentation, you'd know exactly what it is. And, regardless of what you say, it is a matter of laziness. It gives you a table of all of the character values, what they stand for, and what the result will be. All you'd even have to do is skim it to understand.

Y = year, 4 digits
m = month, 2 digits (leading zero)
d = day, 2 digits (leading zero)

So, date('Ymd') return todays date in YYYYMMDD format, which is the format used in the function.
Post Reply