Jump to content

prodynetech

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

prodynetech's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. You need to call set_save_path( $path ) before you call session_start( ).
  2. You could use regular expressions. [code] function isValidInput( $str ) {     // Test for a zero, null, or empty string     if( !ereg( "^[a-zA-Z]$", $str ) || empty( $str ) || ! isset( $str ) || ( $str < 1 ) )         return false;     } [/code] Now you can get creative and check for ranges or specific patterns. For example postal codes: [code] $pcode=str_replace(" ","",$in_post_code); if (!ereg('^[a-zA-Z]{1,2}[0-9]{1,2}[a-zA-Z]{0,1}[0-9]{1}[a-zA-Z]{2}$', $pcode)) {    return false; } [/code] Check out www.php.net for additional information on php functions that might be helpful to you. Regards, ProdyneTech [!--quoteo(post=371765:date=May 6 2006, 12:48 AM:name=artemisbow)--][div class=\'quotetop\']QUOTE(artemisbow @ May 6 2006, 12:48 AM) [snapback]371765[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hi, I'm using the following code to check that the form has been filled up completely [code]if((!value1) || (!value2)... || (!valueX)){   echo "Some fields have not been filled in";   } [/code] However, when a user enters '0', I want the script to know that it is not empty, but neither the above method nor using empty() works. What should I do instead? Thanks! [/quote]
  3. I am unfamilliar with PHP->MS Access database solutions, but I am able to show you how to access, store, and read from MySQL, PostgreSQL, MSSQL databases using php. First thing you need to do is create a connection to the database: MYSQL: $link = @mysql_connect( DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD ) ; MSSQL: $link = @mssql_connect( DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD ) ; POSTGRESQL: $link = pg_connect( "host=".DB_SERVER." port=".DB_SERVER_PORT." dbname=".DB_NAME." user=".DB_SERVER_USERNAME." password=".DB_SERVER_PASSWORD ) ; Once you have a successful connection to the database, you can start giving SQL queries to it. For example: $sql = "SELECT * FROM uploaded_files WHERE filename='%abc%' ; $resource = mysql_query( $sql, $link ) ; $result_array = @mysql_fetch_array( $resource ) ; Now, to add a record to a database table you would use a query statement like: $sql = "INSERT INTO uploaded_files VALUES( NULL, '".$file_name."', '".file_size."', '".file_description."'" ; $resource = mysql_query( $sql, $link ) ; If you would like to update a record you would use: $sql = "UPDATE uploaded_files SET file_name='".$file_name."', file_size='".$file_size."', file_description='".$file_description."' WHERE file_id=5" ; $resource = mysql_query( $sql, $link ) ; There is a lot more to PHP/Database routines, so I suggest you read www.php.net and any other PHP/MySQL, PHP/MSSQL, or PHP/PostgreSQL resource you can find on the Internet (a google search does wonders). If you would rather go the MS Access route I apologize for be unable to assist you. Best Regards, ProdyneTech [!--quoteo(post=371391:date=May 4 2006, 06:41 PM:name=Jzzt)--][div class=\'quotetop\']QUOTE(Jzzt @ May 4 2006, 06:41 PM) [snapback]371391[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hi, first of all I'm dutch so if my english isn't perfect I apologize. Second of all I haven't got much experience with php so my question is probably (and hopefully) easy to answer. Now all I need to do is write the filename to a database. I would like to use a ms access database. Can anyone help me please?? Thnx a lot! Jzzt [/quote]
  4. The problem is not with your login scripts (as far as I can tell). The problem is either with DB.php or how you handle the sessions. From the warning you are getting I am assuming that you have created custom session handlers that store sessions in files. Your code is unable to open/create the session file (cache) because the file path is incorrect. If you are running on a windows system then the "/tmp" needs to be changed to "\tmp" or "C:\tmp". If you are running on a Linux box you need to change the session filename from "\sess_xxxxxxxxxxxxx" to "/sess_xxxxxxxxx". Very simple to do this. You just need to call session_save_path( $path ) ; where $path is the path to the temp dir (that must have read-write-execute priviledges) where the session file will be created. If you are still having problems let me know. I have some nifty session handling classes you can try out. Best Regards, ProdyneTech [!--quoteo(post=371481:date=May 5 2006, 05:43 AM:name=columbo1977)--][div class=\'quotetop\']QUOTE(columbo1977 @ May 5 2006, 05:43 AM) [snapback]371481[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hi I am new to this and I am trying to get a login PHP script right, when i run the site in my testing server and i goto the login page i get the following error : Warning: open(/tmp\sess_8624c9e01e8a8248449ffb495f6be885, O_RDWR) failed: No such file or directory (2) in c:\webserver\phpdev5\www\ccc_website\login.php on line 5 does anyone know why this is happening, as i want to get the login system working on the site. Sorry if this is a simple problem but i am new to this. Please see below for the code. Thanks Columbo1977 [/quote]
×
×
  • 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.