Jump to content

jester626

Members
  • Posts

    39
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jester626's Achievements

Member

Member (2/5)

0

Reputation

  1. I've got a snippet of code that accesses an email account using the the imap function. In my class file I can use 'sender' => $headerArr->sender[0]->mailbox . "@" . $headerArr->sender[0]->host, and it gives me the senders email address. However when I try to use 'reply_to' => $headerArr->reply_to[0]->mailbox. "@" .$headers->reply_to[0]->host, it does not give me the reply to address (which can be different when receiving e-mails from groups, forums, etc). Any help would be appreciated. Jess
  2. I have a script I am trying to write that will pull a unix timestamp from a MySQL database. I have no problem pulling the data using a WHERE starttime > ### AND endtime < ### which is good if I want to manually input a start and end time. My problem begins when i want to just pull the data out and want to simply pull the data in a GROUP By format by day. This is going to be a real simple appointment type of script. where the database has the following fields. RecID, Lastname,Firstname,AppointmentDate. The output would be something like: April 15, 2010 Appt. Time | Last Name | First Name April 17, 2010 Appt. Time | Last Name | First Name and so on. Any help would be appreciated. Jester
  3. OK, I know this is simple, but for some reason my brain is just not working through this for some reason. I have been able to successfully do a record count from an entire table, however in the table I have several categories that I want to list individually, next to each category I want to have a list of links under that category. For example: Personal Development (15) Leadership (10) Human Resources (5) I have gotten to the point of displaying each category by using the GROUP BY function ( SELECT * FROM TBL_ResourceLinks GROUP BY LinkCategory ) I have been trying to use the Sum function but I feel that is not the way to go. Can someone please help me get past this major brain cramp? Thanks,
  4. Solved it, Here is what I came up with $n = 12345 echo $english_format_number = number_format($n); This will display 12,345 Hope this is of some help to others
  5. That code adds decimal points not the commas. Thanks
  6. When running a total number of records in a database the results display as "4567" how would I tell the script to add a comma for thousands, millions, etc (ie. 4,567 or 1,234,567) Thanks
  7. I have a couple of questions regarding forms processing. I have a form that retrieves an e-mail address from my MySQL database. it is a simple form that has a text box for the subject field and a textarea for the message body. Here is where one of my issues arises. When I type a message and I hit the return key to start a new paragraph it all looks OK in the textarea box, however when I send the e-mail it appears as one single line on the recipient's mail client. how can I process the e-mail to send as it appears (to include the carriage returns) when entered. I have played with using the <BR> tag but that is cumbersome and I'm sure it may pose a problem on systems that display e-mails as text only. Secondly, I am wanting to include a URL (http://www.whatever.com) in the e-mail and make it so when it is displayed on the email client, the person can merely click on the link as opposed to having to copy and paste it in the browser. I know this is probably a very simple fix but I am at a lost. Thank in advance Jester
  8. You could simply save the file as .txt or .phps and that will display the source code in the browser then the viewer could simply use the "save as" feature of the browser.
  9. I have a DB where some fields are of the FLOAT nature. The Data that gets put into these field are 1.000, 1.500.1.250 etc. When I go to display them on PHP page I want to be able to drop any trailing zeros. Can anyone give me some insight on how to do this? Thanks, Jester
  10. Do you have shell access to your webhost? Meaning can you access it through a terminal window (such as putty)? If you can access your host via a terminal window then you can try and see if it will let you do a "cron -e" This may or may not work depending how your hosting provider has configured the domains. I would suggest you contacting them and asking them if it is possible. Hope this helps, Jester
  11. What did you use as the first line of your php file? Did you use #!/usr/local/bin/php -q ? Thanks
  12. I am trying to run a PHP Script in a crontab. I have added: #!/usr/local/bin/php -q at the top of the php page/script. I have also set up the crontab as follows: 00 40 * * * /var/www/the/rest/of/the/path/file.php This should run the script everyday at 00:40. But to no avail. I am using PHP 5.1.6 Any help would be appreciated Jester
  13. I have solved my own problem, I don't know exactly know how I did it, but this is what I came up with. If anyone would like to comment and explain what is actually happening here, I am sure we all would appreciate an explanation. foreach ($YourResults->SALES as $SALES) { // Use this section to insert into the machinesales info table print("<B>"); printf("ReadDate: %s\n", $SALES->ReadDate); print("</B>"); print ("<BR>"); // use this section to insert into columnsales info table foreach ($SALES->Items->Item as $Item) { printf("Coil: %s\n", $Item->ColumnName); printf("Price: %s\n", $Item->Price); printf("Vends: %s\n", $Item->Vends); printf("Sales: %s\n", $Item->Sales); print ("<BR>"); } }
  14. I have made some progress using the following code: <?PHP $xml = simplexml_load_file("report3.xml"); //echo $xml->getName() . "<br />"; foreach($xml->SALES->Items->Item[0] as $child01) { echo $child01->getName() . ": " . $child01 . "<br />"; } ?> The problem is that this example only provide me with the very first ColumnName Record of the very first ReadDate: ColumnName: 1 Price: 1.2500 Vends: 0 Sales: 0 It is some progress but not much. Thanks for your help Jester
  15. I have tried something very similiar, but due to the way the XML file is formatted, I am having a problem stepping down through the data tags. xml example: <YourResults> <SALES> <IDN>1234567891234567</TDN> <ReadDate>10/24/2007 10:55:00 AM</ReadDate> <TotalVends>1</TotalVends> <TotalSales>1.2500</TotalSales> <CashIn>1.2500</CashIn> <CashOut>0</CashOut> <BoxCash>0.2500</BoxCash> <TubeCash>0</TubeCash> <BillsToStacker>1.0000</BillsToStacker> <Items> <Item> <ColumnName>1</ColumnName> <Price>1.2500</Price> <Vends>0</Vends> <Sales>0</Sales> </Item> ..... ColumnName 2 through 9 in here .... <Item> <ColumnName>10</ColumnName> <Price>1.2500</Price> <Vends>0</Vends> <Sales>0</Sales> </Item> </Items> </SALES> </YourResults> The XML file could have multiple "ReadDate" meaning <SALES>....</SALES> could be displayed multiple times. I am trying to get the data into a MySQL database(which once I get the reporting part inplace I'll be able to perform the INSERT). The DB structure is as follows: [iDN][ReadDate][ColumnName][Price][Vends][sales] So using you example How do I get it to step through each ReadDate then through each ColumnName of Each Read Date? <CODE> $str = file_get_contents('report3.xml'); $xml = simplexml_load_string($str); echo $xml; foreach ($xml->SALES[0]->TDN as $a) { echo "TDN : {$a['TDN']}<br />"; echo "Title : $a->title <br /><br />" ; } </CODE> Thanks for any insight you can provide Jester
×
×
  • 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.