Re: [PHP-DB] auto creation of email IDs

2009-12-18 Thread Vinay Kannan
Thanks a lot for all your replies, I appreciate the workarounds, all of them
are great, but my concern is to get the work done in this particular way,
does any one know how this can be done?

On Fri, Dec 18, 2009 at 2:11 PM, Karl DeSaulniers wrote:

> I would stamp it with their IP address + current time if they are just
> posting comments. Or user ID + current time if they are registered users
> leaving comments. This may be more of a workaround, but it will get you
> unique numbers.
>
> Karl
>
> Sent from losPhone
>
>
> On Dec 18, 2009, at 9:39 AM, Vinay Kannan  wrote:
>
> Hey Thanks Barry,
>>
>> Yeah, I want to be able to creat email accounts automatically, when people
>> get themselves registered on the website, this should be done
>> automatically,
>> you are right about the temp email id, that would change and the email IDs
>> generated would be permanent, which would be deleted after couple of
>> months.
>>
>> So basically, what I am looking at is, a way to be able to create email
>> IDs
>> on a Linux server, when people post comments, how can this be done?
>>
>> Thanks,
>> Vinay Kannan.
>>
>> On Thu, Dec 17, 2009 at 4:38 PM, Barry Stear  wrote:
>>
>> When the users register are you wanting to create a email account for them
>>> on your server or are you wanting to use a email address that they
>>> already
>>> have?
>>>
>>> It is possible to create a temporary email id but I am not sure how you
>>> would be able to tie this back to the person so they would actually
>>> receive replies back to this topic if you have no information for them
>>> and
>>> they are just creating a topic. The best thing would be to require them
>>> to
>>> register in order to post a topic.
>>>
>>> Thats my thoughts on it...
>>>
>>>


Re: [PHP-DB] Random pick

2009-12-18 Thread Philip Thompson
On Dec 15, 2009, at 6:02 PM, David McGlone wrote:

> On Monday 14 December 2009 21:44:24 Chris wrote:
>> Chris wrote:
>>> David McGlone wrote:
 On Monday 14 December 2009 21:02:37 Chris wrote:
> David McGlone wrote:
>> Hi everyone,
>> 
>> I've been lurking in the shadows on the list for quite some time and
>> now
>> I'm in need of a little info or advise.
>> 
>> I'm looking for a way to grab a record out of a database on a
>> certain day
>> each month and I'm wondering if this can be accomplished with just a
>> mysql query or would I need to use PHP also?
> 
> A mysql query would do it but you'd use something to talk to mysql and
> process the results (whether it's php, perl, python, ruby etc depends
> on your other requirements).
 
 What I'm trying to do is to have a record picked from the database at
 random on the 1st of every month and display it on the page. Here is
 some code I have been working with:
 
 $query = "SELECT DATEADD(mm, DATEDIFF(mm,0,getdate()), 0)";
 $result = @mysql_query($query);
 if (!$result){
 
 $query = "SELECT * FROM monthlyPooch ORDER BY RAND() LIMIT 1";
 $result = @mysql_query($query);
 
 while ($row = mysql_fetch_array($result)){
 echo "$row[poochName] ";
 echo "$row[Birthdate]";
 
 }
 }
>>> 
>>> You can check the day of the month in php then do your other query:
>>> 
>>> $today = date('j');
>> 
>> See http://php.net/date for date formats and what they return.
>> 
>>> if ($today !== 1) {
>>>  echo "Today isn't the first. No need to continue.\n";
>>>  exit;
>>> }
>>> ..
>>> random query etc here.
>> 
> 
> Hmmm. This isn't exactly what I'm looking for. What I'm trying to do is get a 
> new picture on the 1st of every month and display it for that whole month.

Could you not just create a mysql table that contains the month and a url to a 
file?



And then in your HTML:



I just wrote that code here in the email, but it should get you going in the 
right direction. Hope that helps!

~Philip
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] auto creation of email IDs

2009-12-18 Thread Vinay Kannan
Hey Thanks Barry,

Yeah, I want to be able to creat email accounts automatically, when people
get themselves registered on the website, this should be done automatically,
you are right about the temp email id, that would change and the email IDs
generated would be permanent, which would be deleted after couple of months.

So basically, what I am looking at is, a way to be able to create email IDs
on a Linux server, when people post comments, how can this be done?

Thanks,
Vinay Kannan.

On Thu, Dec 17, 2009 at 4:38 PM, Barry Stear  wrote:

> When the users register are you wanting to create a email account for them
> on your server or are you wanting to use a email address that they already
> have?
>
> It is possible to create a temporary email id but I am not sure how you
> would be able to tie this back to the person so they would actually
> receive replies back to this topic if you have no information for them and
> they are just creating a topic. The best thing would be to require them to
> register in order to post a topic.
>
> Thats my thoughts on it...
>