Re: [PHP-DB] http_server_vars ???
At 09:02 PM 12/10/2001 -0500, John King wrote: >Trying to run a php script that involves a MySQL DB. Script needs to >reference these variables: > >$HTTP_SERVER_VARS['SQL_HOST'] >$HTTP_SERVER_VARS['SQL_USER'] >$HTTP_SERVER_VARS['SQL_PASS'] >$HTTP_SERVER_VARS['SQL_DB'] These are PHP Environmental/Global vars. Do a phpinfp(); to see the values of these variables... --Jon -- PHP Database 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-DB] http_server_vars ???
Trying to run a php script that involves a MySQL DB. Script needs to reference these variables: $HTTP_SERVER_VARS['SQL_HOST'] $HTTP_SERVER_VARS['SQL_USER'] $HTTP_SERVER_VARS['SQL_PASS'] $HTTP_SERVER_VARS['SQL_DB'] Are the above PHP variables from the server or just variables from a function? The script instructions state that if these are not set up for your domain, you will need to edit lines xx, xx of the _security.php file to fit your setup. Here is the relevant code from the _security.php file // create a class instance so we can use it $sql=new mysql_class($SQL_USER,$SQL_PASS, $SQL_HOST); if($HTTP_SERVER_VARS['SQL_DB']) $sql->SelectDB($HTTP_SERVER_VARS['SQL_DB']); else // This line may need to be edited if SQL_DB is not defined by the server // to point to the correct database. $sql->SelectDB('irrrb_org'); Thanks, John -- PHP Database 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-DB] HELP! ODBC-->SQL Server Authentication
Hello All, I am trying to use the windows authentication of the user surfing on the database I am connecting to. I have made myself a user on the database the ODBC DSN is pointing to. Here is the script: $db=odbc_pconnect("EOSTest", "", ""); $result=odbc_exec($db,"select system_user"); odbc_result_all($result); When I surf to this page, I am presented with the login, at which I enter my username, password and domain. And here is the result: Warning: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'., SQL state 28000 in SQLConnect in C:\Inetpub\Apps\provisioning\test.php on line 2 Warning: Supplied argument is not a valid ODBC-Link resource in C:\Inetpub\Apps\provisioning\test.php on line 3 Warning: Supplied argument is not a valid ODBC result resource in C:\Inetpub\Apps\provisioning\test.php on line 4 I have restricted the security on the page to just the domain admin group that I am in. So why would it be using an anonymous login? Something that may bear on this is that I had to uncheck "high encryption" in the ODBC configuration, because SQL Server did not support high encryption. Help! Thanks! -- PHP Database 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-DB] Re: Retrieving data woes
Thanks to Hugh and DL Neil for their answers. I got it working now with your help. Makes me feel dumb now! -- Andrés > > In your SQL request, sort by date. When printing the output, > keep track of the previous date - only print the date if it > changes. Something like > > $conn = mysql_pconnect($host, $usr, $pwd); > mysql_select_db("mydb"); > $sql = "SELECT id,date,time,title,body FROM mytable ORDER > BY date DESC"; > $res = mysql_query($sql); > > $date = "previous date"; > while($row = mysql_fetch_array($res)) { > if ($date != $row["date"]) { > $date = $row["date"]; > echo "$date"; > } > > echo "".$row["time"]." ".$row["title"]; > echo "".$row["body"]; > } > > > > -- > PHP Database 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 Database 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-DB] Shopping Cart Category help
Hey there everyone, Hope you are all doing good :-) I have a problem, I have a shopping cart system but I need to add sub-categories, how - using PHP with MySQL do I get the system to display sub-categories if they are found? I have category 1 as the main one which displays all products, but my clients needs require that some areas will have sub-categories (I guess ID 2) - how do I get it to display ID 2 if it is found? I know I sound mumbled, it's my age :-) Thank you everyone. Chris
[PHP-DB] RE: WYSIWYG HTML Editor with PHP
It depends on what platform and browser you expect contributors will be using to add content; ActiveX objects are only good for MSIE/Windows, while Java has a somewhat broader reach. WYSIWYG with HTML/DHTML/Javascript is klugey at best, even if it's PHP-based; PHP is great for making admin screens, handling database stuff and driving a template engine, but the UI is entirely dependent on the client's capabilities. And there are different levels of WYSIWYG; if you're just talking bold, italic, underline, you could probably get away with a VBulletin-style (http://www.vbulletin.com/) system where clicking a "B" button next to the text box drops an empty tag at the end of the text box contents. Or give users a simple tag reference. If you need a full-blown WYSIWYG HTML editor like Frontpage or Dreamweaver, you'd probably be better off looking in the ActiveX/Java direction. A couple of years ago I remember trying out an ActiveX-based home page editor called WebWowser that had an MS-Word style toolbar complete with Bold, Italic, Underline, Insert Image, Insert Table, and numerous other bells and whistles. IIRC it hooked into your FTP account on the WebWowser site and uploaded your desktop images & the pages you made in the editor seamlessly. It was pretty slick, but I guess not slick enough to turn a profit - the WebWowser site seems to have disappeared. I guess it comes down to who your user base is, how much control they're allowed to have in formatting their content, and how much handholding they'll need. Good luck, -Andy > -Original Message- > From: Ali Nayeri [mailto:[EMAIL PROTECTED]] > ...we need a very solid > CMS system > which has both management capabilities and if possible, has a web-based > WYSIWYG editor that is idiot-proof. The problem is, we are not > sure how to > start it. Can it be done using PHP or should be go with the traditional > Java or ActiveX objects. > Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP Database 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-DB] Retrieving data woes
Hi Andres, > I have what probably is a basic question, but can't figure out by > myself. If > any of you kind souls can point me in the right direction I would > appreciate > it. > > I have a db table that has these columns: > id, date, time, title, body > > some of the rows can have the same "date" and want to output the data > according to "date". Like so: > > dateA > timeA1, titleA1 > bodyA1 > > timeA2, titleA2 > bodyA2 > > dateB > timeB1, titleB1 > BodyB1 > > etc. > > Think of a weblog structure. I know how to output the information row by > row, but not like above. Can any of you help me? =use PHP to loop through the resultset: retrieve data while not eod //loop through resultset retrieved echo //output the blank line echo date while date_unchanged and not eod //loop through all the records for one day echo time, title echo body echo //output the blank line end while //date loop end while //resultset loop NB I use a function to return a data row from the resultset and flag eod as a boolean eod = end of data (in the resultset) =welcome to programming! =dn -- PHP Database 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-DB] Re: Retrieving data woes
"Andres Sulleiro" <[EMAIL PROTECTED]> wrote in message 002001c18193$eacb4450$[EMAIL PROTECTED]">news:002001c18193$eacb4450$[EMAIL PROTECTED]... > I have a db table that has these columns: > id, date, time, title, body > > some of the rows can have the same "date" and want to output the data > according to "date". Like so: > > dateA > timeA1, titleA1 > bodyA1 > > timeA2, titleA2 > bodyA2 > > dateB > timeB1, titleB1 > BodyB1 In your SQL request, sort by date. When printing the output, keep track of the previous date - only print the date if it changes. Something like $conn = mysql_pconnect($host, $usr, $pwd); mysql_select_db("mydb"); $sql = "SELECT id,date,time,title,body FROM mytable ORDER BY date DESC"; $res = mysql_query($sql); $date = "previous date"; while($row = mysql_fetch_array($res)) { if ($date != $row["date"]) { $date = $row["date"]; echo "$date"; } echo "".$row["time"]." ".$row["title"]; echo "".$row["body"]; } -- PHP Database 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-DB] Re: calculate size of remote url
"Chidambaram" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi > i have to calculate the size of a remote url > ex:http://www.ee.iitm.ernet.in/index.html > i have written a php script but it returns only > the size of html page it doesnot include the images > size in that file could anyone help me in this regard Is this for interest, for once-in-a-while data collection, or for run-on-every-request production code? You would have to parse the HTML file, extract the names of all the images (and CSS files, applets/ActiveX components, and javascript/vbscript inclusions) called, fully qualify the names, remove duplications (which would be served from the client's cache), request the files and check their sizes, then add it all up with some additional time for each request. Alternatively, you could wave your hands and come up with some sort of fudge factor; if you want to be a bit more accurate, set your super-complete-script to try a couple thousand random URLS and scatter-plot the results, HTML-only page size vs. total page size - less reliable but far simpler and faster. If the result is within 20% for 80% of the time, I would be happy. Note that any kind of generated or active page may vary wildly in size anyway - your approach would only work on totally static pages. -- PHP Database 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-DB] Problem with file upload...
> I already asked my provider if I have the rights to access the tmp/ file and > he says yes! but does php also have the right to put in your webdirectory? the problem is: php does not use your username and password. what I did (and I don't know if you've got the same problem), is fread all data from the tmp file into a string, fopen "w" a file in my webdirectory where I use my username and password, put all data from the string into that file. hope it helps. Leo Kuiper "Building a map in order to find what's not lost but left behind." - Beth Orton - Original Message - From: Michael <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 10, 2001 4:16 PM Subject: [PHP-DB] Problem with file upload... > Hi to all, > > I'm developing a cms and need to upload an inage and a pdf-file to the > server. Everything is just working fine, but when trying to upload any file > I get the following error: > > Warning: Rename failed (Invalid cross-device link) > in/www/971/html/admin/object_add.php on line 115 > > here's the code I'm using: > > if ($userfile != 'none') { >$b_id = mysql_insert_id(); >$bildpfad = '$pathname'; >$bildname = 'foto'.$b_id; >$pfadname = $bildpfad.$bildname; >echo $userfile; >if (rename($userfile,$pfadname)) { >echo "Datei $bildname wurde verschoben"; >$bild_url = 'fotos/'.$bildname; >} >else echo ('Bild wurde nicht verschoben'); >echo $pfadname; >$sql = "update objekte set bild_url = '$bild_url' where obj_id = > '$b_id'"; >echo $sql; >$res = mysql_query($sql); >if ($res) { >echo ("Die Bilddaten wurden gespeichert"); >} >else { >echo ("Probleme beim speichern des Bildes: " . > mysql_error().""); >} >} > > I hope somebody can help with this as I already spent several days without > results :-(( > > I already asked my provider if I have the rights to access the tmp/ file and > he says yes! > > Regards, > Michael > -- PHP Database 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-DB] Retrieving data woes
Hi all, I have what probably is a basic question, but can't figure out by myself. If any of you kind souls can point me in the right direction I would appreciate it. I have a db table that has these columns: id, date, time, title, body some of the rows can have the same "date" and want to output the data according to "date". Like so: dateA timeA1, titleA1 bodyA1 timeA2, titleA2 bodyA2 dateB timeB1, titleB1 BodyB1 etc. Think of a weblog structure. I know how to output the information row by row, but not like above. Can any of you help me? Thanks, Andres. -- PHP Database 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-DB] Re: how to make a dropdown list with sql content
"Venomous" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I need to make a dropdown menu from my mysql database but i don't no how to > come about > > It's the meaning that i don't get weird things in my database for instants > > PI 300 or pi 300 think about what your generated output should like like: something like First Item Second Item Third Item {...} So your PHP should do something like echo "\n "; while($row = mysql_fetch_array($conn)) echo "\n".$row["item"]; echo "\n 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-DB] Problem with file upload...
Hi to all, I'm developing a cms and need to upload an inage and a pdf-file to the server. Everything is just working fine, but when trying to upload any file I get the following error: Warning: Rename failed (Invalid cross-device link) in/www/971/html/admin/object_add.php on line 115 here's the code I'm using: if ($userfile != 'none') { $b_id = mysql_insert_id(); $bildpfad = '$pathname'; $bildname = 'foto'.$b_id; $pfadname = $bildpfad.$bildname; echo $userfile; if (rename($userfile,$pfadname)) { echo "Datei $bildname wurde verschoben"; $bild_url = 'fotos/'.$bildname; } else echo ('Bild wurde nicht verschoben'); echo $pfadname; $sql = "update objekte set bild_url = '$bild_url' where obj_id = '$b_id'"; echo $sql; $res = mysql_query($sql); if ($res) { echo ("Die Bilddaten wurden gespeichert"); } else { echo ("Probleme beim speichern des Bildes: " . mysql_error().""); } } I hope somebody can help with this as I already spent several days without results :-(( I already asked my provider if I have the rights to access the tmp/ file and he says yes! Regards, Michael
Re: [PHP-DB] undefined function: pg_connect()
On Monday 10 December 2001 22:33, Michael Hanna wrote: > I'm running apache 1.3.20 with php 4.0.6 and I'm trying to connect to > pgSQL 7.1.3(OS X 10.1.1). > > I'm certain pgsql support is on..this is from my ./configure o/p: > > checking for PostgreSQL support... yes > > but this code: [snip] > elba.dyndns.org/~michael/listcontacts.php It's better to include the output of the above within your mail so people (like me) who can't be bothered can still see what your error is. But from your subject it appears that pgsql suuport has *not* been compiled into PHP. To verify just run: If pgsql support is compiled in then you will see a table titled "pgsql". If you're pretty sure that you did compile in pgsql but do not see it listed then maybe you forgot to restart apache. hth -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* I never loved another person the way I loved myself. -- Mae West */ -- PHP Database 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-DB] calculate size of remote url
Hi i have to calculate the size of a remote url ex:http://www.ee.iitm.ernet.in/index.html i have written a php script but it returns only the size of html page it doesnot include the images size in that file could anyone help me in this regard I have written PHP code that returns file size and other properties regarding that file and i want to know the images size in the index.html file could any one help in this regard Stats for $filename"; foreach($file_info_array as $key=>$val) { echo ucfirst($key) . "=>". $val . ""; } ?> thanks E.chidmbaram For Stock Quotes, Finance News, Insurance, Tax Planners, Mutual Funds... Visit http://in.finance.yahoo.com/ -- PHP Database 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-DB] undefined function: pg_connect()
I'm running apache 1.3.20 with php 4.0.6 and I'm trying to connect to pgSQL 7.1.3(OS X 10.1.1). I'm certain pgsql support is on..this is from my ./configure o/p: checking for PostgreSQL support... yes but this code: \n", $row[0]); printf ("First Name: %s\n", $row[1]); printf ("Email : %s\n", $row[2]); printf ("Phone : %s\n", $row[3]); pg_close($db); ?> trips-up PHP.. you can try it at: elba.dyndns.org/~michael/listcontacts.php any ideas? Michael -- PHP Database 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-DB] how to make a dropdown list with sql content
I don't understand the second part of your question but for the first part you can use a select distinct in your SQL statement and then loop through the result to put things into a drop down box. I just printed the HTML with the var name in there and it worked well. Good luck! -Natalie > -Original Message- > From: venomous [SMTP:[EMAIL PROTECTED]] > Sent: Monday, December 10, 2001 9:07 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] how to make a dropdown list with sql content > > I need to make a dropdown menu from my mysql database but i don't no how > to > come about > > > It's the meaning that i don't get weird things in my database for instants > > PI 300 or pi 300 > > > thanks in advanced > > > > > -- > PHP Database 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 Database 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-DB] how to make a dropdown list with sql content
I need to make a dropdown menu from my mysql database but i don't no how to come about It's the meaning that i don't get weird things in my database for instants PI 300 or pi 300 thanks in advanced -- PHP Database 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]