Jump to content

jguy

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Everything posted by jguy

  1. You can use "nslookup": Here's an example: exec("nslookup -type=A " . $reverse_ip . "." . $dnsbl_list . ".", $lookup);
  2. Sure can...however you will need to create the "front page" with a little php magic. After that, have seperate stores link off there. Are you doing the store yourself? OR if you're linking to other sites...that link I provided you is OVERKILL. Be a little more elaborate....
  3. Not sure how to easily do this in php, BUT if your .php scripts run on a Linux/*nix machine (I see it's windows based in the code -- however, don't know if windows cmd line can perform the following), you can use *nix's grep -A NUM syntax from the exec() function. the -A NUM tells grep to display (or pipe) all of the text after a certain line. There is a windows version of grep, http://www.wingrep.com/download.htm. With that installed you can prepare the file before trying to read it into php with AT/CRON jobs and then do your thing in php. Now, if you solely want to use php, then you're going to have to store the file into an array of some sorts (maybe) and then parse out only the data you need. Maybe something I've provided will help, maybe not... ;-) ps: the exec() function can be ref'd here: http://us2.php.net/function.exec
  4. $data = mysql_fetch_array($result); isn't going to work. All you'll get is "resourceID#1 or something..... You'll need to iterate through your $data array to get the row value for your chart. i.e.: while ($row = mysql_fetch_array($data)){ $data = row[0]; } Then: $graph->setData($data); Might work....haven't used this class b4, so it's just a guess.
  5. I use this one all of the time. Works Great! http://www.oscommerce.com/
  6. The php.ini file itself is a great place! Nicely commented.
  7. First, I would check upload_max_filesize in my php.ini file. Here's a good link: http://www.radinks.com/upload/config.php
  8. to make things really sweet and simple as possible, if you are using MySQL, you can use phpMyAdmin to do this with a CSV really easily.
  9. do a foreach loop to build the list
  10. YES!!!!!!!!!!! something like: $sql = "CREATE TABLE mytable( partno CHAR(10) NOT NULL, descript CHAR(60) NOT NULL, cost DOUBLE(10,5) NOT NULL, user CHAR(15) NOT NULL, modelno CHAR(20) NOT NULL, PRIMARY KEY(partno))"; $result = MYSQL_QUERY($sql) or die ("Invalid create");
  11. Make 100% sure that you have no HTML tags above this code: (In other words): <HTML><HEAD></HEAD> <BODY> <?PHP $User = $_POST["Username"]; $Password = $_POST["Password"]; $sql = "Select * FROM `Account` WHERE `Username` = '$User' AND `Password` = '$Password'"; if (mysql_num_rows($result) >"0") { header("location: http://www.Yahoo.com"); echo 'Login Details accepted, you are now being forwarded to the main page...'; } if (mysql_num_rows($result) =="0") { echo 'You are now being forwarded to somewhere else; header("location: http://www.bbc.co.uk"); } ?> </BODY> </HTML> Any HTML tags before this will cause the header to function improperly.
  12. Maybe I understand your question, not 100% sure though, but here's a try. I think powerpoint has a built in function that will allow you to create a presentation and export it to a web site (HTML or Flash). I have some things to say about this, though. Unfortunately, M$ did a terrible job with the export (IMHO) function within powerpoint. The resulting pages are almost completely incompatible with all web browsers except for Microsoft's Internet Explorer. There is also another option. Opensource OpenOffice is a free office system comparable to M$ Office. Open Office can also edit/export your M$ office docs as well! Now, the good news is, OO can convert them to REAL, cross-browser compatible HTML pages and Flash. Again, I'm not sure if this is what you're asking, but maybe it'll help.
  13. Dude, There's a file in there, README that will tell you what to do. Also there is some nice docs on the web site as well. Simply put, you untar/unzip it in your web dir and go from there.
  14. I agree with tauchai83. I actually develop the session user checks in a separate file outside of my web root or in some include directory that contains the code that checks if a user is logged in. I usually call the file "sescheck.php". When a start new pages, I just include it in the beginning of the php file. Something like this(sescheck.php): <?php //Start User Session session_start(); /* Check for valid session user */ if(empty($_SESSION['user_name'])) { echo $ER_LOGINMSG; exit; } $ER_LOGINMSG = "<html><head><title>Login Error</title>"; $ER_LOGINMSG .= "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">"; $ER_LOGINMSG .= "<link href=\"../styles.css\" rel=\"stylesheet\" type=\"text/css\"></head>"; $ER_LOGINMSG .= "<body><br /><br /><br /><div class=\"centered\"> <table class=\"centered-table\"><tr><td> <div class=\"er_back\"><div class=\"er_section\"> <p class=\"er_login\">Login Error:</p> An error has ocurred. It may be that you have not logged in,<br />or that your session has expired. Please try <a href=\"../login.php\">logging in</a> again or<br /> contact the <a href=\"mailto:me@somewhere.com\"> system administrator</a></div></div></div></td> </tr></table></body></html>"; ?> Then in the file itself, I do something like this: <?php //include session check include ('includes/sescheck.php'); //do your stuff below here ?>
  15. Check out this cool php class....I use it all the time: FPDF: http://www.fpdf.org/ Very, very easy to use.... based on XY cord system and "cells".
  16. If you're using Linux, you can always use the system() or exec() function to run the uuencode command: ie will list a dir: echo exec('ls'); I used something like this once: exec("uuencode -m $inFileLocation nothing_out",$returnArray);
  17. jguy

    timed access

    That souldn't be a hard problem at all. Here's how I would do it: 1. Create a MySQL db to hold your content (really don't know what your content is, is it word docs or what?) I wouldn't store pictures, word, pdf, or other large blob data types in the db if I could avoid it. 2. On the table that identifies your data, I would place a simple time stamp in it, maybe start_access time or something. In conjunction with this time, I would use a flag (maybe a integer 0 and 1). 0 meaning no access and 1 meaning access. You can use php to use the date function to test the entry date with the current date via cron job or something maybe at midnight daily. This cron job can turn all of the 1's off by updating the DB where the time has expired and the current flag is "1". You could also go a step further and create a text log or email report daily of who's removed (i.e. set to "0"). Again, this may not be the best way to do this, but I've created something similar and it works beautifully. The PHP should be simple enough to create. If you have access to Linux then the cron jobs would be easy as well. If you use windoze, then use the "AT" cmds to accomplish the same thing. Hope this can at least get you a start.
  18. I have noticed that some internet ISP's are killing my mail() function mail as well. Something to do with Spam filters that check header info maybe? I know that some of my mail will go to certain accounts and not to others. All I can think of is anti-spam filters. Anyone else having this behavior?
  19. Hello all.  I'm having trouble with a function that I'm trying to design.  The idea here is for the function to receive a SQL string, connect to the database, run the query, and return all data encapsulated within an HTML table.  I have a great deal of this function completed.  However, here's the problem that I'm having.  I wish to use this function site wide, so I'm creating a .inc file to include it on each page needing a dynamic table.  With this said, each table returned will have a different number of fields each time.  Within the function, I'm not sure how to properly display all of the field names as <th> and then iterate through the data in the <td> fields within this function.  Here's the code: [code] <?php /*   Function to receive strSQL statement and   return a HTML table. */ function fnSQLtoHTML($strSQL){ if (!$conn = odbc_connect('mydb','myuser','mypass')){   $sRetVal = "<b><font color=red>The Database Connection Failed.<br> Contact Your Systems Administrator:</font></b>"; }else{ if (!$rs = odbc_exec($conn, $strSQL)){   $sRetVal = "<b>Error in your SQL statement</b>";   $sRetVal .= "<br />".$strSQL; }else{ $sRetVal = "<table width=\"56%\" align=\"center\" border=\"1\" padding=\"5\" cellspacing=\"5\" bgcolor=\"#FFFFFF\">\n"; $sRetVal .= "<tr><th colspan=".odbc_num_fields($rs) .">"; $sRetVal .= odbc_field_name($rs,0)."</th></tr>"; $sRetVal .= "<tr>"; $i=0;   while ($i < odbc_num_fields($rs)){   $sRetVal .="<th>".odbc_field_name($rs,$i)."</th>";   $i++;   } $sRetVal .= "</tr>";   while ($line = odbc_fetch_row($rs)){   $sRetVal .= "\t<tr>\n";       foreach ($line as $col_value) {   $sRetVal .= "\t\t<td>$col_value</td>\n";   }   $sRetVal .= "\t</tr>\n";   } $sRetVal .= "</table>\n"; } } return ($sRetVal); } ?> [/code] What I'm getting right now is 1 field name in the <th> and a blank html table.  Can someone maybe point me in the right direction?  Many thanks in advance!
×
×
  • 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.