Jump to content

mlin

Members
  • Posts

    91
  • Joined

  • Last visited

Everything posted by mlin

  1. Hello all, I've configured and installed apc against php 5.2 That's all up and running no problem, but when I add apc.rfc1867 = on to my php.ini file, it never appears in phpinfo, or apc.php Any ideas on what I could be missing?
  2. you can use javascript, or better yet, you can do all your validation before anything is output to the browser, and use: header("Location: new_uri");
  3. Well you can always get the 1st letter of a string just like you'd get the 1st element of an array: $a = "string"; echo $a[0]; that would output s but to search for all records that start with a particular letter you could use a like in your query: select * from table_name where column like 'a%' that should get all the records from column that start with a
  4. form elements can be styled using css to look any way you'd like, such as: <input type='text' name='user_input' style='background-color: #cccccc; border: 1px solid black; padding: 2px; font-weight: bold;' /> Is that what you mean? asp and php are both server side, and don't really have anything to do with the way your page looks
  5. About connecting to access. Is it even neccessary? Access can export csv files, and you could work with them from there
  6. Ok, you'll have to base your query off of the user input. Your first query to show all the results in your table show's all ages. Add another query to create your drop-down menu such as: $q = mysql_query("select distinct age from table_name"); that'll give you 7,8, and 9 only once. then, when a user submits their age selection, base your new query from that lika so: [code] if (isset($_GET['age'])) {   $age = (int)$_GET['age'];   $query = msyql_query("select * from table_name where age='$age'"); }[/code] Then you can loop through your results as normal
  7. The ajax isn't the hard part. Joshua Eichorn's example (the one you linked) uses his HTML_AJAX pear package and all the js is right there for you. No need to touch it at all, just handle your file once $_POST or $_FILES gets set as normal. Same goes for Rasmus' example using yui library (looks pretty but doesn't work in ie6, so buyer beware) The tough part is that you'll have to: run php 5.2 with APC (alternative php cache) patch your php installation with pdoru's patch or use a perl script =( The best option to me looked like running php 5.2 w/ APC which I'm currently on now. But I'm having trouble connecting to the hooks still. You can check out how I tried to get it running at [url=http://linardy.com/blog.php?post=8]http://linardy.com/blog.php?post=8[/url] And, don't be scared of ajax, just head over to ajaxfreaks.com when you've got some time to kill, and you'll be asynchronously calling your php scripts in no time at all. Probably learn a few dom tricks too ;)
  8. $file = "/images/clubs/logos/$name.jpg";
  9. Here's BillyBob's example with a loop to get all tables [code]<?php $con = mysql_connect("localhost", "username", "password"); mysql_select_db("development"); $doc_root = "/path/to/root/"; $backup_dir = $doc_root . "backup/"; //select all tables $q = mysql_query("show tables"); if (mysql_num_rows($q) > 0) { for ($i = 0; $i < mysql_num_rows($q); $i++) { $tmp = mysql_fetch_assoc($q); //var_dump($tmp); $tables[] = $tmp['Tables_in_development']; } } //var_dump($tables); for ($i = 0; $i < count($tables); $i++) { $backup_file = $backup_dir . $tables[$i] . ".sql"; if (file_exists($backup_file)) unlink($backup_file); //delete the current backup if it already exists else the query will fail $query = "SELECT * INTO OUTFILE '$backup_file' FROM {$tables[$i]}"; $r = mysql_query($query); if ($r == false) echo $tables[$i] . " table could not be exported\n"; } ?>[/code] And for restore, loop through your backup directory and use BillyBob's query for each file
  10. Hello all you phpfreaks I've created a personal portfolio / blog. I've been fairly inactive in the php community but am trying to get back in the game. This is my favorite community thusfar so I'm looking for your opinions 1st. [a href=\"http://linardy.com\" target=\"_blank\"]www.linardy.com[/a]
  11. if your using mysql, escape using mysql_real_escape_string
  12. Insert the from address directly into the headers [code]$headers = "From: You <you@yourdomain.com>\r\n"; $headers .= //any additional headers $subject = 'email subject'; $message = 'email message'; mail($to_email_address, $subject, $message, $headers); [/code] I don't like mailing items right away when the user submits data, but rather insert it into a temp db table, and use cron to call a separate script every min checking for new messages. Takes the performance issues of mail() away from the user at least.
  13. cool, glad your getting there... some feeds dont offer descriptions, most do though. Just incase the feed doesn't have a description, you could test for it with a line like: $desc = isset($item['description']) ? $item['description'] : ""; so if there is a description available, it'll be used, otherwise prints nothing. Like i said, I just started playing with syndications yesterday, and I found magpie tutorials all over the internet, even in a book i had around the house. I like it so far, but the comment about using a script to grab all the headlines and database them via cron sound's very interesting. Solves bandwidth issues altogether, however, it kills the functionality of being able the get the news the minute it's posted. Anyway, just my thoughts
  14. magpie is excellent, just started playing with it yesterday myself: http://magpierss.sourceforge.net/ So you dont have to read too much, I'll give you a quick rundown. place rss_fetch.inc, rss_parse.inc, rss_cache.inc, rss_utils.inc, and the extlib folder into your include dir. include rss_fetch.inc in your script: require_once("include/rss_fetch.inc"); set ur url: $url = "http://somesite.com/news.rss"; create rss object: $rss = fetch_rss($url); echo "<pre>"; print_r['$rss']; echo "</pre>"; that'll show you how the items get stored in the rss object. You can loop thru and display them any way you want. hope this helps
×
×
  • 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.