[PHP] XML and PHP
hi all, i would like to know where i could find more info on xml and working xml with php. thanks.
[PHP] problem with file download konqueror-internet explorer
hi all, i have the following code in a script whereby i send the filename to be downloaded. there is something that´s not working properly depending on the web browser (and probably the Operating system). now im working on php4,postrgesql,apache2 an mandrake 10 with Konqueror as my web browser. these are the scenarios: 1) when i call the page that is supposed to allow me to download the file i selected, with konqueror on the localhost, it works fine and on other mandrake - konqueror clients too. 2)when i do the same with an internet explorer on winxp the save as dialog comes up and when i choose the directory, the file that is actually downloaded is an html with only a few bytes. 3) when i deactivate the last line, readfile($filename ), on internet explorer with winxp, the internet explorer tries to open the file and show the contents in the browser. on mandrake with konqueror what happens is that it tries to download the file but says that connection was lost. any help would be highly appreciated!! thanx. if (isset($_POST['select'])) { $sel=$_POST['select']; $filename = $sel; $size = filesize($filename); header(Pragma: no-cache); header(Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0); header(Expires: 0); header(Content-Transfer-Encoding: binary); header(Content-type: application/octet-stream); header(Content-Disposition: attachment; filename=$filename); header(Content-Length: $size); readfile($filename); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] using require
hi all, i have my web site working something like this: in every php script i have require(auth.php). this auth.php has my connection to my postgresql server and database along with some other stuff i need for the user to be authenticated to my web site. when i log on, this auth.php connects to the dbserver and checks if my username and password are stored and then i go to a home page. my connection is stored in $dbh. what happens when i start moving through all these web pages (php scripts), each requires auth.php, with respect to the connection? is a new connection established for every web page i go into that uses my $dbh for querying purposes or is it the same connection i originally made when i first logged into the web site? any info will be highly appreciated!! thanx.
[PHP] downloading files
hi all, i've uploaded some files into my postgresql db, via a php script, and now id like to give a user the posibility to download these files via a php script. what would be the best way to do this bearing in mind that the files are 'integrated' into the db and are referenced by an oid. the table that contains the files has the original filename in one column and the oid of the file in another column besides other info on the table. any sugestion would be highly apreciated! thanx. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] file uploads and sizes
i have the following code that works except when the file i'm trying to upload excedes the upload_max _filesize and post_max_size defined in the php.ini file. what happens when the file is smaller than the max sizes mentioned previously, the if (isset .) part of the code is executed yet when the file exceeds both max sizes, i just get a blank page. what id like is to be able to give the user a message saying the file wasnt uploaded because the file was too big.so, how do i verify the size of the file the user is trying to upload? ive already tried $_FILES['archivo']['size'], but that doesnt work if the variable isnt set, which aparently happens when the file isnt uploaded because of the post_max_size. any help will be greatly appreciated!! thanx. ? if(isset($_FILES['archivo']) is_uploaded_file($_FILES['archivo']['tmp_name'])) { $archivo = $_FILES['archivo']['tmp_name']; $archivo_name = $_FILES['archivo']['name']; print You uploaded a file called {$_FILES['archivo']['name']} br/br; print of type {$_FILES['archivo']['type']} that is br/br; print {$_FILES['archivo']['size']} bytes long.br; $safe_filename = str_replace('/', '', $_FILES['archivo']['name']); $safe_filename = str_replace('..', '', $safe_filename); $dbh = pg_connect(host=localhost dbname=test user=postgres); if (!$dbh) { echo cannot open connection to the databasebr; exit; } else { chmod($archivo,0777); pg_exec($dbh,BEGIN); $sql = INSERT INTO pic_db (name, picoid) VALUES ; $sql .= ('$safe_filename', lo_import('$archivo')); $stat = pg_exec($dbh, $sql); pg_exec($dbh,COMMIT); pg_close($dbh); echo The file was saved succesfully.br; } unlink($archivo); */ } ? html body form action= method=post enctype=multipart/form-data input type=file name=archivo /form /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] file uploads and sizes
i have the following code that works except when the file i'm trying to upload excedes the upload_max _filesize and post_max_size defined in the php.ini file. what happens when the file is smaller than the max sizes mentioned previously, the if (isset .) part of the code is executed yet when the file exceeds both max sizes, i just get a blank page. what id like is to be able to give the user a message saying the file wasnt uploaded because the file was too big.so, how do i verify the size of the file the user is trying to upload? ive already tried $_FILES['archivo']['size'], but that doesnt work if the variable isnt set, which aparently happens when the file isnt uploaded because of the post_max_size. any help will be greatly appreciated!! thanx. ? if(isset($_FILES['archivo']) is_uploaded_file($_FILES['archivo']['tmp_name'])) { $archivo = $_FILES['archivo']['tmp_name']; $archivo_name = $_FILES['archivo']['name']; print You uploaded a file called {$_FILES['archivo']['name']} br/br; print of type {$_FILES['archivo']['type']} that is br/br; print {$_FILES['archivo']['size']} bytes long.br; $safe_filename = str_replace('/', '', $_FILES['archivo']['name']); $safe_filename = str_replace('..', '', $safe_filename); $dbh = pg_connect(host=localhost dbname=test user=postgres); if (!$dbh) { echo cannot open connection to the databasebr; exit; } else { chmod($archivo,0777); pg_exec($dbh,BEGIN); $sql = INSERT INTO pic_db (name, picoid) VALUES ; $sql .= ('$safe_filename', lo_import('$archivo')); $stat = pg_exec($dbh, $sql); pg_exec($dbh,COMMIT); pg_close($dbh); echo The file was saved succesfully.br; } unlink($archivo); */ } ? html body form action= method=post enctype=multipart/form-data input type=file name=archivo /form /body /html
[PHP] temp table : solution
hi, thanx for your input. i noticed that the last part of the create table query was the part that was causing the 'problem'. the on commit delete rows was deleting the values i inserted after executing the query therefore i couldnt select anything from it. i did try Richard Lynch's code and it works fine. thanx. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] temp tables
hi, im working with php 4 and postgresql 8 and in my php script id like to create a temp table on my database server. how do i do this? how do i verify it was created? i tried the following: $sql = create temp table s_info(a int, b text) on commit delete rows ; pg_query($dbh,$sql); $dbh is my connection. any help will be highly appreciated.
[PHP] converting word document to plain text file
hi, i need to store some files that contain text in my database. im planing to upload the file using a php script. what id like is to be able to take the info(text writen in the file) from the file and store it on a plain text file and then store it since i plan to consult the info in these plain text files later. the thing is that in case someone decides to upload a *.doc, *.rtf or *.pdf, i dont know how to read such files to get the text from them. is there a way to these types of files in php or some other way? thanx. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] image display
hi, what is the best way to display an image, that is stored in a database in postgres, in a table form along with other fields that are in the same table? postgresql 8.0 e.g my_table(name varchar(15),sex character (1), picture_id oid) in a table in php, i'd like to show all the rows in my_table with all the fields including the picture. thanx. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] error handling
hi, im working with php 4 and postgresql 8 and i would like to know how to handle certain errors generated. in postgresql, i've written a stored function that selects a record from a table and in case no record is found i 'raise an exception'. fine, now in my php script i call that the stored function which works properly when there is a record but when the record doesnt exist, i would like to be able to place my own error message and not e.g 'fatal error, .'. how do i capture(in php) the exception i raised in postgres so that i know the record doesnt exist? thanx. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] calling stored procedures from php
hi , i have a stored procedure in postgresql and id like to call it or execute it from php. how do call this stored procedure with its variables or parameters? thanx
[PHP] filtering uploaded files
hi, id like to know if there is a way to filter or specify what type of files id like uploaded to my server. for example, if i make a form to upload image files, when i click browse there are 2 fields one that'll store the file name(of the file selected) and the other filetype (usually say all types) what id like is to specify in file type : *.jpg,*gif etc. is this possible? thanx.
[PHP] modules
hi, im building a web site and i have seen some sites built using modules to facilitate further maintainance. by modules im referring to having a module for administrating the web site , another for searchs to be done, another for reports to be generated ect. i hope im explaining my self. what i would like are references to documentation on how to build such a web site using php (im working php 4). thanx.
[PHP] php.ini file
hi, i'm experimenting with php on mandrake 10 and i'm not sure about a few things. first, where should the php.ini file go? i mean in which folder. next, i need to upload files to a database and i dont know what folder to specify as the temp folder under the file uploads section in the php.ini nor what permissions to give such a folder. hope someone ca help ASAP! thanx in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php