Jump to content

kevin7

Members
  • Posts

    39
  • Joined

  • Last visited

    Never

Everything posted by kevin7

  1. or, you can use session variable to store you data... there are plenty of ways! : )
  2. i hv tried the include_path, it displays .;c:\php5\pear\ but my php5 folder is in c:\appserv\php5 how do i change it.. and nope, there isnt a file called DB.php in Pear folder C:\appserv\php5\pear\ c:\php5\pear doesnt exist by the way.
  3. yes, you can do that... i don't have the time to write the code, but i can show you some guides... the following show you how to retrieve checkbox value and print it out. http://www.kirupa.com/web/php_contact_form3.htm the follwoing show you how to read and write into file http://www.gfx-depot.com/forum/-tutorial-index-t-1040.html so, basically, what you can do is, get the value, and modify the value into something like this 0#0#1#0 <--- 0=unchecked, 1=checked, #= separator (can be anything, empty space for example) so, you write that string to the file. if you wanna load the checkboxes' setting, just read from the file and explode it $chkbox = explode("#",$string); $string is the value you read from the file. so, you will able to set the value of the checkbox using if else statment or for loop... hope it will help...
  4. where can i find the include_path? when i start install the pear, it asked me to install it either system or local, i choose system..
  5. <h3>2008</h3> <?php $query = "SELECT id, title, date_format(date,'%M %d, %Y') as date, date_format(date, '%Y') as year FROM pr WHERE del='N' and post='Y' ORDER BY id DESC"; $result = prod_query($query); while ($row = mysql_fetch_array($result)){ if ($row['year'] == '2008') { echo "<p><strong><a href=\"/news/press_releases/full.php?id=$row[id]\">$row[date]</a></strong>: $row[title]</p>"; } else { echo ''; } } ?> this is how i will do it if i were you, it might not the most efficient way, i believe you can enhance it from the sql query. this is what i would do, it's just a pseudocode, not real php.. : ) but i believe it will make sense.. $query="select distinct(year) from pr group by year order by year" // select all the year while ($row=mysql_fetch_array(mysql_query($query)) { $query2 = "SELECT id, title, date_format(date,'%M %d, %Y') as date, date_format(date, '%Y') as year FROM pr WHERE del='N' and post='Y' and year=".$row['year']." ORDER BY id DESC"; $result = prod_query($query2); while ($rowdata = mysql_fetch_array($result)){ echo "<p><strong><a href=\"/news/press_releases/full.php?id=$row[id]\">$row[date]</a></strong>: $row[title]</p>"; } } i dont think the code is error free, but basically the idea it there, first loop, find all the years, and second loop find all the data to the corresponding year. As a result, you don't have to use if else statment to group all the data in a spicific year. hope this'd help..
  6. you can create a hidden form type and set the value to the $_POST variables, so if the user clicked on submit button, it will pass the data to the next page. or, the urgly way, put your data as a parameter in the url e.g, formhandler.php?name=kevin&age=17...... cheers
  7. hey, I have installed it from appserv/php5/go-pear so, i try it out with the DB.php, but it displays message "no such file". did i overlook something important during the installation? do i need to install db.php from internet? if so, how can i do that?\ thanks!
  8. i'm a php developer because of the requirement of current trend (some clients request thier website to be hosted on a windows machine with asp.net). I'm confused about asp classic, asp 3.0 and asp.NET and asp 2.0 perhaps.. what's the difference? asp.NET is the current trend? Thanks!
  9. oops... i've fixed it... my stupid mistake... thanks for the time!
  10. SELECT * FROM buyer WHERE state='d' AND (curdate()-date>40) ORDER BY id DESC" I'm making a query, so that it will return all the records less than 40days, but, im not so familiar with MySQL, my query returned error message. my table structure is id, name, phone, email, description, state, date my date format is (YYYY-MM-DD, eg 2007-12-15) can anyone tell me what's wrong with my query? Thanks!
  11. Im not sure if this is the right place for this. anyway, I'm having a problem on creating an external link so that when I click on the link, a specific tab will display. I have been digging deep to the rico's forum, and i found some articles, but it's for rico 1.1... so, anyone here using rico 2.0 and able to solve my problem? thanks in advance!
  12. hmmm, let say if i have the following array data im building a shopping cart, and im having the following problem. the array in the bottom is the way i store customer's product and quantity. For example, refer to below, product 3's quantity is 2. $item['product1'] = 1; $item['product2'] = 4; $item['product3'] = 2; $item['product4'] = 1; the problem im having is, how am i suppose to display the product? is it any function to list out the array index? i tried print_r, it did list out, but, it isnt the thing i want... i want an output like the following so that i can use the product id to retrieve the product information from database... product1 : 1 product2 : 4 product3 : 2 product4 : 1 thank a lot!
  13. <? $to = 'xxx@gmail.com'; $subject = 'Testing of email'; $message = '<b>yo</b>, whassup?'; $headers = "From: someone@gmail.com\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n"; // Send if (mail($to, $subject, $message, $headers)) { echo "Mail Sent"; } else { echo "Mail Failed"; } ?> I'm creating a script that will allow client to send mail to another client using a form with php mail() function... I have uploaded this script to the server, and i'm able to send a mail back to the server email address, and then, i tried to send mail to my gmail account, i received nothing, i tried and tried, and use the code provided in php.net/mail still no clue... i hv totally ran out of ideas and im here to seek for help... can anyone tell me what's wrong with my code, or perhaps... can you show me the code that will able to send to other mail services such as yahoo, gmail, hotmail and so on... and, i hv looked at the spam section of gmail, nothing was found.. thanks!
×
×
  • 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.