[PHP] my first PHP...posting in forms
hi All, I got this simple form. Input is submitted using POST to another script. In this other script the variables/values pairs are used. I tested these scripts on several ISP's, no problem everything goes fine. Now I migrate the scripts to a different ISP, and voila, the input fields are not transported. Everything is empty. Anybody has any idea why this is? is this a PHP configuration thing? Maybe something to do with GPC order?? Any idea's are most welcome! thx Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] timout in mail script
Hi all, I have this script sending 1000 personalized emails. However when I press the start button in my browser so the script starts mailing I get no response for a long time from the script. Most of the time I don't get any response. When I retrieve all the emails I just sent (to myself, using 1000 aliases), I retrieve e.g. 1396 emails. Anybody knows how this is possible? Is it possible that the script is adressed again by the browser, so the whole mailing process starts again? regards Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] array
Hi all, I'm making a bulk send mail program script. In this script I use an array: now this works fine: $send_vars = array( 'recipients' = array('[EMAIL PROTECTED]','[EMAIL PROTECTED]','[EMAIL PROTECTED]') ); however the recipients are hardcoded in the script, so I'm trying to catch these in a variable $emailadress: $emailadress=array('[EMAIL PROTECTED]','[EMAIL PROTECTED]','[EMAIL PROTECTED]') ; $send_vars = array('recipients' = $emailadress); However this does not work. what is going wrong here?? thx if you can help me! many regards WIlbert Enserink - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] array - and eval
Hi all, I'm making a bulk send mail program script. In this script I use an array: now this works fine: $send_vars = array( 'recipients' = array('[EMAIL PROTECTED]','[EMAIL PROTECTED]','[EMAIL PROTECTED]') ); however the recipients are hardcoded in the script, so I'm trying to catch these in a variable $emailadress: $emailadress=array('[EMAIL PROTECTED]','[EMAIL PROTECTED]','[EMAIL PROTECTED]') ; $send_vars = array('recipients' = $emailadress); However this does not work. what is going wrong here?? thx if you can help me! many regards WIlbert Enserink - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] storing html pages in a database
Hi all, for reasons I'm thinking of storing complete HTML pages in a database. lets' say a HTML file size is about 20kb. Are there any restrictions i doing this? Is this 20kb alot for a mysql database, does it become slow? Should I save the file as binary data rather the ASCII?? Any tips with regard to this subject are most appreciated. thx Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] wfrite and chmod security stuff
hi all I'm trying to do the following: a user can log in on a site where he/she can change the contents of a css-stylesheet file with the aid of forms. The results of the form input are used to wrie a css file on the webserver which later will be used in the HTML files of the website. I know how to read/write to the server. But after the action I have to chmod the file which was created. I don't want users to input php code or perl code which can then be executed by calling the urlAnybody knows how to do this? In the example file below I use the chmod function. I tried nearly every value (not only 0777), but still you are able to enter php code, goto the url and ...voila the script is executed. Any ideas would be most welcome. Wilbert //start of fwrite.php-- ?php //this file is called write.php global $filename,$filecontent; if (!(isset($stage))) { if (file_exists($filename) and ($filename)) { $fd=fopen($filename, r);//open file read only $fstring=fread($fd,filesize($filename)); } ? html body form action=fwrite.php method=post name=writefile id=writefile input type=hidden name=stage value=1 input type=text name=filename value=?php echo $filename?file nameBR textarea cols=20 rows=20 name=filecontent id=filecontent ?php echo $fstring? /textarea input type=submit name=submit value=save to file /form a href=?php echo $filename??php echo $filename?/a /body /html ?php } else { $fd2=fopen($filename, w+);//open file chmod($filename,0777); $fout=fwrite($fd2,$filecontent); header(location:fwrite.php?filename=.$filename); } ? //end of fwrite.php - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] safe mode
Hi all I'm having troubles with the safe mode. My ISP has safe mode ON. Now i'm busy accessing files, deleting uploaded files, moving them and so on. Different actions are performed by different scripts. I want to make use of functions like stat() and so on, but each time I get the warning: Warning: file_exists() [function.file-exists]: SAFE MODE Restriction in effect. The script whose uid is 884 is not allowed to access /opt/guide/www.company.com.nl/HTML/myDir owned by uid 99 Since safe mode is ON and I can't change it in php.ini of my ISP I am wondering what to do now? There is this whole lot of file functions which I wanna use, but each time I'm getting the warning or warnings that look like the one above. I already tried ini_set(safe_mode,0) but since the script is already accessed this action comes too late and even more important, according to the manual this entry can be set only in php.ini or httpd.conf (PHP_INI_SYSTEM) . Does anybody know a safe workaround for this phenomenon? Any tips are most welcome! Regards Wilbert Enserink - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] money
Hi all, I'm busy making a swebstore. I have troubles with the format of money. I wanrt to display amounts like 2 products a ? 6,25 = ? 12,50 Whatever I try I can't get the comma there (it's showing a point . and it doesn't display the second number behind the comma i.e. 12.5 Anybody knows how to make me my money? :-) regards Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] catching a robot or spider
Hi all, does anybody know a way to make a distinction between robots and users? should I use the user agent? Or is this not a safe method. If the visitor is a spider/robot I want to include some script containing extra URL's for the robot. regards Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] magic_quotes_gpc
Hi all, I have a quetion on magic_quotes_gpc. The php.ini file on my test servers shows that magic_quotes_gpc=On. The php.ini file on the production server shows that magic_quotes_gpc=Off. == I know this is a strange thing:-( So you guess what happened: all the scripts I have don't function well. All input fields got escaped in the test environment but don't get escaped in the real environment. So when I input the name o'brien you gueass what happens. My Q: Is there a way to set the value for magic_quotes_gpc ?? Or is there another solution. Or should I adjust all my scripts and use addslashes/stripslashes each time I put something into mysql databaseor retrieve something from the db. I searched the manual but I could only find info about retrieving the value of get_magic_quotes_gpc and stuff about setting the value for set_magic_quotes, but there is no such a thing for set_magic_quotes_gpc. Any help on this would be largelly appreciated! Wilbert Enserink - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] page expires
Hi all I'm using a lot of php in my website. Especially forms. but Aftre a form submit I get this message from IE that the page is expired and I have to push Refresh. Does anybody know why this is happening and is there a way to avoid this message?? thx. Wilbert Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you. To resubmit your information and view this Web page, click the Refresh button. - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] user and password for socket connection
Hi all, I'm trying to open a socket connection on a client. The server needs a username/password combination for this connection to accept. Does anybody know how to send this with php?? In ASP I use xmlhttp.Open POST,sURL, false, sUser, sPass ,where sUser=myUsername and sPass=myPassword. this script worx, but of course I want to use PHP :-) in php i'm trying. $hostname=https://www.url.com;; $port=443; $loginmessage=GET / HTTP/1.0\r\nHost: www.php.net\r\n\r\n; $timeout=30; $fp = fsockopen ($hostname, $port, $errno, $errstr, $timeout); if (!$fp) { echo $errstr ($errno)br\n; } else { fputs ($fp, $loginmessage); while (!feof($fp)) { echo fgets ($fp,128); } fclose ($fp); } thx Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] connection with bibit (XML)
Hi all, I am trying to set up a connection between my site and a payment system (bibit). Does anybody know some good URL's which can help set up the connection and parse all XML messages. I'm sure this must have been done before...so there should be no reason to invent the wheel again. thx. Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] mysql error or PHP
Hi all, has anybody ever seen this? And knows what it means? thx. You have an error in your SQL syntax near 's self-supporting ribbed form was probably not strong enough to render the desig' at line 1 regards Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] add to basket
Hi all, What's the best way to implement functions like 'add to basket' or 'add to wishlist' and so on. I mean: you are on a page with detail information about a product. If the user clicks the link for 'add to basket' I have to perform a piece of script and then go back to the detail page of the given product. But clicking on this link leads me away form the page... I was thinking of using $HTTP_REFERER i the ad_to_basket.php page in order to retrieve the last url, but now I don't know how to go back to this detailpage, is there a php command for this, or is my approach totally wrong?? Any comments would be appreciated, regards. Wilbert Enserink - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] mcrypt.dll
Hi all, I'm using windows XP, apche and php 4.01 I need to test with the libraries mcrypt, so I guess I need mcrypt.dll. Anybody has any idea how to do this, or to get more info about this? thx Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] mysql/php how to retrieve the right column with 2 columns of the same name
Hi all, I have to tables A and B. They boyh have a column with the same name. Now, I wrote this MySQL statement performing a left join. This results in a data set with rows consisting of 2 columns of the same name, in which the date is stored when the record was last altered. This column is called last_altered. Later on in my script I'm calling the value of this column with php. $query=select * from tblA LEFT JOIN ; $resultID=mysql_query($query); while ($result_row=mysql_fetch_array($resultID)) { echo $result_row[column with the same name]; } Well, this works without any php or mysql errors, but it is giving me the data back of that column wich I don't wanna have...It returns the last_altered date of tblB in stead of tblA. A solution might be te exclude the second column (the wrong one) from the select statement in the query. This is a MySQL adjustement. Anybody knows how this can be done?? Maybe there are also PHP solutions which I don't know of...? thx Wilbert Enserink - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] session vars and frames
hi all, I'm registering if people are logged in. The login page is situated in the mainFrame. Now in my leftFrame I want to put the status (i.e. you are logged in as .) When people are succesfully logged in I register their name as session_register('session_loginname'); I then refresh the leftFrame. In the page to be displayed in the leftFrame I put: ?php if (!isset($session_loginname)) { echo you are not a member; } else { echo login: $session_loginname; } ? However, my leftFrame page keeps on displaying you are not a member So I was wondering: is there something with sessionvariables and frames which I don't know?? If anybody has any ideas I would be happy to hear them. regards Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] previous, current and next while looping
Hi all, I'm doing this query and looping through the results: $result_ID_ID=mysql_query($gallery_list_query) OR die(mysql_error()); $counter=0; while ($queryresult_IDresult=mysql_fetch_array($result_ID_ID)) { $result_array['$counter']=$queryresult_IDresult; if ($result_array['$counter']['galleryID']==$galleryID) { $current_number=$counter+1; $current_item=current(($result_array)); $next_item=next($result_array);///this doesn't seem te work. } $counter=$counter+1; } When it has found the right record with ID number $galleryID I also need the previous record and the next record. Anybody has any clue how to do this? thx Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] sessions and temporary tables
hi all, i have this problem: 1) on the start of each script I call session_start() 2) on my search.php page I query an info-table, put the results in a temporary table called $SID(=session_id()), and display the results. As a check I also query the table $SID and voila: the results were indeed stored in this temporary table. 3) On my next page there is this checkbox which says: search within these results. 4) If this checkbox is checked I query the $SID table rather then the info table. 5) but now I get this error: Table 'dbname.ed61c337640e2b0ab8f3ffccb63f8597' doesn't exist as a check I print $SID on each page. and always it is the same SID, which makes sense cause i'm still in the same session. My Q: howcome mySQL is not able to find this temporary table anymore It seems to have destroyed this table when leaving the search.php page, but that's a rather odd idea, cause I thought it maintained while the session was still active... any input is largely appreciated! thx and regards, Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] session and temporary tables 2
Jason, this is a piece of code i include in every file. I thinbk this is the piece of code which kills my connection. do you have any tips for me how to maintain the connectoin open? thx Wilbert session_start(); $global_dbh = mysql_connect($hostname, $username, $password); if (!$global_dbh) { mail([EMAIL PROTECTED],dbconnect, no connection posiible from $REMOTE_ADDR); die(No database connection could be established) ; } mysql_select_db($db, $global_dbh); -- - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] session variables in OOP....
Hi all, I'm busy building a site which uses OOP. Several classes are used to constuct different sections of the final page to be displayed. The overall class is called class.basepage.php This is the page which outputs HTML and calls other classes to construct other parts of the page. Now I have this problem: In one of the objects I use session variables. However i get the famous error :Cannot send session cookie - headers already sent by (output started Is there a way to overcome this problem? I mean: the session variable is registered in the main part of the page after the class $this-header is called (which writes HTML)... now, I don't think I can register the sessionvariable at the top of my script since the value of the session var is determined in the main.class...or can I? I hope you understand my problem and have some tips for me. Below is some code snippets I'm using: thx and regards Wilbert Enserink class.basebape.php--- ?php $this-header(); ?// includes a php file which writes HTMLcode functioning as the header of the HTML page (i.e. navigation menu) ?php $this-main(); ? // includes a php file (main.php) which writes the main part of the HTML data --- ---main.php-- echo a lot of HTML depending on queries and stuff; session_register($variable); output browser-- Warning: Cannot send session cookie - headers already sent by (output started at /opt/guide/www.designmatcher.com/HTML/wwwtest/class.basepage.php:125) in /opt/guide/www.abc.com/HTML/wwwtest/phpincludes/main/main.php on line 400 - - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] next and previous buttons performing on a query
Hi all, I have this mySQL query giving me my result back. The info about the current db-record is showing. Now I want to display ' view next ' and ' view previous ' buttons on my website. which takes you to the same page but with the next record in the query result. Is there a clever way to do this? Any tips are welcome! Many regards Wilbert Enserink - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] mysql dump -- via php
Hi all, I have a .txt file containing a mysql dump. Normally when I would restore this dump I would go to the mysql 'prompt' and type something like: mysql dimpfile.txt. I would use SSH or telnet for this. Now I have this new problem: I cannot reach the sql pompt via SSH/telnet. Is there any other way to create all the tables and records from the dumpfile.txt into the database on the database server?? Maybe it is possible to copy paste the sql statements into a php file which can do this? I can then upload this php file to the webserver and perform the job. Maybe anybody can advise me on the php code part of this solution. Regards, thx Wilbert Enserink - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] your philosophy on php-design
Hi all, I'm busy building a website. I cannot use frames. Every page can be divided in a table with 3x3 cells. The row will be my main menu. The first column wil be submenu. The middel cell will display the actual content. || --main menu-- |-- |--- sub | main |sub content menu | content | || |-- |-- --footer-- || the main menu will always be the same, same as the footer -- includes the main content cell depends on which submenu function is choosen. Some submenu items are: login search in database add to your favourite items add to basket Now I was wondering how to build my site. How should I deal with a function like 'add to basket'. I mean, when a certain item is displayed and the customer wants to add it to their basket I have call the script add_to_basket.php or something like that. However I don't want to leave the page where the item is displayed, cause that's confusing to the visitor. Even more..In the 'sub-content' cell I want to display data about ordering info, like there are so many items in the basket. So I have to call upon a script which stores the info about add_to_basket, load a total new page where 1 table cell changes, namely the sub-content cell, but still displayes the original product. So, If I were to use frames It could be done, but now I'm not thinking of frames but of displaying content dynamically in a tabe cell. I would very much appreciate your expert opinion on this matter, I'm sure every idea helps me form my own ideas which I can use. maybe there are people out there who have done this kind of thing, or know about large sites which use this same concept Any philosophies are much appreciated! Wilbert Enserink - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] mySQL WHERE/LIKE
Hi all, I know this is rather OT, but I searched the mySQL manual all over...couldn't find it. I want to perform a search in a table. More then 1 columns should be searched. namely column1 and column2 and so on. Anybody knows what goes wrong here? --(in the WHERE clause). It seems that mySQL doesn't like to perform a search in more then 1 column.:-( $query=SELECT * FROM gallery LEFT JOIN designers ON (designers.designersID=gallery.designersID) WHERE (gallery.column1, gallery.column2) LIKE '%$search_string%' ORDER BY gallery.galleryID; thx for any advice - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] session.save_path
Hi all, I'm trying to install php/apache with phptriad. This worked fine, however when I'm using session variables the thing goes nuts: Warning: open(/tmp\sess_d22b57336449f89ad54b974794dd53f4, O_RDWR) failed: m (2) in C:\apache\htdocs\dm\wwwtest\phpincludes\session\session.php on line 2 Warning: open(/tmp\sess_d22b57336449f89ad54b974794dd53f4, O_RDWR) failed: m (2) in Unknown on line 0 Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0 -- This is how my phpinfo() sees it: session.save_handler files files session.save_path /tmp /tmp session.serialize_handler php php session.use_cookies On On Does anybody have any idea what to do. Should I adjust php.ini?? And where should this directory /tmp be located?? cause it's not on my harddisk-- so this might be the error. (i'm on winXP BTW) well, thx for all info! regards Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] how to configure PHP (.ini) so I can use include() from any directory
Hi all, anybody knows how to configure PHP (.ini) so I can use include() from any directory instead of declaring specified paths in php.ini? I'm currently using php 4.05 with apache 1.3 something on a winXP test machine regards. Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] SQ: what does the sign do
Hi all, maybe this is a stupid Q, but lately I'm diving into OOP. Below you can see a piece of example code from the manual. my Q: what does the sign do in functioncb_modify( $item,$key) ?? I noticed this sign is used more, so it should be handy, but hwat does it do? thx Wilbert - class mod { var $thearray; function mod( $a ) { $this-thearray = $a; } function cb_modify( $item, $key ) { $item = pref_.$item; } function modify() { array_walk( $this-thearray, array( $this, 'cb_modify' ) ); } } $m = new mod(array(one,two,three)); $m-modify(); print_r($m); which prints out: mod Object ( [thearray] = Array ( [0] = pref_one [1] = pref_two [2] = pref_three ) ) - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] select statement
Hi all, I want to select some records with e.g. ID's 1,3,7 and 8 How can this be done best? is it: SELECT * FROM myTable WHERE ID=1,3,7,8 ?? thx. Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] html mail
Hi all, I'm studying some mail scripts written in php. When sending html mail the scripts all use a method that involves sending an html file as attachment. Why not use the mailsend function and send a string containing the whole html code? a code snippet example from a mail script: -- $file = mail.html; $mail-Body( This mail is formatted in HTML - shame on me ); // inline intructs the mail client to display the HTML if it can $mail-Attach( $file, text/html, inline ); -- What I want is to send personalized html mail to users in a db-table. So the body of the mail starts with something like Dear user I mail you because you are interested in: interests and so on. I hope my question is a bit clear to everyone. happy greetings, Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] security
Hi all, I'm building a site where customers can store their personal information. I'm thinking of storing their creditcardno's also. Can you give me some general tips with regard to security. What is the way to go here? thx. Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] mySQL back up
Hi all, I have a mySQL back up q: I have a textfile which is filled with statements as: -- DROP TABLE Clients\g CREATE TABLE Clients( ID INT, date BLOB, name BLOB, age BLOB, PRIMARY KEY (ID) )\g INSERT INTO Clients VALUES ('all record data')\g INSERT INTO Clients VALUES ('next record data')\g ..and so on --- My Q: How an I restore the tables as mentioned in my text file? Is it possible to 'run' this file so to speak? thx in advance!! Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] db design
hi all, I need some tips on database (mySQL) design. The problems lie in languages. I'm gonna make a e-commerce webiste. it's rather big (in my terms/experience). The website should be expandible easily with regard to languages/translations. My biggest table with product descriptions has 43 columns. Other tables include a list of FAQ's, manufacturers and so on. What do you think I have to do? Make a new table for each language, or define more columns for each language within a table? What is normal in this, also with regard to doing queries? e.g. In the table with 43 columns, there are 11 columns which are the same for each language (product name, manufacturer and so on) The other columns will depend on language (like product description). --If I use a seperate table for each language than there is double info (no normalization with regard to the 11 columns) --If I use more columns, than I have 32 columns extra per language. If I make 10 translations, then this table will reach over 10x32=320 columns. I need somebody who can give me overall info on this, or shine a broad light on my Q. Does the db design has a large influence on flexibility with regard to future expanding? And how about query times (response) on a server. I don't want it to get too slow Well I think, you know my point now, any info is much appreciated!! thx in advance, Wilbert Enserink - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql backup function in php?
Hi all, i searched the manual for a php backup function for a mysql DB. I can't seem to find it, but i'm not sure whether it exists. mysql_backup_db maybe?? thx. Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] need some advice; small server on a win98 machine.
Hi all, I'm a php programmer building my first server. I think I need some advice. I'm trying to build a very small server on a win98 machine. I just installed PWS, then I installed PHP4 as a CGI module using the 'self'-installer from php.net. Then I installed mySQL, latest version. I know PWS worx, since all local pages can be seen through the browser (also asp pages). mySQL also worx. I can perform mySQL statements in my DOS window. But somehow the php code doesn't function/isn't parsed right. The code isn't really executed, but displayed as HTML in my browser. Can anybody give me some advice, on what is going wrong? Any tips are much appreciated! Thanx. Wilbert Enserink - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] mysql on php4.1.1 on my Win98SE laptop running PWS
Hi all, maybe one of you can help me a bit in the right direction. I just installed the windows self installer (php4.1.1) on my Win98SE laptop running PWS. It is stated that it is cgi only and built in MySQL support. I installed it succesfully, but now I want to create a MySQL db. anybody has any clues how to do this? Is it just enough to write a php script in which the mysql_create_db(localhost) statement is used? and what about it's ports, sockets, passwords, usernames etc.?? Of course any push in the right direction is appreciated. Thx. regards, Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] sending out an sms
hi all, i'm busy studying and gathering info about sending sms messages from my website. Anybody knows any good urls where I can find more info (or scripts) about sending sms to a given telephone number. My knowledge about this subject is about zero. thx. Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] headers
Hi all, my q: The results of a form are being POSTed to a php script. There I play around with the inputted variables. Now I want to post them again to a new script. I know I should use header(location:http://www.xxx.yyy/somepage.php) But how do I construct the header which is used to post my variables ($var=value)to the page at www.xxx.yyy/somepage.php I tried this: $var=value; header(Location:http://www.xxx.yyy/somepage.php;); header (var: value); but it didn't work any ideas on constructing a header are welcome!? Thanx in advance, regards, Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] headers
that's more like a GET method. I prefer the POST method in my case (GPC-order). But thx for the input! - Original Message - From: George Pitcher [EMAIL PROTECTED] To: Wilbert Enserink [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, December 05, 2001 1:18 PM Subject: Re: [PHP] headers I'm a newbie but how about: header(location: http://www.xxx.yyy/somepage.php?var1=$var1) and so on. And location: needs a space after it! George _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] session
hi all, i'm trying to use session variables. people can login using a loginform. if they are already logged in I want the previous session to be destroyed before the new session starts. if it's their first login the session shoulds also start. if I first login with name1/password1 I give url1 back If I then login with name2/password2, url2 should be given back, however when I print all sessionvariables they are still filled with the properties of the first login (also url1). Is there some way to avoid this problem? it seems that the sessionvariables are not really destroyed. Or is it that i'm using both session commands (start and destroy) in the same script. thx to anyone who can shine a light on this... Wilbert code --- ?php if (isSet($sessie_loginnaam)) { session_unregister('sessie_loginnaam'); session_unregister('sessie_status'); session_unregister('sessie_url'); session_destroy(); } more code--- session_start(); session_register('sessie_loginnaam'); session_register('sessie_status'); session_register('sessie_url'); ? - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] browsing permission
Hi all, anybody knows a way to protect a directory on my webserver from browsing via a webbrowser. browsing is only permitted after users have logged in via a form on the website (so, I'm not able to use htaccess). thx. Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] authentication
Hi all, Can anybody help me with this authentication problem? Clients can log in using a html form on my site. When they log in their username and password are checked in a mysql database. Then they are forwarded to a url, a directory on my site also coming from the db. This directory should not be public of couse, so I did a chmod 744 on the clients directory. Anybody has any ideas? I prefer not to use the standard window popup thing for authentication. I checked the php manual, but there is not much info on plain html forms on the subject, or maybe it is my English...:-) Regards, Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] redirect
Hi all, I have the simplest question maybe, but I can't seem to find the answer. It's friday. Anybody knows how I can redirect to another url? greetings Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] file upload
Hi all, i'm using php version 4.0.5 and i'm playing around with the file upload command using form and script which i copied from php.net Unfornunately the script is giving an error: Warning: Unable to open '/tmp/phpmOSK48' for reading: No such file or directory in /opt/guide/www.abc.de/upload/upload.php on line 8 Warning: Unable to move '/tmp/phpmOSK48' to '/tmp/phpmOSK48' in /opt/guide/www.abc.de/upload/upload.php on line 8 anybody got a clue what i'm doing wrong here? Thanx in advance! Wilbert -upload.html- html head /head body FORM ENCTYPE=multipart/form-data ACTION=upload.php METHOD=POST Send this file: INPUT NAME=userfile TYPE=file INPUT TYPE=submit VALUE=Send File /FORM /body /html --upload.php-- ?php if (is_uploaded_file($userfile)) { copy($userfile, $userfile); } else { echo Possible file upload attack: filename '$userfile'.; } /* ...or... */ move_uploaded_file($userfile, $userfile); ? - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
Re: [PHP] file upload
thanx adrian. I humbly bow for da masta :-] Wilbert - Original Message - From: Adrian Ciutureanu [EMAIL PROTECTED] To: Wilbert Enserink [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, July 02, 2001 4:19 PM Subject: RE: [PHP] file upload Try this: --upload.php-- ?php if (is_uploaded_file($userfile)) { move_uploaded_file($userfile, $new_location/$userfile_name); } else { echo Possible file upload attack: filename '$userfile'.; } ? -Original Message- From: Wilbert Enserink [mailto:[EMAIL PROTECTED]] Sent: 2 iulie 2001 17:08 To: [EMAIL PROTECTED] Subject: [PHP] file upload Hi all, i'm using php version 4.0.5 and i'm playing around with the file upload command using form and script which i copied from php.net Unfornunately the script is giving an error: Warning: Unable to open '/tmp/phpmOSK48' for reading: No such file or directory in /opt/guide/www.abc.de/upload/upload.php on line 8 Warning: Unable to move '/tmp/phpmOSK48' to '/tmp/phpmOSK48' in /opt/guide/www.abc.de/upload/upload.php on line 8 anybody got a clue what i'm doing wrong here? Thanx in advance! Wilbert -upload.html- html head /head body FORM ENCTYPE=multipart/form-data ACTION=upload.php METHOD=POST Send this file: INPUT NAME=userfile TYPE=file INPUT TYPE=submit VALUE=Send File /FORM /body /html --upload.php-- ?php if (is_uploaded_file($userfile)) { copy($userfile, $userfile); } else { echo Possible file upload attack: filename '$userfile'.; } /* ...or... */ move_uploaded_file($userfile, $userfile); ? - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] pc/mac and ie/nav
Hi all, does anybody know a good piece of script or has a good tip for me how to detect platform and browser of the client? thanx in advance! Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] SQL statement for clearing a table
Hi all, anybody knows the mysql statement for clearing the contents of a table and lieving the table itself intact? Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] form values in db via loopin
Hi all, I'm rather new to php, but I'm busy making a mailform. Is it possible to loop through the entered fields in the mailform and perform the functions addslashes and htmlspecialchars and finally put the answers in my db? thanx, Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] mailform loop
Hi all, does anybody know if it is possible to loop through all the fields in a mailform. I want to perform the addslashes function and htmlspecialchars function to each entered value so i can put it in my db. Or should I make use of a standard good mailform script? and if so, does anyone know such a good script? wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] test
test - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] -
[PHP] no fetch
Hello everybody, I'm just starting out with php4 and I can use some help. Below is a script I wrote. The dbase connections are allright (i have tested them) , but the final result is 'no fetch'. so something goes wrong in 'mysql_fetch_row' but I don't understand what. Any of you have an idea? Thanx. W. Enserink ?php $global_dbh = mysql_connect($hostname, $user, $password); if(!$global_dbh) die(no dbase connection); $a = mysql_select_db('pdd', $global_dbh); if(!$a) die(no dbase selection); function display_db_table($tablename, $connection) { $query_string = select * from $tablename; print (querystring = $query_stringBR); $result_id = mysql_query($query_string, $connection); print(result_id = $result_idBR); $column_count = mysql_num_fields($result_id); print(column_count = $column_countBR); print(TABLE BORDER=1\n); while ($row = mysql_fetch_row($result_id)); { if(!$row) die (no fetch); print row = $row[1]; print(tr align = left valign = top); for ($column_num = 0; $column_num $column_count; $column_num++) print(TD$row[$column_num] $column_num/td\n); print(/tr\n); } print(/table\n); } ? html body tabletrtd ?php display_db_table(test, $global_dbh); ? /TD/TR/TABLE /body /html - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] @Listing - causing pasre error
Hi everybody, I want to write to a given file using the code below. Somehow I get the parse error. I thnk it has something to do with --- @Listing Is this a setting in my php.ini which is wrong or is the code maybe wrong (I copied it out of a php text book.) Thanx Wilbert body ?php if (IsSet($submitted)) { $fd = fopen($filename, "w+") or die("can't open the file $filename"); @Listing: $fout = fwrite($fd, $newstring); @Listing: fclose($fd); } $fd = fopen($filename, "r") or die("can't open file $filename"); $initstring = fread($fd, filesize($filename)); fclose($fd); echo "FORM METHOD = 'POST' ACTION=\"$PHP_SELF\""; echo "INPUT TYPE = 'text' SIZE = 50 NAME = 'newstring' VALUE = \"$initstring\""; echo "INPUT TYPE ='HIDDEN' NAME = 'submitted' VALUE = 1"; echo "INPUT TYPE = 'SUBMIT'"; echo "/FORM"; ? /body - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]