[PHP] php & javascript problem
Hello friends. I need to control the users viewing from one location so that when I change the URL string in a text file, the viewers page which has a timer automatically reads the URL on the text pages and goes to that page. Updating the textfile is ok. But below is the script onthe page which I want to reload every 10 seconds and display the name of the new page and go there. There are two problems, when the page reloads, the PHP script that gets the new URL from the text file does not seem to run. Can someone please tell me where I am wrong? Thanks very much. Denis "; Print""; Print ""; Print""; fclose($fo); ?>
[PHP] htaccess writable by httpd
is this a dangerous feature ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] more issues with variales within strings
At 04:55 23.03.2003, Dan Rossi said: [snip] >hi guys , i am sure this worked on an earlier version of php, > > >'NOT_ALLOWED_EXTENSION' => "Not Allowed File Extension, the following >filetypes are allowed : ($this->type)\n", this is inside an array > >then i used to do > >$this->extract_filetypes($this->imgtypes); >$this->error_codes[NOT_ALLOWED_EXTENSION]; > [snip] If you put $this->type in curly quotes it will work: $emsg = array('NOT_ALLOWED_EXTENSION' => "Not Allowed File Extension, the following filetypes are allowed : ({$this->type})\n", ); -- >O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] automatic newsletter
hi guys..i wanna make an automatic newsleter; meanings there is no page to force the newsletter to be sent..i wanna server to handle this any ideas??? - Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
RE: [PHP] automatic newsletter
cron job it , and execute the script using the command line php -Original Message- From: fr r [mailto:[EMAIL PROTECTED] Sent: Sunday, March 23, 2003 9:36 PM To: [EMAIL PROTECTED] Subject: [PHP] automatic newsletter hi guys..i wanna make an automatic newsleter; meanings there is no page to force the newsletter to be sent..i wanna server to handle this any ideas??? - Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Select DataBase Mysql Problem
Hi everyone, FIRST THANKX FOR ANY HELP !! and THANKX FOR READING :) I'm a reall newbie on PHP and i'm build a php app to connect into a mysql database.. but i cannot select the database i have build the database, and created a user with : create database mydatabase; use mydatabase; create tb_users ( userid varchar(20), userpassword varchar(20 ); grant select, update, insert, delete on mydatabase.* to [EMAIL PROTECTED] IDENTIFIED BY "mypassword"; then flush priveliges... I tested the user on mysql and it work correcly for my the pretended database NOTES: O.S. Linux Mysql : compiled the most recent stable 4.0.12 Php was compiled by SuSe on SuSe 8.0 Php is connected into mysql via socks (configured on /etc/php.ini) to test the set up i have used the php.net manual example to connect into the mysql database i manage to connect into mysql but i cannot select the database can this be my mistake or can it be a software problem ? here is the php programa "); print "Connected successfully"; mysql_select_db("$DB_NAME", $link) or die("Could not select database"); /* Performing SQL query */ $query = "SELECT * FROM tb_users"; $result = mysql_query($query) or die("Query failed"); /* Printing results in HTML */ print "\n"; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { print "\t\n"; foreach ($line as $col_value) { print "\t\t$col_value\n"; } print "\t\n"; } print "\n"; /* Free resultset */ mysql_free_result($result); /* Closing connection */ mysql_close($link); ?> Stay Happy Miguel Angelo --- End of Forwarded Message --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Select DataBase Mysql Problem
Hi, Sunday, March 23, 2003, 1:26:04 PM, you wrote: MA> Hi everyone, MA> FIRST THANKX FOR ANY HELP !! MA> and THANKX FOR READING :) MA> I'm a reall newbie on PHP and i'm build a php app to connect into a mysql MA> database.. but i cannot select the database MA> i have build the database, and created a user MA> with : MA> create database mydatabase; MA> use mydatabase; MA> create tb_users ( userid varchar(20), userpassword varchar(20 ); MA> grant select, update, insert, delete on mydatabase.* to [EMAIL PROTECTED] MA> IDENTIFIED BY "mypassword"; MA> then flush priveliges... MA> I tested the user on mysql and it work correcly for my the pretended database MA> NOTES: MA> O.S. Linux MA> Mysql : compiled the most recent stable 4.0.12 MA> Php was compiled by SuSe on SuSe 8.0 MA> Php is connected into mysql via socks (configured on /etc/php.ini) MA> to test the set up i have used the php.net manual example to connect into the MA> mysql database i manage to connect into mysql but i cannot select the database MA> can this be my mistake or can it be a software problem ? MA> here is the php programa MA> $DB_HOST = "localhost"; MA> $DB_USER = "myuser"; MA> $DB_PASSWORD = "mypassword"; MA> $DB_NAME = "mydatabase"; MA> /* Connecting, selecting database */ MA> $link = mysql_connect("$DB_HOST", "$DB_USER", "$DB_PASSWORD") or MA> die("Could not connect"); MA> print "Connected successfully"; MA> mysql_select_db("$DB_NAME", $link) or die("Could not select MA> database"); MA> /* Performing SQL query */ MA> $query = "SELECT * FROM tb_users"; MA> $result = mysql_query($query) or die("Query failed"); MA> /* Printing results in HTML */ MA> print "\n"; MA> while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { MA> print "\t\n"; MA> foreach ($line as $col_value) { MA> print "\t\t$col_value\n"; MA> } MA> print "\t\n"; MA> } MA> print "\n"; MA> /* Free resultset */ MA> mysql_free_result($result); MA> /* Closing connection */ MA> mysql_close($link); ?>> MA> Stay Happy MA> Miguel Angelo MA> --- End of Forwarded Message --- Add a call to mysql_error() to find out what mysql does not like. mysql_select_db("$DB_NAME", $link) or die("Could not select database: ".mysql_error().""); -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Ayudaaa
Cuando ejecuto el comando make me genera el siguiente error: Zend/zend_execute.lo: file not recognized:File trycated Collect2: ld returned 1 exit status make ***[libphp4.la] Error 1 Esto ocurre siempre que ejecuto ./configure con la pocion. --with-apxs=/usr/sbin/apxs La version de PHP es.: PHP 4.3.0 y Apache 1.3 Gracias Jairo Torres Analista de Soporte Tecnólogo en Sistemas
Re: [PHP] Select DataBase Mysql Problem
Thankx a million Tom, I used .mysql_error() and i found it right away. Actualy i have a config.php file with the mysql user information and i was forgeting to do a include("config.php"); before i used mysql. Really stupid error. Thankx again. Miguel Angelo > Hi, > > Sunday, March 23, 2003, 1:26:04 PM, you wrote: > MA> Hi everyone, > > MA> FIRST THANKX FOR ANY HELP !! > MA> and THANKX FOR READING :) > > MA> I'm a reall newbie on PHP and i'm build a php app to connect > into a mysql MA> database.. but i cannot select the database > > MA> i have build the database, and created a user > MA> with : > > MA> create database mydatabase; > MA> use mydatabase; > MA> create tb_users ( userid varchar(20), userpassword varchar(20 ); > > MA> grant select, update, insert, delete on mydatabase.* to [EMAIL PROTECTED] > MA> IDENTIFIED BY "mypassword"; > > MA> then flush priveliges... > MA> I tested the user on mysql and it work correcly for my the > pretended database > > MA> NOTES: > MA> O.S. Linux > MA> Mysql : compiled the most recent stable 4.0.12 > MA> Php was compiled by SuSe on SuSe 8.0 > MA> Php is connected into mysql via socks (configured on /etc/php.ini) > > MA> to test the set up i have used the php.net manual example to > connect into the MA> mysql database i manage to connect into mysql > but i cannot select the database MA> can this be my mistake or can > it be a software problem ? > > MA> here is the php programa > > MA> MA> $DB_HOST = "localhost"; > MA> $DB_USER = "myuser"; > MA> $DB_PASSWORD = "mypassword"; > MA> $DB_NAME = "mydatabase"; > > MA> /* Connecting, selecting database */ > MA> $link = mysql_connect("$DB_HOST", "$DB_USER", "$DB_PASSWORD") > or MA> die("Could not connect"); MA> print "Connected successfully"; > MA> mysql_select_db("$DB_NAME", $link) or die("Could not select > MA> database"); > > MA> /* Performing SQL query */ > MA> $query = "SELECT * FROM tb_users"; > MA> $result = mysql_query($query) or die("Query failed"); > > MA> /* Printing results in HTML */ > MA> print "\n"; > MA> while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { > MA> print "\t\n"; > MA> foreach ($line as $col_value) { > MA> print "\t\t$col_value\n"; > MA> } > MA> print "\t\n"; > MA> } > MA> print "\n"; > > MA> /* Free resultset */ > MA> mysql_free_result($result); > > MA> /* Closing connection */ > MA> mysql_close($link); > ?>> > > MA> Stay Happy > MA> Miguel Angelo > MA> --- End of Forwarded Message --- > > Add a call to mysql_error() to find out what mysql does not like. > > mysql_select_db("$DB_NAME", $link) or die("Could not select > database: ".mysql_error().""); > > -- > regards, > Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 23 Mar 2003 13:56:11 -0000 Issue 1955
php-general Digest 23 Mar 2003 13:56:11 - Issue 1955 Topics (messages 140724 through 140754): Re: [PHP-DB] Gathering data from a database 140724 by: L0vCh1Y Re: how to pass variable for $_GET 140725 by: Leif K-Brooks 140727 by: Nate Re: regex 140726 by: Leif K-Brooks 140728 by: Nate 140729 by: Nate 140730 by: Leif K-Brooks 140731 by: Nate Re: PHP and IIS 140732 by: Leo Spalteholz 140733 by: Beauford.2002 SSL 140734 by: Rodney Green 140735 by: Jason Sheets Re: [php] Re: [PHP] SSL 140736 by: Rodney Green [php] nomenclature 140737 by: John Taylor-Johnston 140739 by: John Hicks 140740 by: Jason Wong 140743 by: John Taylor-Johnston more issues with variales within strings 140738 by: Dan Rossi 140741 by: Dan Rossi 140748 by: Ernest E Vogelsinger [php] Blind? 140742 by: John Taylor-Johnston 140744 by: Tom Rogers 140745 by: John Taylor-Johnston php & javascript problem 140746 by: Denis L. Menezes htaccess writable by httpd 140747 by: Dan Rossi automatic newsletter 140749 by: fr r 140750 by: Dan Rossi Select DataBase Mysql Problem 140751 by: Miguel Angelo 140752 by: Tom Rogers 140754 by: Miguel Angelo Ayudaaa 140753 by: Jairo Torres Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- --- Begin Message --- -> Mike, MD> I have been having this problem for a while now, and I cant figure it out. the code is: MD> $host = "localhost"; MD> $uname = "sniper"; MD> $pass = "starcraft"; MD> $database = "sha"; MD> $tablename = "members"; MD> $connect = mysql_connect ($host, $uname, $pass); MD> $select = "mysql_select_db ($database)"; MD> $query = "SELECT * from $tablename"; MD> $result = mysql_query ($query, $connect); MD> while ($row = mysql_fetch_array($result)) MD> { MD> print_r( $row ); MD> echo mysql_error(); MD> } ?>> MD> mysql has an error on line 19. Line 19 is while ($row = mysql_fetch_array($result)). What am I doing wrong? MD> Thanks for your help, MD> Mike ensure $result is correct: $select = "mysql_select_db ($database)"; # why do u use ""? $query = "SELECT * from $tablename"; $result = mysql_query ($query, $connect); while ($row = mysql_fetch_array($result)) { print_r( $row ); echo mysql_error(); } ?> Yours L0vCh1Y --- End Message --- --- Begin Message --- http://www.php.net/manual/en/ref.info.php#ini.magic-quotes-gpc DomIntCom wrote: ok - found urldecode which is now giving me the following; \'2003-1-3 00:00:01\' AND \'2003-3-10 23:59:59\' original string; '2003-1-3 00:00:01' AND '2003-3-10 23:59:59' "Domintcom" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] ok - I know how to pass these variables by appending variables to the link. however, I'm trying to pass the following string; '2003-1-1 00:00:01' AND '2003-3-20 23:59:59' now - when I pass it what I get is the following; date='2003-2-1%2000:00:01'%20AND%20'2003-3-1%2023:59:59' it seems what I'm going to have to do is replace %20 with a space, but I'm unclear of how to do that with php. thanks, Jeff -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. --- End Message --- --- Begin Message --- stripslashes("\'2003-1-3 00:00:01\' AND \'2003-3-10 23:59:59\'"); "Domintcom" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > ok - found urldecode which is now giving me the following; > > \'2003-1-3 00:00:01\' AND \'2003-3-10 23:59:59\' > > original string; > > '2003-1-3 00:00:01' AND '2003-3-10 23:59:59' > > > "Domintcom" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > ok - I know how to pass these variables by appending variables to the > link. > > however, I'm trying to pass the following string; > > > > '2003-1-1 00:00:01' AND '2003-3-20 23:59:59' > > > > now - when I pass it what I get is the following; > > > > date='2003-2-1%2000:00:01'%20AND%20'2003-3-1%2023:59:59' > > > > it seems what I'm going to have to do is replace %20 with a space, but I'm > > unclear of how to do that with php. > > > > thanks, > > > > Jeff > > > > > > > > --- End Message --- --- Begin Message --- Try this (entirely untested!): $final_footer = preg_replace('%INCLUDE_FILE\\[[^\\]]*\\]%','',$final_footer); Nate wrote: hi, i need to search $final_footer for a string such as %INCLUDE_FILE[/path/to/file]% (where /path/to/file could be anything) and delete it from the string. it being %INCLUDE_FILE[/path/to/file]% (not just /path/to/file) im new to regexps but im guessing I should use preg_match for this? Can s
[PHP] PHP Session Management
Hello all. I am trying to figure out some session management that is in the O'reilly book - Web Database Applications. I am getting the following error - Error 1045 : Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) Normally, I would think that this is because the userid and/or password for the database is incorrect. However, they are not. I have verified that the userid and password are correct and the database server is active. Anyone have any ideas? Here is the code sessions.php - // Error handling function showerror() { die("Error " . mysql_errno() . " : " . mysql_error()); } // Returns current time as a number // Used for recording the last session access function getMicroTime() { // microtime() returns the number of seconds // since 0:00:00 January 1, 1970 GMT as a // microsecond part and a second part. // eg: 0.08344800 1000952237 // Convert the two parts into an array $mtime = explode(" ", microtime()); // Return the addition of the two parts return($mtime[1] + $mtime[0]); } // The database connection $connection; // The global variable that holds the table name $session_table; function sessionOpen($database_name, $table_name) { // Save the database name in a global variable global $connection; global $hostName; global $username; global $password; if(!($connection = @mysql_connect($hostName, $username, $password))){ showerror(); } if(!mysql_select_db($database_name, $connection)){ showerror(); } // Save the table name in a global variable global $session_table; $session_table = $table_name; return true; } // This function is called whenever a session_start() // call is made and reads the session variables // Returns "" when a session is not found // (serialized)string - session exists function sessionRead($sess_id) { // Access the DB connection global $connection; // Access the global variable that holds the name // of the table that holds the session variables global $session_table; // Formulate a query to find the session // identified by $sess_id $search_query = "select * from $session_table where session_id = '$sess_id'"; // Execute the query if(!($result = @mysql_query($search_query, $connection))){ showerror(); } if(mydql_num_rows($result) == 0){ return ""; }else{ // Found a session - retun the seialized string $row = mysql_fetch_array($result); return $row["session_variable"]; } } // This function is called when a session is initialized // with a session_start() call, when variables are // registered or unregistered, and when session variables // are modified. Returns true on success. function sessionWrite($sess_id, $val) { global $connection; global $session_table; $time_stamp = getMicroTime(); $search_query = "select session_id from $session_table where session_id = '$sess_id'"; // Execute query if(!($result = @mysql_query($search_query, $connection))){ showerror(); } if(mysql_num_rows($result) == 0){ // No session found, insert a new one $insert_query = "insert into $session_table (session_id, session_variable, last_accessed) values ('$sess_id, '$val', $time_stamp)"; if(!mysql_query($insert_query, $connection)){ showerror(); } }else{ // Existing session found - Update it $update_query = "update $session_table set session_variable = '$val', last_accessed = $time_stamp where session_id = '$sess_id'"; if(!mysql_query($update_query, $connection)){ showerror(); } } return true; } // This funstion is executed on shutdown of the session // Always returns true function sessionClose($sess_id) { return true; } // This is called whenever the session_destroy() // funstion call is made. Returns true is the session // has successfully been deleted. function sessionDestroy($sess_id) { global $connection; global $session_table; $delete_query = "delete from session_table where session_id = '$sess_id'"; if(!($result = @mysql_query($delete_query, $connection))){ showerror(); } return true; } // This function is called on a session's start up with // the probability specified in session.gc_probability. // Performs garbage collection by removing all sessions // that haven't been updated in the last $max_lifetime // seconds as set in session.gc_maxlifetime. // returns true if the delete query succeeded. fun
Re: [PHP] PHP Session Management
Got it fixed. Turns out there are typos in the book Thanks Jason for the help. Chris At 08:50 AM 3/23/2003, CDitty wrote: Hello all. I am trying to figure out some session management that is in the O'reilly book - Web Database Applications. I am getting the following error - Error 1045 : Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) Normally, I would think that this is because the userid and/or password for the database is incorrect. However, they are not. I have verified that the userid and password are correct and the database server is active. Anyone have any ideas? Here is the code sessions.php - // Error handling function showerror() { die("Error " . mysql_errno() . " : " . mysql_error()); } // Returns current time as a number // Used for recording the last session access function getMicroTime() { // microtime() returns the number of seconds // since 0:00:00 January 1, 1970 GMT as a // microsecond part and a second part. // eg: 0.08344800 1000952237 // Convert the two parts into an array $mtime = explode(" ", microtime()); // Return the addition of the two parts return($mtime[1] + $mtime[0]); } // The database connection $connection; // The global variable that holds the table name $session_table; function sessionOpen($database_name, $table_name) { // Save the database name in a global variable global $connection; global $hostName; global $username; global $password; if(!($connection = @mysql_connect($hostName, $username, $password))){ showerror(); } if(!mysql_select_db($database_name, $connection)){ showerror(); } // Save the table name in a global variable global $session_table; $session_table = $table_name; return true; } // This function is called whenever a session_start() // call is made and reads the session variables // Returns "" when a session is not found // (serialized)string - session exists function sessionRead($sess_id) { // Access the DB connection global $connection; // Access the global variable that holds the name // of the table that holds the session variables global $session_table; // Formulate a query to find the session // identified by $sess_id $search_query = "select * from $session_table where session_id = '$sess_id'"; // Execute the query if(!($result = @mysql_query($search_query, $connection))){ showerror(); } if(mydql_num_rows($result) == 0){ return ""; }else{ // Found a session - retun the seialized string $row = mysql_fetch_array($result); return $row["session_variable"]; } } // This function is called when a session is initialized // with a session_start() call, when variables are // registered or unregistered, and when session variables // are modified. Returns true on success. function sessionWrite($sess_id, $val) { global $connection; global $session_table; $time_stamp = getMicroTime(); $search_query = "select session_id from $session_table where session_id = '$sess_id'"; // Execute query if(!($result = @mysql_query($search_query, $connection))){ showerror(); } if(mysql_num_rows($result) == 0){ // No session found, insert a new one $insert_query = "insert into $session_table (session_id, session_variable, last_accessed) values ('$sess_id, '$val', $time_stamp)"; if(!mysql_query($insert_query, $connection)){ showerror(); } }else{ // Existing session found - Update it $update_query = "update $session_table set session_variable = '$val', last_accessed = $time_stamp where session_id = '$sess_id'"; if(!mysql_query($update_query, $connection)){ showerror(); } } return true; } // This funstion is executed on shutdown of the session // Always returns true function sessionClose($sess_id) { return true; } // This is called whenever the session_destroy() // funstion call is made. Returns true is the session // has successfully been deleted. function sessionDestroy($sess_id) { global $connection; global $session_table; $delete_query = "delete from session_table where session_id = '$sess_id'"; if(!($result = @mysql_query($delete_query, $connection))){ showerror(); } return true; } // This function is called on a session's start up with // the probability specified in session.gc_probability. // Performs garbage collection by removing all sessions // that haven't been upd
Re: [PHP] Password Authentication
On 23 Mar 2003 Justin French wrote: > That's in the user notes... ignor it... md5() does not have to be salted... > infact, you WANT the md5() to be static... because you will compare the > md5()'d password in the database with the md5()'d password that they submit > on a form. Exactly. On this point the docs seem to be messed up. -- Tom Rawson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Removing Risky Characters
On 22 Mar 2003 David Otton wrote: > The thing that is most likely to trip you up is people who cut'n'paste > from Word. High-ASCII characters can slip in like that, also some > characters that are common in European languages (accents and umlauts). > All of these need to be translated into HTML entities. I understand that that needs to be done for display. My question was about input. What happens if someone enters an ASCII 147 or 148 in a form field, for example? Will PHP interpret them as quotes? Or is only an ASCII 34 seen as a quote. If the former, will addslashes() add shashes to them? -- Tom Rawson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] numbers problem
Hi, I'm using a mysql connection to dinamically fill a table with descriptions, prices, and so on... But when the script takes the price of a Plasma Monitor, that costs 8025.00 $, it outputs only 8,00. I recall it by typing : echo $row_Recordset1['Prezzo'] And please note that I've seen that it happens only when $row_Recordset1['Prezzo'] > 1000 Can anyone tell me why and what can I do ? Please answer me, it's very important... Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] numbers problem
On Sun, 23 Mar 2003 14:09:26 +0100, you wrote: >And please note that I've seen that it happens only when >$row_Recordset1['Prezzo'] > 1000 What's the largest number you can get from the table? Exactly? 1000 is suspiciously close to 1024. Is it possible that your table is using a smaller data type than normal to store the value? "DESC tablename" to check -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] trouble with cURL & Linkpoint
I'm having trouble getting cURL to work with a remote server. I'm using Linkpoint to process a credit card transaction. (Does anyone have any experience with Linkpoint?) I have tested my script on another server and cURL seems to retrieve the information fine. However, I'm getting a blank html page when I try the linkpoint form processor. When I submitted the form directly to Linkpoint, everything worked OK. Here's the script I submit to on my server: $postfields = array(); $postfields[] = array("bname", $_POST['bname']); $postfields[] = array("baddr1", $_POST['baddr1']); $postfields[] = array("baddr2", $_POST['baddr2']); $postfields[] = array("bcity", $_POST['bcity']); $postfields[] = array("bstate", $_POST['bstate']); $postfields[] = array("bzip", $_POST['bzip']); foreach($postfields as $subarray) { list($foo, $bar) = $subarray; $bar = urlencode($bar); $postedfields[] = "$foo=$bar"; } $urlstring = join("\n", $postedfields); $urlstring = ereg_replace("\n", "&", $urlstring); $ch = curl_init("https://www.linkpointcentral.com/lpc/servlet/lppay";); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $urlstring); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); curl_setopt($ch, CURLOPT_REFERER, "http://www.mysite.com/mypage.html";); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); curl_close($ch); echo $data; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Temporary Files
Im trying to create a way of storing php scripts in a mySQL database, and then execute them using temporary files as executable script buffers.. The database retrieval is working fine but the file does not... Ive got a table with 4 fields: execID, execName, execDesc and execProc The last one contains php code. This is what i have so far: But i need to get the name of the tempfile in order to include it.. All i have now is the handle_id Any help appreciated.
Re: [PHP] Temporary Files
Rather than writing the code to a temporary file and then including the file why not just use eval() on the code fetched from the database (http://www.php.net/eval)? Otherwise you could use generate a unique filename yourself rather than using tmpfile. $filename = md5(uniqid()); Of course you may want to through some checking in there to make sure the file doesn't already exist but the chances of getting the same exact filename in the short time the file is required is fairly low. Jason Lars Tvedt wrote: Im trying to create a way of storing php scripts in a mySQL database, and then execute them using temporary files as executable script buffers.. The database retrieval is working fine but the file does not... Ive got a table with 4 fields: execID, execName, execDesc and execProc The last one contains php code. This is what i have so far: But i need to get the name of the tempfile in order to include it.. All i have now is the handle_id Any help appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Removing Risky Characters
On Sun, 23 Mar 2003 10:51:43 -0500, you wrote: >My question was about input. What happens if someone enters an ASCII >147 or 148 in a form field, for example? Will PHP interpret them as >quotes? Or is only an ASCII 34 seen as a quote. If the former, will >addslashes() add shashes to them? I see. No, they're not quotes in the PHP sense - they can be used as part of a string literal without escaping. However, in your example (form submission) it's a moot point - HTTP multipart/form-data uses MIME (CRLF + a content boundary), not quotes, to bracket data. See the end of http://www.w3.org/TR/REC-html40/interact/forms.html to get a feel for what a raw form submit from a browser looks like. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reloading a page..
Not sure why things like this are so difficult. I have an authentication script which allows users access to certain pages based on their user level. If they click on a link to go to a page their not allowed to, I want to be able to just reload the page their on and display a message saying they are not authorized to view that page - do you think I can get the page to reload.I've tried the header thing (but can't because headers are already sent), I've tried playing around with $PHP_SELF with no luck, I've looked for javascripts with no luck. Anyone have any ideas? TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reloading a page..
On Sun, 23 Mar 2003 12:15:25 -0500, you wrote: >Not sure why things like this are so difficult. I have an authentication >script which allows users access to certain pages based on their user level. >If they click on a link to go to a page their not allowed to, I want to be First, why are the pages they can't access displayed as active links? >able to just reload the page their on and display a message saying they are >not authorized to view that page - do you think I can get the page to You don't need to reload the page. At the top of each page, put your check routine. if (access_granted == FALSE) { show_access_denied_message; exit; } show_regular_page; >reload.I've tried the header thing (but can't because headers are >already sent), Either rewrite your page so the security check comes before any output is sent, or use the output buffering functions (ob_start(), etc) >I've tried playing around with $PHP_SELF with no luck, I've That's passed to the script from its environment... changing it will have no effect on the script's environment. >looked for javascripts with no luck. Anyone have any ideas? You can't rely on Javascript for security. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reloading a page..
One other problem is that I need to know the page the came from in order to reload it. i.e. if they try to access a restricted page from six.html I want to reload six.html - if they try from eight.html then eight.html needs to be reloaded. - Original Message - From: "David Otton" <[EMAIL PROTECTED]> To: "Beauford.2002" <[EMAIL PROTECTED]> Cc: "PHP General" <[EMAIL PROTECTED]> Sent: Sunday, March 23, 2003 12:37 PM Subject: Re: [PHP] reloading a page.. > On Sun, 23 Mar 2003 12:15:25 -0500, you wrote: > > >Not sure why things like this are so difficult. I have an authentication > >script which allows users access to certain pages based on their user level. > >If they click on a link to go to a page their not allowed to, I want to be > > First, why are the pages they can't access displayed as active links? > > >able to just reload the page their on and display a message saying they are > >not authorized to view that page - do you think I can get the page to > > You don't need to reload the page. At the top of each page, put your > check routine. > > if (access_granted == FALSE) { > show_access_denied_message; > exit; > } > > show_regular_page; > > >reload.I've tried the header thing (but can't because headers are > >already sent), > > Either rewrite your page so the security check comes before any output > is sent, or use the output buffering functions (ob_start(), etc) > > >I've tried playing around with $PHP_SELF with no luck, I've > > That's passed to the script from its environment... changing it will > have no effect on the script's environment. > > >looked for javascripts with no luck. Anyone have any ideas? > > You can't rely on Javascript for security. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reloading a page..
On March 23, 2003 10:22 am, Beauford.2002 wrote: > One other problem is that I need to know the page the came from in > order to reload it. i.e. if they try to access a restricted page > from six.html I want to reload six.html - if they try from > eight.html then eight.html needs to be reloaded. Firstly, as David mentioned, if the user is not allowed to access the page then the link shouldn't be there in the first place. If there is no link then there is no need to refresh the page or generate an error or anything. If you really want to you can have the link but instead of an href to the page you would replace it with a Javascript alert saying "access denied". But thats beside the point because if they enter the restricted page into the address bar directly it also has to deny them access. You should write a script that checks the users credentials and then include it at the top of EVERY page. If the user can no be validated then an access denied message is displayed. Even better, if a user cannot be validated then you can redirect them back to where they came from (referrer). That would effectively achive your goal by refreshing the original page no matter where they;re coming from. Leo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] who is on the page?
Hi everybody, I've been looking for a script to determine who is on my page (people have to log in). So far, I've been using a script that updates the time in the database continuously as long as the person is on the page. That way, the script could determine whether the user is still online or not. However, this script has way too many queries and uses too much server resources. Is there anything else? I'm wondering if the connection_status() function would help in any way... thx, Olli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: (newbie)calling GLOBAL arrays
Hiya Im having difficulties calling array values from outside script. I have db.api.php $username = $row[0]; $password = $row[1]; $email = $row[2]; echo "THE USERNAME IN DB.API IS $username"; echo "THE PASSWORD IN DB.API IS $password"; echo "THE EMAIL IN DB.API IS $email"; } ?> // this works fine but now when I try and call these variables from // another php script user.api.php $querystring = ("select username, password , email from user where username= '$username'"); db_fetch($querystring); echo "THE USERNAME IN USER API2 IS $row[0]"; echo "THE PASSWORD IN USER API IS $password"; ?> // I have tried to print to screen these variables from the //global array $row two different ways and seem to get nothing on screen // I have also tried registering the variables seperately such as session_register('username'); with no luck Can anyone see what I am doing wrong or suggest any tutorials which may describe using arrays with sessions. Thanks _ Worried what your kids see online? Protect them better with MSN 8 http://join.msn.com/?page=features/parental&pgmarket=en-gb&XAPID=186&DI=1059 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: Ayudaaa
Hola Gairo, No es que te pueda ayudar mucho, pero por si te sirve de algo yo instalé Apache 2.0 y PHP 4.2.x en un sistema Red Hat a partir de los RPM's disponibles en los CD's de redhat (o en su web) y no tuve que preocuparme de compilar ni nada. No dices si tu sistema es *nix o MS-W, pero espero que te sirva -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] numbers problem
Emanuele, Some parts of the world use the coma as the separator between whole numbers and decimals (e.g. Germany & France) and php is formating the number according to this style. I surmise that the numbers stored in your database have been stored with comas separating the thousands from the hundreds (English & US style), so you'll need to grab the number, eliminate the coma (something like $num=ereg_replace(",","",$num) will do this but there is likely a more direct php command for this), then when you want to display the number use number_format($num,2,".",","). Hope this helps. Hugh - Original Message - From: "Emanuele" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, March 23, 2003 5:09 AM Subject: [PHP] numbers problem > Hi, I'm using a mysql connection to dinamically fill a table with > descriptions, prices, and so on... > > But when the script takes the price of a Plasma Monitor, that costs 8025.00 > $, it outputs only 8,00. > I recall it by typing : > > echo $row_Recordset1['Prezzo'] > > And please note that I've seen that it happens only when > $row_Recordset1['Prezzo'] > 1000 > > Can anyone tell me why and what can I do ? > Please answer me, it's very important... > Thanks > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Finding out which file is retrieved over HTTP
The following short script retrieves a file over HTTP: $url = 'http://www.example.com/'; implode('',file($url)); // or file_get_contents() Now I'd like to find out which file was really retrieved, for instance http://www.example.com/index.html. Is this possible and how? Background: I need to write a small link-checker (Intranet), which reads in all links within a file and then looks if they're broken and collects some information. Unfortunately I didn't find a simple, free link-checker that's why I write my own. It would be good to find out the "complete" url, because I want to collect the file-endings (.php,.html, ...). Another thing is that my script is recursive, so I need a function absolute_link() which takes a (possibly relative) path and an url to find out which page to go next. Example: $url = http://www.example.com/foo/bar/ Somewhere in the source code: ... ... My script reads in $path='../articles/page.html'. The function absolute_link($url, $path) should return 'http://www.example.com/foo/articles/page.html'. However $url could be http://www.example.com/foo/bar (bar can be file or dir here imho) or http://www.example.com/foo/bar/index.php and in any case absolute_link() should return the same. Of course this function is easier to implement if I always have something like http://www.example.com/foo/bar/index.php. Maybe there's already a useful function besides parse-url() I can use here. Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] who is on the page?
how bout add a last logged in field , and then do a check where the last logged in field is NOW() etc .. -Original Message- From: Oliver Witt [mailto:[EMAIL PROTECTED] Sent: Monday, March 24, 2003 6:24 AM To: [EMAIL PROTECTED] Subject: [PHP] who is on the page? Hi everybody, I've been looking for a script to determine who is on my page (people have to log in). So far, I've been using a script that updates the time in the database continuously as long as the person is on the page. That way, the script could determine whether the user is still online or not. However, this script has way too many queries and uses too much server resources. Is there anything else? I'm wondering if the connection_status() function would help in any way... thx, Olli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] who is on the page?
oh silly me you might need also an on/off flag , but need a way to determine when they close the connection -Original Message- From: Oliver Witt [mailto:[EMAIL PROTECTED] Sent: Monday, March 24, 2003 6:24 AM To: [EMAIL PROTECTED] Subject: [PHP] who is on the page? Hi everybody, I've been looking for a script to determine who is on my page (people have to log in). So far, I've been using a script that updates the time in the database continuously as long as the person is on the page. That way, the script could determine whether the user is still online or not. However, this script has way too many queries and uses too much server resources. Is there anything else? I'm wondering if the connection_status() function would help in any way... thx, Olli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Finding out which file is retrieved over HTTP
On Sun, 23 Mar 2003 21:21:39 +0100, you wrote: >The following short script retrieves a file over HTTP: > >$url = 'http://www.example.com/'; >implode('',file($url)); // or file_get_contents() > >Now I'd like to find out which file was really retrieved, for instance >http://www.example.com/index.html. Is this possible and how? Difficult - you made a request, and the webserver returned a response. Whether or not the webserver maps your request to a specific file - or if it even has any concept of a file - is it's own internal matter. Having said that, you could try the Content-Location header, and the 3xx status codes. >I need to write a small link-checker (Intranet), which reads in all >links within a file and then looks if they're broken and collects some >information. Unfortunately I didn't find a simple, free link-checker >that's why I write my own. It would be good to find out the "complete" >url, because I want to collect the file-endings (.php,.html, ...). I really think this already exists. You should probably search a bit harder. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] who is on the page?
What you might want to try is to set a cookie when the user first enters the page, but set it's length to 5 minutes. Then everytime the cookie is resent to the page you count it as a user. But if they leave, then the cookie destroy's itself. You can have the cookie reset it's self, or set to when ever the browser closes. But thats up to you - Original Message - From: "Oliver Witt" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 24, 2003 6:23 AM Subject: [PHP] who is on the page? > Hi everybody, > I've been looking for a script to determine who is on my page (people > have to log in). So far, I've been using a script that updates the time > in the database continuously as long as the person is on the page. That > way, the script could determine whether the user is still online or not. > However, this script has way too many queries and uses too much server > resources. Is there anything else? I'm wondering if the > connection_status() function would help in any way... > thx, > Olli > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail function
The use of the standard mail(...) function is just not working and I would really appreciate some patient soul's time to access: http://www.up.net/~jolove/PHP/EMail/EmailPHP.php and look at the code ... it really is very short ... The function send() returns success, yet my mail client, Eudora is not accepting emails when I send mail to myself. The HTML source which accesses the above .php code is: http://www.up.net/~jolove/email.php Many, many thanks in advance ... John Love [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] who is on the page?
> I've been looking for a script to determine who is on my page (people > have to log in). So far, I've been using a script that updates the time > in the database continuously as long as the person is on the page. That > way, the script could determine whether the user is still online or not. > However, this script has way too many queries and uses too much server > resources. Is there anything else? I'm wondering if the > connection_status() function would help in any way... Connection_status() is for something else. Remember how HTTP works. The server receives a request, it sends a file, you receive it, and that's it. There is no more communication. There is _no_ way to tell how many people are on your page, plain and simple. What you can do, however, is something like you're doing now. With each _request_ to a page (not every second, or however you're doing it now), update a time in a database. To see how many people are "on your site" you can select a count of how many users have times that are less than X minutes old. You have to assume that if they requested a page X minutes ago, they are more than likely still on your page. Since this isn't rocket science, this assumption will be adequate for your needs. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: how to pass variable for $_GET
thanks - found a solution... both method's worked for me "Nate" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > stripslashes("\'2003-1-3 00:00:01\' AND \'2003-3-10 23:59:59\'"); > > "Domintcom" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > ok - found urldecode which is now giving me the following; > > > > \'2003-1-3 00:00:01\' AND \'2003-3-10 23:59:59\' > > > > original string; > > > > '2003-1-3 00:00:01' AND '2003-3-10 23:59:59' > > > > > > "Domintcom" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > ok - I know how to pass these variables by appending variables to the > > link. > > > however, I'm trying to pass the following string; > > > > > > '2003-1-1 00:00:01' AND '2003-3-20 23:59:59' > > > > > > now - when I pass it what I get is the following; > > > > > > date='2003-2-1%2000:00:01'%20AND%20'2003-3-1%2023:59:59' > > > > > > it seems what I'm going to have to do is replace %20 with a space, but > I'm > > > unclear of how to do that with php. > > > > > > thanks, > > > > > > Jeff > > > > > > > > > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] numbers problem
> Hi, I'm using a mysql connection to dinamically fill a table with > descriptions, prices, and so on... > > But when the script takes the price of a Plasma Monitor, that costs > 8025.00 > $, it outputs only 8,00. > I recall it by typing : > > echo $row_Recordset1['Prezzo'] > > And please note that I've seen that it happens only when > $row_Recordset1['Prezzo'] > 1000 Check what the type is on your column. Since you show it has a comma in it, I'll assume it's a varchar. Since you can't store a number over 1000, I'll also guess that it's a varchar(3) column. If you're typing in 8025.00 and it's getting stored as 8,00 then how are you processing it before storing it? Something has to add in the comma, right? Prices should be stored as a DECIMAL column type. You should validate what the user puts in and _make_ it into a decimal. Can you always assume that a period is the decimal separator? Some countries use a comma for a decimal separator and the period as the thousands separator. You must validate everything from the user and format it to match what you need and reject everything else. Plain and simple. :) ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] htaccess writable by httpd
> is this a dangerous feature ? Depends what kind of server you're on to start with. If you have a dedicated server, then it's not as big of a deal. If you're on a shared server, then anyone else on that server can write your .htaccess files for you (generally). ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: how to pass variable for $_GET
Don't know if you realize this or not, but when you pass the variables, you DO NOT enclose them in ' marks... So... http://blah.com/myscript.php?date=2003-2-1%2000:00:01'%20AND%20'2003-3-1%202 3:59:59&othervar=1234 Then on your myscript.php page, $_GET['date'] will equal "2003-1-3 00:00:01 AND 2003-3-10 23:59:59" (sans the " marks) $_GET['othervar'] will equal "1234" The browser pads the spaces with %20 If you really do need the ' marks, put them in the myscript.php page where needed like this: $sql = "SELECT * FROM foo WHERE blah = '".$_GET['othervar']."'"; > -Original Message- > From: DomIntCom [mailto:[EMAIL PROTECTED] > Sent: Sunday, March 23, 2003 2:08 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Re: how to pass variable for $_GET > > > thanks - found a solution... both method's worked for me > > > "Nate" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > stripslashes("\'2003-1-3 00:00:01\' AND \'2003-3-10 23:59:59\'"); > > > > "Domintcom" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > ok - found urldecode which is now giving me the following; > > > > > > \'2003-1-3 00:00:01\' AND \'2003-3-10 23:59:59\' > > > > > > original string; > > > > > > '2003-1-3 00:00:01' AND '2003-3-10 23:59:59' > > > > > > > > > "Domintcom" <[EMAIL PROTECTED]> wrote in message > > > news:[EMAIL PROTECTED] > > > > ok - I know how to pass these variables by appending > variables to the > > > link. > > > > however, I'm trying to pass the following string; > > > > > > > > '2003-1-1 00:00:01' AND '2003-3-20 23:59:59' > > > > > > > > now - when I pass it what I get is the following; > > > > > > > > date='2003-2-1%2000:00:01'%20AND%20'2003-3-1%2023:59:59' > > > > > > > > it seems what I'm going to have to do is replace %20 > with a space, but > > I'm > > > > unclear of how to do that with php. > > > > > > > > thanks, > > > > > > > > Jeff > > > > > > > > > > > > > > > > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reloading a page..
The link in question is there by design and should be there, but below is what I am talking about. > Even better, if a user cannot be validated then you can redirect them back to where they > came from (referrer). That would effectively achive your goal by > refreshing the original page no matter where they;re coming from. This is what I have, but no matter what I do I can not get a message to appear on the referring page saying you have no access to the other page, and I have also read that 'HTTP_REFERER' is not very reliable if($userlevel != $neededlevel) { include ($_SERVER['HTTP_REFERER']); $message = $no_permission; $exit; } ...on referring page - Original Message - From: "Leo Spalteholz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, March 23, 2003 2:06 PM Subject: Re: [PHP] reloading a page.. > On March 23, 2003 10:22 am, Beauford.2002 wrote: > > One other problem is that I need to know the page the came from in > > order to reload it. i.e. if they try to access a restricted page > > from six.html I want to reload six.html - if they try from > > eight.html then eight.html needs to be reloaded. > > Firstly, as David mentioned, if the user is not allowed to access the > page then the link shouldn't be there in the first place. If there > is no link then there is no need to refresh the page or generate an > error or anything. If you really want to you can have the link but > instead of an href to the page you would replace it with a Javascript > alert saying "access denied". > But thats beside the point because if they enter the restricted page > into the address bar directly it also has to deny them access. You > should write a script that checks the users credentials and then > include it at the top of EVERY page. If the user can no be validated > then an access denied message is displayed. Even better, if a user > cannot be validated then you can redirect them back to where they > came from (referrer). That would effectively achive your goal by > refreshing the original page no matter where they;re coming from. > > Leo > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail function
Hello John, Please make a copy of the file with a .phps or .txt extension so the code is not parsed by PHP. Thanks, Jason John Love wrote: The use of the standard mail(...) function is just not working and I would really appreciate some patient soul's time to access: http://www.up.net/~jolove/PHP/EMail/EmailPHP.php and look at the code ... it really is very short ... The function send() returns success, yet my mail client, Eudora is not accepting emails when I send mail to myself. The HTML source which accesses the above .php code is: http://www.up.net/~jolove/email.php Many, many thanks in advance ... John Love [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PHP-DB] when click on button, how renew info on page?
-> gert Monday, March 24, 2003 sent: gv> hello everyone, gv> with this code, a table is loaded with info from the mysql db with id = '1'. gv> but now i want to make a button, and when it is clicked, he has to renew the gv> table with the info from the db with id ='2' gv> does anyone know has this should be done? gv> thanks in advance! gv> Greetings, gv> Gert Vonck gv> gv> gv> gv> mysql_connect("localhost","root","") or gv> die ("Could not connect to database"); gv> mysql_select_db("oh") or gv> die ("problems selecting database"); ?>> gv> Info_DJ gv> $result0 = mysql_query("SELECT gv> naam,leeftijd,muziekgenre,favoriet_liedje,motto,picture_right FROM info_dj gv> WHERE id='1'") or die (mysql_error()); gv> print"\n"; gv> $field_count = mysql_num_fields($result0); gv> while ($get_info0 = mysql_fetch_row($result0)) gv> { gv> print ""; gv> for($i = 0; $i < $field_count - 1 ; $i++){ gv> $value = $get_info0[$i]; gv> $column = mysql_field_name($result0,$i); gv> print "\t$column$value\n"; gv> } gv> $last = $field_count - 1; gv> print "\n"; gv> } gv> print "\n"; gv> mysql_close(); ?>> gv> gv> gv> _ So, what is problem in? Make button to lead to same page but with $n++ variable. i.e. link'; } else die (mysql_error()); ?> And one more thing - try to use templates, if you work with HTML parsing a lot. :] Yours, L0vCh1Y [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Calculating the difference between two dates
Does any one know how to calculate the difference between two dates. I need to find out the age of a user to make sure they are over the age of 13. I have searched for hours on this and found nothing that will help. TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with imagerotate()
I'm having some problems with imagerotate() - e.g. it won't work at all. I've tried many different ways to get it to work, but I have yet to see it do anything at all. I'm using PHP 4.3.1 on XP. I know that GD is working properly because I can do other image-manipulation with it without error. Plus, I installed PHP manually, not with the Windows installer (which I've had problems getting GD to work properly on in the past). I've added the last attempt at getting the code to work. Note that the imagecopy() works fine and the new image displayed always ends up being an exact copy of the destination image. Any help would be greatly appreciated! if (($degrees == "90") || ($degrees == "180") || ($degrees == "270")){ foreach($image_check as $temp_file){ $src_img = imagecreatefromjpeg("$inbox_dir\\$temp_file"); $new_img = imagecreatetruecolor(imagesx($src_img),imagesy($src_img)); imagecopy($new_img,$src_img,0,0,0,0,imagesx($new_img),imagesy($new_img)); if (function_exists(imagerotate)){ if(imagerotate($new_img, $degrees, 0)){ print "Image Rotated Successfully"; } else { print "Error Rotating Image"; } } imagejpeg($new_img, "$inbox_dir\\new_image_path.jpg"); imagedestroy($src_img); imagedestroy($new_img); *code left off that's not important - though there's no syntax/compile errors -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 24 Mar 2003 01:56:22 -0000 Issue 1956
php-general Digest 24 Mar 2003 01:56:22 - Issue 1956 Topics (messages 140755 through 140789): PHP Session Management 140755 by: CDitty 140756 by: CDitty Re: Password Authentication 140757 by: trlists.clayst.com Re: Removing Risky Characters 140758 by: trlists.clayst.com 140764 by: David Otton numbers problem 140759 by: Emanuele 140760 by: David Otton 140772 by: Hugh Danaher 140781 by: John W. Holmes trouble with cURL & Linkpoint 140761 by: Doug Parker Temporary Files 140762 by: Lars Tvedt 140763 by: Jason Sheets reloading a page.. 140765 by: Beauford.2002 140766 by: David Otton 140767 by: Beauford.2002 140768 by: Leo Spalteholz 140784 by: Beauford.2002 who is on the page? 140769 by: Oliver Witt 140774 by: Dan Rossi 140775 by: Dan Rossi 140777 by: The Head Sage 140779 by: John W. Holmes Re: (newbie)calling GLOBAL arrays 140770 by: Bobby Rahman Re: Ayudaaa 140771 by: reven Finding out which file is retrieved over HTTP 140773 by: Jens Lehmann 140776 by: David Otton mail function 140778 by: John Love 140785 by: Jason Sheets Re: how to pass variable for $_GET 140780 by: DomIntCom 140783 by: Daevid Vincent Re: htaccess writable by httpd 140782 by: John W. Holmes Re: [PHP-DB] when click on button, how renew info on page? 140786 by: L0vCh1Y [systems] cvs server moving 140787 by: James Cox Calculating the difference between two dates 140788 by: Beauford.2002 Problem with imagerotate() 140789 by: Mike Brum Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- --- Begin Message --- Hello all. I am trying to figure out some session management that is in the O'reilly book - Web Database Applications. I am getting the following error - Error 1045 : Access denied for user: '[EMAIL PROTECTED]' (Using password: YES) Normally, I would think that this is because the userid and/or password for the database is incorrect. However, they are not. I have verified that the userid and password are correct and the database server is active. Anyone have any ideas? Here is the code sessions.php - // Error handling function showerror() { die("Error " . mysql_errno() . " : " . mysql_error()); } // Returns current time as a number // Used for recording the last session access function getMicroTime() { // microtime() returns the number of seconds // since 0:00:00 January 1, 1970 GMT as a // microsecond part and a second part. // eg: 0.08344800 1000952237 // Convert the two parts into an array $mtime = explode(" ", microtime()); // Return the addition of the two parts return($mtime[1] + $mtime[0]); } // The database connection $connection; // The global variable that holds the table name $session_table; function sessionOpen($database_name, $table_name) { // Save the database name in a global variable global $connection; global $hostName; global $username; global $password; if(!($connection = @mysql_connect($hostName, $username, $password))){ showerror(); } if(!mysql_select_db($database_name, $connection)){ showerror(); } // Save the table name in a global variable global $session_table; $session_table = $table_name; return true; } // This function is called whenever a session_start() // call is made and reads the session variables // Returns "" when a session is not found // (serialized)string - session exists function sessionRead($sess_id) { // Access the DB connection global $connection; // Access the global variable that holds the name // of the table that holds the session variables global $session_table; // Formulate a query to find the session // identified by $sess_id $search_query = "select * from $session_table where session_id = '$sess_id'"; // Execute the query if(!($result = @mysql_query($search_query, $connection))){ showerror(); } if(mydql_num_rows($result) == 0){ return ""; }else{ // Found a session - retun the seialized string $row = mysql_fetch_array($result); return $row["session_variable"]; } } // This function is called when a session is initialized // with a session_start() call, when variables are // registered or unregistered, and when session variables // are modified. R
RE: [PHP] Calculating the difference between two dates
On 24-Mar-1998 Beauford.2002 wrote: > Does any one know how to calculate the difference between two dates. I > need > to find out the age of a user to make sure they are over the age of 13. I > have searched for hours on this and found nothing that will help. > Start here: echo date('Y-m-d', strtotime('13 years ago')); Sorry, it doesn't check the birth certificate ;) Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Calculating the difference between two dates
Hi, Ask them who the president of the United States was before Britney Spears, that should work pretty well :) Otherwise, check out the Date package in PEAR at http://pear.php.net/package-info.php?pacid=57 Greg -- phpDocumentor http://www.phpdoc.org Don Read wrote: On 24-Mar-1998 Beauford.2002 wrote: Does any one know how to calculate the difference between two dates. I need to find out the age of a user to make sure they are over the age of 13. I have searched for hours on this and found nothing that will help. Start here: echo date('Y-m-d', strtotime('13 years ago')); Sorry, it doesn't check the birth certificate ;) Regards, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reloading a page..
On March 23, 2003 02:34 pm, Beauford.2002 wrote: > The link in question is there by design and should be there, but > below is what I am talking about. > > > Even better, if a user cannot be validated then you can redirect > > them back > > to where they > > > came from (referrer). That would effectively achive your goal by > > refreshing the original page no matter where they;re coming from. > > This is what I have, but no matter what I do I can not get a > message to appear on the referring page saying you have no access > to the other page, and I have also read that 'HTTP_REFERER' is not > very reliable No you shouldn't rely on it to do anything important but in your case its just where the user will be redirected to. Even if someone fakes the referrer to point to the restricted page it will just go into an infinite loop. > if($userlevel != $neededlevel) { > include ($_SERVER['HTTP_REFERER']); > $message = $no_permission; > $exit; > } > > ...on referring page > > Code seems fine. You probably are never entering into that if statement or the referrer is outputting something unexpected. Use some print statements to debug this.. print("{$userlevel} and {$neededlevel}"); print($_SERVER['HTTP_REFERER']); Of course make sure $no_permission actually contains a string... Leo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Generated input names
Greetings! I have several (up to 100) input boxes being generated on the fly. I need to somehow grab the names generated for each one to then insert the values into a database (MySQL), one per row. I've looked at variable variables on php.net, but I thought I would pick your brains, just in case any of you have had the same situation. All suggestions are greatly appreciated! -- Richard Whitney * Transcend Development Producing the next phase of your internet presence. [EMAIL PROTECTED] * http://xend.net* 602-971-2791 * * * * * *__** _/ \___ * * / *\** */ * * \ **/\_ |\ / \_ / \ / \/\ / \ /\ / \ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Generated input names
By the way, some names are various colorsappended with a size letter (i.e. BlackM, GreenXL, etc.) others are simply a letter incremented starting with a. Thanks Quoting Richard Whitney <[EMAIL PROTECTED]>: ### Greetings! ### ### I have several (up to 100) input boxes being generated on the fly. ### I need to somehow grab the names generated for each one to then insert ### the ### values into a database (MySQL), one per row. ### ### I've looked at variable variables on php.net, but I thought I would pick ### your ### brains, just in case any of you have had the same situation. ### ### All suggestions are greatly appreciated! ### ### -- ### Richard Whitney * ### Transcend Development ### Producing the next phase of your internet presence. ### [EMAIL PROTECTED] * ### http://xend.net* ### 602-971-2791 ### * * * ### * * *__** ### _/ \___ * ### * / *\** ### */ * * \ ### **/\_ |\ ### / \_ / \ ### / \/\ ###/ \ ### /\ ### / \ ### ### ### -- ### PHP General Mailing List (http://www.php.net/) ### To unsubscribe, visit: http://www.php.net/unsub.php ### ### -- Richard Whitney * Transcend Development Producing the next phase of your internet presence. [EMAIL PROTECTED] * http://xend.net* 602-971-2791 * * * * * *__** _/ \___ * * / *\** */ * * \ **/\_ |\ / \_ / \ / \/\ / \ /\ / \ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] require_once for php3
hi there is a way to include files once in php3 ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] require_once for php3
You could write a wrapper around the include function that uses a global array, each time it is called it checks the global array to see if the file has been included, if it hasn't it includes the file and adds the file to the array. Jason daniel wrote: hi there is a way to include files once in php3 ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reloading a page..
It's definitely going through the if statement as it does "reload" the page - print($_SERVER['HTTP_REFERER']); shows http://www.myserver.com/oldpage.html - which is correct. print("{$userlevel} and {$neededlevel}"); also shows the correct info. $no_permission does have a string, but even if I hard code the message it still doesn't work. Note thoughif I take out include ($_SERVER['HTTP_REFERER']); from the if statement and put in print($_SERVER['HTTP_REFERER']); and print $message - they both display. So I am at a loss > No you shouldn't rely on it to do anything important but in your case > its just where the user will be redirected to. Even if someone fakes > the referrer to point to the restricted page it will just go into an > infinite loop. > > > if($userlevel != $neededlevel) { > > include ($_SERVER['HTTP_REFERER']); > > $message = $no_permission; > > $exit; > > } > > > > ...on referring page > > > > > > Code seems fine. You probably are never entering into that if > statement or the referrer is outputting something unexpected. > Use some print statements to debug this.. > > print("{$userlevel} and {$neededlevel}"); > print($_SERVER['HTTP_REFERER']); > > Of course make sure $no_permission actually contains a string... > > Leo > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php based spreadsheet-like app?
Hi, Does anyone know of a php (or other really) based web app that provides spreadsheet like tables with formulae support? Cheers, Brad -- Bradley C. Goldsmith <[EMAIL PROTECTED]> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] what should I do?
My server has cURL built into its php module, but it doesn't support SSL, and thus doesn't support requests to secure servers, i.e. https. It was an effort in itself to get them incorporate cURL, and I was just wondering if I should move immediately to a new host - if this were just ridiculous. I needed cURL badly in order to process credit card transactions, now I don't even have the option. I supposed I could use the PHP wrapper with the API, but it looks difficult and the processing company (Linkpoint) really doesn't seem to have their stuff together as far as support goes, or anything for that matter. What should I do? If I should move, could anyone suggest a decent host that could handle the aforementioned? any help would be greatly appreciated... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Generated input names
On Monday 24 March 2003 12:04, Richard Whitney wrote: > By the way, some names are various colorsappended with a size letter (i.e. > BlackM, GreenXL, etc.) > > others are simply a letter incremented starting with a. If I was doing this I would put all form elements into an array and thus name them like: "form[BlackM]" "form[GreenXL]" etc Then I can just for-loop through $_POST['form'] (or $_GET['form']) to get everything single form element. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* "I'm a mean green mother from outer space" -- Audrey II, The Little Shop of Horrors */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] odd problem
hello all, having a little problem. I know i have a connection to the mysql database but for some reason i can't get this to update the database when submit is clicked. perhaps i am overlooking something.. Here is part of the script: if($HTTP_POST_VARS[send]) { $result = $db->sql("UPDATE comments SET reported = '1' WHERE id = '$HTTP_GET_VARS[comment]'"); } // some echos.. echo " "; Its suppose to update mysql once the submit button is pressed, but its not.. Is the form ok? cheers, - Sebastian
Re: [PHP] reloading a page..
On March 23, 1998 08:53 pm, Beauford.2002 wrote: > It's definitely going through the if statement as it does "reload" > the page - print($_SERVER['HTTP_REFERER']); shows > http://www.myserver.com/oldpage.html - which is correct. > print("{$userlevel} and {$neededlevel}"); also shows the correct > info. $no_permission does have a string, but even if I hard code > the message it still doesn't work. > > Note thoughif I take out include ($_SERVER['HTTP_REFERER']); > from the if statement and put in print($_SERVER['HTTP_REFERER']); > and print $message - they both display. > > So I am at a loss OH I think I've got it. the problem is that you're including the page before you set the message. So of course in the include the $message will still be an empty string and therefor not display it. so rearange the two lines like this: $message = $no_permission; include ($_SERVER['HTTP_REFERER']); and it should work. HTH, Leo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Generated input names
Thanks for your suggestions everyone - I have the problem under control! Richard Quoting Jason Wong <[EMAIL PROTECTED]>: ### On Monday 24 March 2003 12:04, Richard Whitney wrote: ### > By the way, some names are various colorsappended with a size letter ### (i.e. ### > BlackM, GreenXL, etc.) ### > ### > others are simply a letter incremented starting with a. ### ### If I was doing this I would put all form elements into an array and thus ### name ### them like: ### ### "form[BlackM]" ### "form[GreenXL]" ### etc ### ### Then I can just for-loop through $_POST['form'] (or $_GET['form']) to get ### ### everything single form element. ### ### -- ### Jason Wong -> Gremlins Associates -> www.gremlins.biz ### Open Source Software Systems Integrators ### * Web Design & Hosting * Internet & Intranet Applications Development * ### -- ### Search the list archives before you post ### http://marc.theaimsgroup.com/?l=php-general ### -- ### /* ### "I'm a mean green mother from outer space" ### -- Audrey II, The Little Shop of Horrors ### */ ### ### ### -- ### PHP General Mailing List (http://www.php.net/) ### To unsubscribe, visit: http://www.php.net/unsub.php ### ### -- Richard Whitney * Transcend Development Producing the next phase of your internet presence. [EMAIL PROTECTED] * http://xend.net* 602-971-2791 * * * * * *__** _/ \___ * * / *\** */ * * \ **/\_ |\ / \_ / \ / \/\ / \ /\ / \ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re[2]: [PHP-DB] mysql timestamps
JWH> SELECT TO_UNIXTIME(your_column) FROM table ... It doesn't work... MySQL returns error - what could be trouble in? I also tried SELECT TO_UNIXTIME(foo) AS bar FROM baz But it's look like it doesn't know such function :\. I tried table in next types: TIMESTAMP,DATETIME. -- Best regards, L0vCh1Y -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] odd problem
"Sebastian" <[EMAIL PROTECTED]> wrote: > having a little problem. I know i have a connection to the mysql database > but for some reason i can't get this to update the database when submit is > clicked. perhaps i am overlooking something.. Here is part of the script: > > if($HTTP_POST_VARS[send]) { > > $result = $db->sql("UPDATE comments SET reported = '1' WHERE id = > '$HTTP_GET_VARS[comment]'"); > > } from where do you get this: $HTTP_GET_VARS[comment] ?? ( GET <--> POST, 'comment'? ) > echo " > > > > "; > > Its suppose to update mysql once the submit button is pressed, but its not.. > Is the form ok? looks ok -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: [PHP-DEV] [systems] cvs server moving
All, I think everything is now moved; cvs checkouts should still be fine, and as dns changes over, commits will become possible again. (if you need to make a commit now, please tell your system that cvs.php.net happens to point at pb11.pair.com) When dns converges, work will continue on lxr and bonsai to return them to service. Thanks, James Cox > > Just a heads up, > > we should be moving the cvs apparatus from one server to another > in the next > few hours. The only down time will be whilst your dns updates, > and this will > _only_ affect cvs COMMITS -- not checkouts. > > Thanks for your patience. > > James Cox > php sysadmin > > -- > James Cox :: [EMAIL PROTECTED] :: http://imajes.info/ > Was I helpful? > http://www.amazon.co.uk/exec/obidos/wishlist/23IVGHQ61RJGO/ > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [systems] cvs server moving
Just a heads up, we should be moving the cvs apparatus from one server to another in the next few hours. The only down time will be whilst your dns updates, and this will _only_ affect cvs COMMITS -- not checkouts. Thanks for your patience. James Cox php sysadmin -- James Cox :: [EMAIL PROTECTED] :: http://imajes.info/ Was I helpful? http://www.amazon.co.uk/exec/obidos/wishlist/23IVGHQ61RJGO/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php