Jump to content

pwnuspoints

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

pwnuspoints's Achievements

Member

Member (2/5)

0

Reputation

  1. Hello phpfreaks! As always any help is appreciated! I am currently using an installation of Easy PHP Calendar <http://www.easyphpcalendar.com/> on my website to keep track of important dates and events. As one might imagine Easy PHP Calendar makes use of PHP/SQL functionality to store important dates in a database on my server. When I use the Easy PHP Calendar web interface to add an event it stores the information I input into a table called 'epc_calendar'. This table is actually pretty straight forward; it's column headers are as follows: id, startDate, endDate, startTime, endTime, eventType, repeatx, title, descr, days, stop, month, weekDay, weekNumber, category, eventKey. The only columns from 'epc_calendar' I need to be concerned with are startDate and category. The startDate column stores the start date of each event as a Julian Day Number [e.g. "12/10/2009" = " 2455176"]. The category column stores a VARCHAR numbered string which associates a highlight color to each event when displayed [e.g. "0[2X" = "Blue"]. Okay, so here's the challenge. I want to display a list of four or five of the most recent upcoming events using this database. To accomplish this I need to write an SQL query which is aware of the current date in Julian Day format and searches for any events from the current day on. I also need to further define the query by only showing items of a certain category. Did you get all that? Because my head is spinning. Summed up.. I need to select a range of dates stored in my database in Julian Day format. Thanks in advance for any help you offer!
  2. Hello phpfreaks, I'm wondering if anyone knows a simple way to display next months full written name [e.g. January] using a simple date() function? Basically- when it's "December" I want the date to read "January"; when it's "January" I want "February" and so on. Anybody know where I should start looking?
  3. I figured it out on my own. Using Heidi SQL I exported the data as a CVS document. Then I used Microsoft Excel 2007 to import the CVS document.. in excel it is rather a simple task to duplicate a column. Then, using find and replace I replaced "@domain.com" with an empty string. However to maintain the integrity of the e-mail column I could not use the "replace all" button. I had to click replace 800 times.. but hey, better than spending 8 hours re-typing that mess. Anyway~ thought I'd put that out there in case it helps anyone else. OH YEAH - I guess I exported the data back out as a cvs.. then imported it back into Heidi SQL on my server. Lickety-split. How do you like that?
  4. Alllllright. Looks like have some code to give you. first, put on "Little Acorns" by the White Strips- even if you don't like them, it will help. Next, look at my code. This is how I process my login. The login form passes the variables to this code in a php document I've called login-exec.php There is a lot going on in that code. Essentially I've processed the log-in and set a Session variable. This means as long as the person is logged in you will be able to interact with that variable on the subsequent pages. I'm not gonna go into too much detail here. You'll have to do some googling to figure out any terms you don't understand. Now that we have set a session variable we need to include it and authorization on any page you wish to make reference to it. Make a file called auth.php and in it put the following code (modified to suit your needs). Then you need to use require_once on any pages you wish to be secure and make reference to the e-mail. Put the following code at the top of the page you want the error message to appear on. If you are not logged in this requre_once code will redirect you to access-denied.php or show you a blank page... so until you have the login working properly.. this may cause issues. Finally the code to generate the error message will look something like this: The string "No Email On File" is kinda clunky and might cause issues here. I'm not prepared to test it for you. the bolded area is where you will echo your error message. You should know, this code won't work unless you modify it to suit your needs. Stare at it long enough.. and you're bound to figure it out. That's the best I can do. Hope it Helps.
  5. does this mean I have to modify those cells line by line? because if it does.. I'm friggin' quitting my job... No, probably not-- but I'll complain a lot.
  6. This is simple to do- but difficult to explain.. and your implementation of the code depends entirely on your comfort level with php. Obviously the error message can only be displayed after logging in to determine if the user has or does not have an e-mail. So, you'll have to grab the users e-mail address when they log in and pass it as a $variable to the first page they see after logging in. Then you'll need to write an if/else statement on that page to determine one way or the other if they have an e-mail address. the concept is: If this users e-mail has an "@" symbol- or "@domain.com" then display nothing. Else, display the following alert message. Which you will have to code and customize using echo strings, html, and css. I have to run for an hour. I'll leave you with that for now-- and if the topic still isn't solved when I get back I'll write you some code to work from.
  7. Hey phpfreaks, I have a special offer for you- just send 50 payments of $5.99 to --- lol.. just kidding. I appreciate any help you can give me on this topic. Let me explain the scenario. I maintain a table used as a staff directory for my website. It lists things like first name, last name, e-mail, phone numbers and so on. I am attempting to transition this table from being a static archive to the table I use to store username and password information for each employee. In this way I will end up with two separate tables without having to re-enter duplicate data manually or distort the original table. With me so far? My concern centers around the e-mail address column. For sake of simplicity I would like to use the first part of every e-mail address as usernames. I will also create a column containing a universal password (which can be changed after logging in). So I've got a column with e-mail addresses listed as strings "owinfrey@domain.com". Using HeidiSQL I know I can duplicate the entire e-mail column. From there my next instinct would be to find and replace all "@domain.com" with an empty string "". That way I would have one column still listing their e-mail addresses and another listing their log-in username. I realize there are several ways to approach this.. I could probably make a php processing script to do the work.. or I could just leave the e-mail column as is and use a trim function on log-in to verify the username. However.. for the sake of my own sanity and work-flow. I'd like to end up with the two columns as detailed above. I'm using my best infomercial voice when I say: There's got to be a better way. *camera zoom* Any ideas? Thanks Ladies and Gents!
  8. I just tried htmlentities and it worked! Well that was easier than I was expecting. Thanks mikesta707! Just in case, here's the code:
  9. Hey phpfreaks, I have been in the process of making an RSS feed for a day now and I'm finally making some progress. As it turns out my troubles have something to do with removing the html tags from my description. I've been working with tutorial after tutorial which all claim to work. However, when I modify any tutorial code for myself the feed goes blank. I started from scratch too many times to mention. So finally I decided to give up on tutorials and try coding for myself. The code below is what I've come up with. If you ignore the fact that It has no description, everything works fine. Whever I add a description to the above code -- the feed goes blank. My "description" comes from the "body" column of my table. The body column stores rich text as html. I need to strip the html from '$body' before using it in the xml item description. However, every attempt I've made at stripping the html makes the whole thing stop working. Here's what my recent attempt looks like: I have two seperate questions: 1) What can am I doing wrong? 2) Is there anything wrong with the way I've decided to code this RSS feed? Would you safely use this code? If not, why? Any help is sincerely appriciated, thank you! -B.
  10. Thanks, Actually I think you've told me this before- when I was here with a different problem. Ugh, I give up. I just want a step by step by step shamelessly-hand-holding tutorial on how to create an dynamic RSS feed from an existing database table. Please, won't someone point me to an informative guide? Google has been unhelpful.
  11. The code below is saved on my server in a directory named 'feed' with the filename 'index.php' Naturally, I've removed my actual database name and password from the code below... But even with the code below. The only thing that ever seems to show is the channel info- It's almost as if it's not connecting to my database. I've tried modifying this code and other code to match other database connections I've coded and tested... but still no luck.
  12. No, it doesn't -- So, I'll change it to Varchar. Then I guess my question becomes. How do I pull a varchar date from the database and re-format it using date() ?
  13. Hey there phpfreaks, As always yor help is appriciated, Thanks in advance! I'm working on creating a dynamic RSS feed using php/sql. The rss tutorial I've been referencing requires that I store dates in my database in RFC 2822 format or date("r"). However, when I try to upload a date in RFC 2822 format I get an error. My date column is set as 'date' type, so why isn't this working? More importantly, does anyone have a better tutorial for me on how to get a dynamic php RSS feed going? I've been working at this for eight hours. I'm familliar with xml and php - enough to know that this should be way easier. Every tutorial I've tried just doesn't work. Thanks again!
  14. I'm already getting a better idea of how to handle dates, thanks everyone. As far as I gather, MYSQL understands dates written in 'YYYY-MM-DD' format. So, if i used the php date() function to write the date in that format it would look like this: date("Y-m-d"); Then I would be free to write that to my database normally and both PHP and MYSQL would 'understand' it?! right? right. I have a follow-up question-- When I create the 'date' column in my database table can it be set as VARCHAR? Or should it be set as something else?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.