Jump to content

Philip

Staff Alumni
  • Posts

    4,665
  • Joined

  • Last visited

  • Days Won

    20

Everything posted by Philip

  1. But it's out in the open, not in a query or variable You need first connect to the database, then run a query on that. $res = mysql_connect($host, $user, $pass) or die(mysql_error()); mysql_select_db($db, $res) or die(mysql_error()); mysql_query("SELECT `page_id` AS s, `link` AS c, `vid_title`, `vid_desc`, `hidden` FROM `'.$opts['videos'].`", $res) or die(mysql_error());
  2. if(!($res = mysql_query("$host", "$user", "$pass") or die(mysql_error()); mysql_select_db("$db") or die(mysql_error()); 'SELECT `page_id` AS s, `link` AS c, `vid_title`, `vid_desc`, `hidden` FROM `'.$opts['videos'].` First of all you have a query where you probably meant connect. Secondly, why is the following there? 'SELECT `page_id` AS s, `link` AS c, `vid_title`, `vid_desc`, `hidden` FROM `'.$opts['videos'].`
  3. I'd image with the practically endless types of zipcodes, that would be impossible, not to mention some countries don't have postal codes. The best thing to do what have the end-user narrow it down to what country - then out of several zipcode databases, you'd pull it from one. Take a look at this page for more reasoning why it'd seem impossible: http://en.wikipedia.org/wiki/List_of_postal_codes
  4. http://www.phpfreaks.com/forums/index.php/topic,208965.0.html Has UK at the end of the post I believe.
  5. D'oh! this link is for corbin
  6. Yeah, I love SMF because of some of the features, but it can be hard to navigate. I joined the SMF Documentation team for a little while in hopes to maybe improve their documentation (almost none on how to create a mod or theme) but my interest didn't last very long.
  7. Agreed - I've probably learned more just by researching interesting problems and finding solutions to them than I have by reading or by someone trying to spoon feed me information. I freelance on the side, and this (as Maq said) helps keep me sharp. I don't really get bored on this site, there always an interesting question somewhere - even if it's not in the PHP Help section. Do I get fed up? It's rare, but yes. When the OP is stubborn and won't try anything but his way, I tend to get frustrated (as I do with my clients that do the same, although I don't show it around them ) As for steering - I try to do the same, will give them hints about what's wrong, or ask them "Do you see the difference between this and that?" But most of the time I have the code handy for when I feel they deserve it Oh - and I should ask, why do teachers become teachers? (At least here in the States it's not about the pay )
  8. <?php phpinfo(); ?> Will tell you everything you need to know about your PHP setup. Otherwise you can just call: <?php echo 'Current version is ',phpversion(); ?> Fread/fseek - again, I'm not sure about this one $fp = fopen($IP_file,"a+"); #works fine fseek($fp, 0);
  9. Missing semicolon, line above ($result = mysql_query($sql))
  10. if(!mysql_query($sql, $connect) should be if(!mysql_query($sql, $connect))
  11. SELECT id, title, stock, price FROM stock LEFT JOIN books ON stock.title_id = books.id ORDER BY title SELECT books.id as id, title, stock, price FROM stock LEFT JOIN books ON stock.title_id = books.id ORDER BY title
  12. Erm... You have <?php echo 'This is a test! '.$row['id'].' <-Did you see anything?; ?> Inside your echo statement should be: echo '<tr><td>'.$row['title'].'</td><td>'.$row['stock'].'</td><td>'.$row['price'].'</td><td>This is a test! '.$row['id'].'...
  13. There are a few things I noticed - not sure if any of them would be the cause. It's been a while since I've had to manipulate files in PHP/C... but 'a+' mode puts the pointer at the end of the file.
  14. Personally I almost always use absolute paths. Typically it will be something like: /home/username/www/blah/file.php If you're going to use it one level up, here's what I would do: define('PATH', str_replace('lettera','',dirname(__FILE__)).'includes/'); include PATH.'header.php'; Same thing as above, just broken down into manageable chunks: <?php // Get the current path $currentPath = dirname(__FILE__); // Strip out the top folder (if it exists) $strippedPath = str_replace('/lettera','',$currentPath); // And instead, add in the includes $includePath = $strippedPath.'/includes/'; // Now use the variable in your include include $includePath.'header.php'; ?>
  15. Technically, isn't the OP already doing that, and just needs to echo $i?
  16. You can't using just PHP Typically people use Flash to upload a file with a progress bar.
  17. I also do a similar setup, in reverse. Super admins get 255 Admins get 200 Mods 100 Normal users 1+ Banned 0 Then on permissions: if($user >= 100) // mod area if($user >= 200) // admin area
  18. Well, <?php $var = '$test'; echo $var; ?> Results with: What does it do/not do? - and a sample of your code would help
  19. Incorrect character set I'd imagine (never really had to worry about that myself) Use single quotes: echo '$15'; // echos $15
  20. It should be like this: main.php <?php session_start(); include somefile.php; echo 'hi'; ?> somefile.php <?php echo $_SESSION['name']; ?> Also, add error_reporting(E_ALL); at the very top of your script
  21. Do you have session_start(); at the very top of the page you're trying to use the session with?
  22. Change $sqlmembers = mysql_query($qry); to $sqlmembers = mysql_query($qry) or die(mysql_error());
×
×
  • 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.