Re: [PHP] How to get 2 columns to display?
You need a way to make new table rows... if you want to do it ever other image, then just add a counter variable, incrememnt it each time and if it is even then make a new table row. (Also if the images are two big, the browser may put them on a new line, so you might have to look into shrinking the images..) -B - Original Message - From: Aaron Wolski [EMAIL PROTECTED] Date: Monday, December 6, 2004 9:20 am Subject: [PHP] How to get 2 columns to display? Hi guys, I'm trying to get two columns of td/td to display side by side and then go to a new row. I am using this code but nothing I seem to do is working this far. ?php for ($r=0;$products = db_fetch($productsQuery);$r++) { ? td align=centerproducts/?php echo $category; ?/?php echo $products['name_url']; ? class=product_linkimg src=?php echo $base_url; ?product_images/thumbs/?php echo $products['thumb']; ? border=0 width=159br?php echo $products['name']; ?/td ?php if ((($r+1) % 2) == 0) { ? /tr tr valign=top ?php } } ? What is happening with this code is I am getting results like: tr tdIMAGE HERE/td tdIMAGE HERE/td tdIMAGE HERE/td tdIMAGE HERE/td tdIMAGE HERE/td /tr What I WANT is: tr tdIMAGE HERE/td tdIMAGE HERE/td /tr tdIMAGE HERE/td tdIMAGE HERE/td /tr tdIMAGE HERE/td td/td /tr ANY clue where I am going wrong? Thanks so much. Aaron -- 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] Looking for pointers to mysql functions
This would be handled in your query, so get a SQL book or look into the mysql documentation... Look at the select statement, to request specific fields, as well as the Limit keyword to return a certain number of results per page. -B - Original Message - From: Stuart Felenstein [EMAIL PROTECTED] Date: Thursday, November 11, 2004 6:32 am Subject: [PHP] Looking for pointers to mysql functions I'm building a search function and I think most of the search part is solid. Now I'm trying to figure out the results part. Since my results would return about 7 fields per record, I'm thinking mysql_fetch_row over mysql results works better ? But I don't want every field from the row returned, only specific ones. Also, I want to allow for all records that meet criteria to be returned, and will set up a user variable, so they can choose how many records per page come back. Can anyone share some ideas or pointers to documentation that will allow me to set this up ? Very much appreciated! Stuart -- 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] Looking for pointers to mysql functions
- Original Message - From: Stuart Felenstein [EMAIL PROTECTED] Date: Thursday, November 11, 2004 7:13 am Subject: Re: [PHP] Looking for pointers to mysql functions --- [EMAIL PROTECTED] wrote: This would be handled in your query, so get a SQL book or look into the mysql documentation... Look at the select statement, to request specific fields, as well as the Limit keyword to return a certain number of results per page. -B So there is no php code I need to know to get returns on my query statement ? Stuart Depends on what you want to do If you have a table with an ID, name, addr, phone for instance and you only what the Name and phone then you could handle it in your query with: select name, phone from table OR you could handle it in PHP with: $result = mysql_query(Select * from table); while($row = mysql_fetch_row($result) { echo row[1] - $row[2]br; } Perhaps a more meaningful question would lead to a more meaningful answer. -B -- 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] POST losing SESSION vars?
Pass your session along with your form action... i.e $s = SID; echo form action=\.$_SERVER['PHP_SELF'].?$s\ method=post - Original Message - From: Sam Smith [EMAIL PROTECTED] Date: Tuesday, November 9, 2004 1:12 pm Subject: [PHP] POST losing SESSION vars? I have a page that will be redirected to a login page if the SESSION var 'authenticatedUser' is not set. The page has a form in it. When the page is loaded http://thePage the authentication works fine. When the submit button is pressed it doesn't. With POST it acts as if the required session var is not set. When redirected to the login page the login page DOES recognize the the session var and redirects back to the first page a logged in user wouldusually see. formPage.php ?php session_start(); if(!isset($_SESSION['authenticatedUser'])) { $_SESSION['loginMessage'] = You must first login.br ; header(Location: index.php); } ... form action=?php echo $HTTP_SERVER_VARS['PHP_SELF']; ? method=POSTname=purch_form id=purch_form ... input name=Submit ... /form ? index.php ?php // FUNCTIONS function logged_on($errorMessage) { header (Location: authTest.php); //tmp Loc while testing } function login_page ($errorMessage) { require_once login.php; //page where login pair entered } // end FUNCTIONS // BEGIN authentication session_start(); // First visit if (!isset($_SESSION['loginMessage'])) { login_page(Registered users please login.); exit; } // PASS if(isset($_SESSION['authenticatedUser'])) { logged_on(need some control here); exit; } // FAIL else { login_page($_SESSION['loginMessage']); exit; } ? In other words the same page should load after the submit button is pressed but instead the authentication is redirecting. Thanks for any help. -- 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] what am i doing wrong..??
Echo out your queries! $query = insert into joke values('',.$_POST['joke_text'].,'date'); --- echo $query; $result= mysql_query($query); This will tell you what is going on, perhaps some of the information is not set? You can even copy and paste the output to run against your mysql backend on the command line to see if additional information/errors are present. -B - Original Message - From: Aalee [EMAIL PROTECTED] Date: Thursday, November 4, 2004 7:54 am Subject: [PHP] what am i doing wrong..?? Hi there please have a look the code below...I dont know wht am doing wrong here... This code is suppose to show the number of jokes in a mysql database and allows user to add a joke when the user clicks addjoke link. And when the joke is added, it suppose to say that Joke inserted, Thank you and list all the jokes below this line. So far am able to view all the jokes and take the user to add joke page. But the problem is when the user clicks insertjoke button, it does not display the message Joke inserted, Thank you and the jokes are not listed. Infact it does not give any error aswell, it just stays on the add joke form page. I checked the database and no joke is added. Working on PHP ver 4.3.8 with register_globals turned OFF and Apache 1.3.31. MySQL ver 4.0.20a on winXP pro SP1. Recently i started using registre_globals OFF and all these probs strtedcoming up. This code was working fine with globals ON. But my hosting has it off. So need to do so. I was able to fix all the other issues came coz of this global thing in this code. But stuck on the issue i just mentioned. Any help would be GREATLY appreciated. ?php if (isset($_GET['addjoke'])){ ? form name=form1 method=post action=?php $_SERVER['PHP_SELF'] ? Type your joke :br textarea name=jokeText id=jokeText/textarea br input name=insert type=submit id=submit value=Insert Joke /form ?php } else { // start main else statement if(isset ($_POST['insert'])) { $db = mysql_connect(localhost,homesite,test) ; mysql_select_db(jokes,$db); $query = mysql_query(INSERT INTO jokes SET JokeText = '.$_POST['jokeText'].' , JokeDate = CURDATE() ); echo Joke inserted, Thank you BRBR; echo mysql_error(); } $color1 = #66CCFF; $color2 = #66CC99; $row_count = 1; // -- Following lines list the jokes in the database echo bH3 These are the jokes we have got so far/H3/B; $db = mysql_connect(localhost,homesite,test) or die(mysql_error());mysql_select_db(jokes,$db); $sql = SELECT id, JokeText, JokeDate from jokes; $query = mysql_query($sql); echo table border=1 tr tdbIDb/td tdbJoke Textb/td tdbJoke Dateb/td/tr; while ($myrow = mysql_fetch_array($query)) { $row_color = ($row_count % 2) ? $color1 : $color2; echotr bgcolor = $row_color. td. $myrow[id]./td. td. $myrow[JokeText]. /td. td. $myrow[JokeDate]./td/tr; $row_count++; } echo /table; $current_url = $_SERVER['PHP_SELF']; echo(P .Add a Joke!/P); } // end main else statement ? -- 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] Socket trouble
To prevent the blocking and your CPU going up to 100% usages look into: http://us2.php.net/manual/en/function.socket-select.php For length of a string: http://us2.php.net/manual/en/function.strlen.php - Original Message - From: René Fournier [EMAIL PROTECTED] Date: Thursday, October 28, 2004 1:04 pm Subject: [PHP] Socket trouble I'm having some trouble with my socket client. I would like it to notice when the server is no longer there, and then reconnect. I have code for the reconnect, etc., but I can't figure out how to write the socket_read code so that it notices when the server is gone and then responds. Presently, my client just hangs (CPU goes to 100%, nothing happens.) Here's my code: while(($buf = socket_read($socket,1,PHP_BINARY_READ)) !== false) { $data .= $buf; if(preg_match(/TERMINATING/,$data)) { $msg_recv = 1; break; } } The PHP docs on socket_read suggest how this might be done: Note: socket_read() may return a zero length string () indicating the end of communication (i.e. the remote end point has closed the connection). Does this end of communication include cases when the socket server dies without gracefully disconnecting? How could my code check for this zero length string? Any help is much appreciated. Thanks! ...René --- René Fournier www.renefournier.com -- 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] Simple Time Question
Set your server to GMT. - Original Message - From: Ben Miller [EMAIL PROTECTED] Date: Thursday, October 21, 2004 10:48 am Subject: [PHP] Simple Time Question Probably a stupid question, but hopefully has a simple answer. Is there a way to get Grenwich Mean time? time() and date() functions that I can see only seem to get date/time from the server, which knowing where that is, could easily figure out GM time, but would rather go the other way. Thanks. Ben -- 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] PHP on Windows
http://www.google.com/search?hl=enq=Windows+directories+writable - Original Message - From: Jonathan Haddad [EMAIL PROTECTED] Date: Wednesday, October 20, 2004 12:59 pm Subject: [PHP] PHP on Windows So I'm setting up a website that needs to run on a windows server. There are file uploads. What do I need to do to make the directory writable? I'm sure it's very obvious but when the time comes to do it it has to happen immediately. Thanks, Jon -- 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] PHP Configuration Error
It can't find your mysql stuff to link in. What does your configuration command look like? you might have to specify the path to mysql, i.e. --with-mysql=/path/to/mysql -Brad - Original Message - From: Mulley, Nikhil [EMAIL PROTECTED] Date: Tuesday, October 19, 2004 7:18 am Subject: [PHP] PHP Configuration Error Hi All, When I am compiling php4.3.8 with mysql,apxs and snmp on a -Linux Build i386 GNU/Linux I am getting this error Can some body please help me I have PHP already installed but I want to reconfigure it to work with snmp Here is the End of the configuration message checking base type of last arg to accept... (cached) socklen_t checking return type of qsort... (cached) void configure: error: Cannot find MySQL header files under /usr/local/mysql/bin/ Nikhil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Floating values
http://us2.php.net/manual/en/function.number-format.php - Original Message - From: Nunners [EMAIL PROTECTED] Date: Monday, October 18, 2004 7:03 am Subject: [PHP] Floating values Simple question. I'm writing an accounting package, and have setup the MySQL database with decimal(6,2) types for the amount of transactions etc. Is there a way I can reproduce this in the php output? i.e. the number sorted is 8.70 and when you output the value it comes out as 8.7 The question is how do I add the .00? Cheers Nunners -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] setting index of array as 1
$new_array[1] = 'something'; - or - $new_array = array(1='something'); - Original Message - From: Afan Pasalic [EMAIL PROTECTED] Date: Monday, October 18, 2004 1:14 pm Subject: [PHP] setting index of array as 1 when create an array using: $new_array[] = 'something'; first index of new array is 0 how can I though set that first index is 1 - except reorganize array after is created? thanks -afan -- 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] setting index of array as 1
for ($i=0; $icount($all_names); $i++) { $new_array[$i+1] = $all_names[$i]; } // just writting to a new array and incrememnting the subscript by 1 -B - Original Message - From: Afan Pasalic [EMAIL PROTECTED] Date: Monday, October 18, 2004 2:33 pm Subject: Re: [PHP] setting index of array as 1 It's not what I was looking for. Looks like I didn't explain very well :) look at this case: $query = mysql_query(select name from names order by date desc); while($result = mysql_fetch_array($query)) { $all_names[] = $result['name']; } in this case the array $all_names starts with index 0. I can't put $all_names[1] = $result['name']; because every next entry will get index 1 and overwrite old one and on the end I'll have an array of just one element :) -afan Matthew Sims wrote: when create an array using: $new_array[] = 'something'; first index of new array is 0 how can I though set that first index is 1 - except reorganize arrayafter is created? thanks -afan $new_array = array(1 = 'first','second','third'); echo $new_array[1]; --- Will echo first -- 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] User Defined Forms
Create some format to store the info for the form contents... like off the top of my head... TEXT:Name:20:RADIO:Sex:Option1:Option2:CHECKBOX:State:Option1:Option2:...:PASSWORD:Password:20: Just an example, but doable to store in a database, then you create parsing functions to handle this string You can also search for form automation, or form abstraction, or creation on google/sourceforge/freshmeat/etc... to see what turns up... - Original Message - From: Shaun [EMAIL PROTECTED] Date: Thursday, October 14, 2004 1:01 pm Subject: [PHP] User Defined Forms Hi, I am creating a site where users record details of their clients and record their progress. The whole point of the system is to reduce the amount of paper work and store everything online. The problem here is that each user will have their own forms to fill in on their clients, some will record different data to others and some will have more forms than others. Therefore I believe I am correct in saying thiswould be impossible to store in a database as each user would require their own fields etc. One other solution I have thought of is to have each user create a set of PDF forms when they sign up and each time they fill one in they upload it to the server for storage. I would be most grateful for anyone's input on this before I dive in head first! -- 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] intenger
Start here... http://us2.php.net/manual/en/language.types.php - Original Message - From: Juan Pablo Herrera [EMAIL PROTECTED] Date: Thursday, October 14, 2004 1:19 pm Subject: [PHP] intenger Please, i need output a intenger, what function can i use for this?. Print?, echo? Thank you. JP -- 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] Referring Page
Yes, write a script with: ?php phpinfo(); ? and you will find all the wonderous variables at your disposal... -B - Original Message - From: Ben [EMAIL PROTECTED] Date: Thursday, October 14, 2004 3:37 pm Subject: [PHP] Referring Page I am trying to set up a script that will do different things based on the reffering page, without having to include the information in the URL. Does PHP have a built in variable or function that would tell the rest of the script what page the user came from? Any help is much appreciated. Ben -- 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 problems - phpinfo information
- Original Message - From: Jed R. Brubaker [EMAIL PROTECTED] Date: Wednesday, October 13, 2004 1:21 pm Subject: Re: [PHP] mail problems - phpinfo information So as I am not an administrator, and all I have to go on is phpinfo (unless anyone has some suggestions), should I be seeing some trace of qmail in the phpinfo? No. That is why I posted. I apologize if I didn't make it clear. I have read all about mail, maybe read, but not quite understanding? and even used the fantastic Lemos MIME problem correcting email class to try to tackle my problems from a different angle. Given the paths phpinfo is reporting, is there anyway that the system could somehow still be using qmail? Or is that outside the scope of what this phpinfo can tell me? Yes, it could be using qmail, or sendmail, or postfix. PHP calls sendmail which is a binary that could be a shell for any of the MTA's mentioned above. The sendmail provides a interface for PHP, it is up to the sys admin to make sure that the MTA being used is properly configured. Thanks again! Jay Blanchard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [snip] ... making me wonder if a local sendmail is handling the requests instead. With all of the above refering to sendmail, is there anyway that my mail() can actually be using qmail? [/snip] From http://www.php.net/mail, something you have not read apparently For the Mail functions to be available, PHP must have access to the sendmail binary on your system during compile time. [LOOKIE HERE--If you use another mail program, such as qmail or postfix, be sure to use the appropriate sendmail wrappers that come with them.--END LOOKIE] PHP will first look for sendmail in your PATH, and then in the following: /usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib. It's highly recommended to have sendmail available from your PATH. Also, the user that compiled PHP must have permission to access the sendmail binary. -- 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] Install Headaches
Hello All, I've had this problem for a little while now. I am building PHP as an Apache shared Module, so my configure looks something like this: ./configure --with-mysql=.. --with-pgsql=.. --with-gd --with-apxs=.. This works fine, builds fine, but when I run make install, it freezes. HOST php-5.0.1 # make install Installing PHP SAPI module: apache This is the point it freezes My only workaround has been to remove the whole Apache install, and then re-build a fresh apache, a fresh PHP and then run make install which works fine. There has got to be a better way, and/or something I am missing here. Any ideas? Thanks! -Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unexpected $ error
if (isset($_POST['submit])) (missing close apostrophe here...) if (isset($_POST['submit'])) - not sure if this is THE problem, but A problem for sure. -Brad - Original Message - From: [EMAIL PROTECTED] Date: Tuesday, September 21, 2004 8:36 am Subject: [PHP] unexpected $ error hi, i get the following error when trying to run this code (see below): Parse error: parse error, unexpected $ in /full path form.php on line 59 i have checked for unclosed braces - none - and tried uploading the files in ascii format just in case but get the same same error. i have searched many forums but still haven't solved it. the include file just looks like this: ?php /* Title: xx Database Connection String Author: Luke Mackenzie Date: 18/09/04 */ @mysql_connect(xx,x,xxx) or die(Could not connect to MYSQL server); ? this is driving me nuts so if anyone can help, i'd be really grateful. thanks, lukemack. code follows.. ?php /* TITLE: Inmarsat Form handling script AUTHOR: Luke Mackenzie DATE: 18/09/04 */ // if the submit buttons has been pressed if (isset($_POST['submit])) { //connect to the server and select the database include mysql.connect.php;// include the connection details @mysql_select_db(inmarsat_comp) or die (Could not select Database); // retrieve the posted information from the form $firstname = $_POST[first_name]; $lastname = $_POST[last_name]; $jobtitle = $_POST[job_title]; $company = $_POST[company]; $address1 = $_POST[address1]; $address2 = $_POST[address2]; $address3 = $_POST[address3]; $city = $_POST[city]; $county = $_POST[state]; $postcode = $_POST[postcode]; $telcode = $_POST[telephone_cc]; $telnumber = $_POST[telephone_no]; $faxcode = $_POST[fax_cc]; $faxnumber = $_POST[fax_no]; $email = $_POST[email_address]; foreach($_POST[markets1] AS $enterprise); $distribute = $_POST[OKToDistr]; $market = $_POST[OKToMarket]; //insert the form information into the database $query = INSERT INTO inmarsat_comp SET firstname=$firstname, lastname=$lastname;; $result =mysql_query($query); // run the query } //display an appropriate message if ($result) echo pForm Data Successfully inserted!/p; else echo p There was a problem inserting the form Data!/p; mysql_close(); ? -- 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] Fatal error: Call to undefined function: mysql_pconnect() in /var/www/html/includes/db_fns.php on line 6
The tip.. copy and paste your error code into google ;-) Do it for all errors, you'll be amazed @ how many have already been answered - Original Message - From: Eric L. Sammons [EMAIL PROTECTED] Date: Thursday, August 12, 2004 2:44 pm Subject: [PHP] Fatal error: Call to undefined function: mysql_pconnect() in /var/www/html/includes/db_fns.php on line 6 Trying set up php-syslog-ng on my Red Hat EL 3.0 AS system. I have verified that I can in fact access mysql and that I have the necessary database and that the user, password, and host are setup correctly in db_fns.php. It seems; however, that I still receive the given error: Fatal error: Call to undefined function: mysql_pconnect() in /var/www/html/includes/db_fns.php on line 6 I have verified that I have installed the php-mysql rpm. I have also tried mysql_connect and mysql_pconnect. I have checked to ensure that php.ini includes the necessary extensions and that phpinfo shows mysql as a supported database. Anyone have any ideas on what to try next or how to resolve this issue? 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
Re: [PHP] Retrieve The Last Record in a Table
I'm sure there are many ways to do this. Perhaps use something like this as a query? select * from login_table order by DATE_LAST_LOGGED_IN ASC limit 1 - Original Message - From: Harlequin [EMAIL PROTECTED] Date: Monday, July 26, 2004 1:27 pm Subject: [PHP] Retrieve The Last Record in a Table I would like to retrieve the last entry in a login table and present that to a user so they can verify the date we have when they last logged in. Is this possible...? -- - Michael Mason Arras People www.arraspeople.co.uk - -- 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] socket_bind
I think all sockets less then 1024 need superuser permission to bind. And because Apache typically runs as nobody you don't have permission, so either run apache as root (DANGER!) or choose a socket above 1024. -Brad - Original Message - From: Josh Close [EMAIL PROTECTED] Date: Friday, June 25, 2004 10:18 am Subject: [PHP] socket_bind I'm trying to do socket_bind() and it works fine from the command line as root, but when I try to use it through apache I get this error Warning: socket_bind() unable to bind address [13]: Permission denied in .. Is there a way to have this run through apache? -Josh -- 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] bad programming?
Try: if ($_SERVER['REQUEST_METHOD'] == 'POST') and then read: http://us4.php.net/reserved.variables -Brad - Original Message - From: Amanda Hemmerich [EMAIL PROTECTED] Date: Wednesday, June 23, 2004 12:13 pm Subject: [PHP] bad programming? We just moved a bunch of code from one web hosting company to another. Now, one of the pages no longer works. I have been sort of starting from scratch, and the first line is still not working. Am I using somethingthat I shouldn't be? Here is a code snippet: if ($REQUEST_METHOD=='POST') { for(reset($HTTP_POST_VARS); $key=key($HTTP_POST_VARS); next($HTTP_POST_VARS)) { $this = addslashes($HTTP_POST_VARS[$key]); $this = strtr($this, , ); $this = strtr($this, , ); $this = strtr($this, |, ); $$key = $this; } } The part that's not working is the $REQUEST_METHOD=='POST' line. If I replace that with if ($login) (and $login is the name of the submit button on the form), it works fine. I am leary of using $login...any other suggestions? 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
Re: [PHP] Mac Address Lookup
If you have the IP address, then 'nslookup' or I guess now 'dig' and 'host' would be the newere versions. They are Linux system calls, use system() or exec() to use them within your script, and play around with the options and/or read the man pages for how to use them. HTH -Brad - Original Message - From: skate [EMAIL PROTECTED] Date: Friday, July 18, 2003 12:28 pm Subject: Re: [PHP] Mac Address Lookup very little chance, a machine won't transmit it's MAC address, that the main point of the TCP/IP stack is to convert IP address' into MAC address' at routers and such. - Original Message - From: Ashwin Kutty [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 18, 2003 5:19 PM Subject: [PHP] Mac Address Lookup I am trying to do a lookup of a Mac Address via PHP. Is there any way to do so like gethostbyaddr that gets me the name of a machine? 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mac Address Lookup
I guess I should have put this in one post Your subject says something different then your question, one asking for the computer name, the other the MAC. To get the MAC the computer will need to be on your LAN, otherwise this is not possible. You can then use the 'arp' command to get the MAC address. HTH -Brad - Original Message - From: skate [EMAIL PROTECTED] Date: Friday, July 18, 2003 12:28 pm Subject: Re: [PHP] Mac Address Lookup very little chance, a machine won't transmit it's MAC address, that the main point of the TCP/IP stack is to convert IP address' into MAC address' at routers and such. - Original Message - From: Ashwin Kutty [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 18, 2003 5:19 PM Subject: [PHP] Mac Address Lookup I am trying to do a lookup of a Mac Address via PHP. Is there any way to do so like gethostbyaddr that gets me the name of a machine? 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image galleries
Well, Start here to read about how to upload files to a web server.. http://us2.php.net/features.file-upload And then as for displaying them, look into some standard HTML to display the text links, and possibly this solutions for readin directory contents: http://us2.php.net/manual/en/ref.dir.php HTH -Brad I've had a look around lots of script sites (hotscripts, etc) and there are lots of scripts for gd-library galleries, but unfortunately the server i'm using does not support it, and I really want to have a gallery where pictures can be uploaded and all the appropriate directories are created automatically (i'm not that good with code just yet) but instead of listing pages of thumbnails it just automatically lists the pics in the gallery as text links. I hope you can be of some help, I can't find anything anywhere on the whole internet like this. -- 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] typecasting .. easy?
This is really a formatting issue, not type casting, so loook in those areas of the manual. Perhaps start around: http://us2.php.net/manual/en/function.printf.php -Brad $amount is a calculated number If $amount equals for example 52., how do I get that to print as 52.00 similarly, if amount = 52.5 how do I get that to print as 52.50 Thanks! (looked at all sort of type casting manual stuff to no avail) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mySQL: Rows and columns
http://www.mysql.com/doc/en/ALTER_TABLE.html I know this is more of a mySQL question but, how do I delete and add rows and columns? -- - Zavaboy [EMAIL PROTECTED] www.zavaboy.com -- 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] This is NOT the right place to ask this but I am desperate
Run 'ipconfig' from a command prompt to get your IP address. (or as mentioned, localhost will work) -Brad Hi all, I know this is not the right group to this but I am desperate. I have just got Apache and I am a total newbie to Apache and to playing with servers, so as u can imagine I am floundering a tad at the mo!! I have set-up and cofig'd apache 2.0.46 on a Windows XP machine on a LAN with ADSL net access.. Now I know the server is working fine as I can interact with it on a command line and it is showing as started on its ickle control panel. Now the problem is that I let the server decide on it's own IP address by leaving Listen in the config file as just a port no of 8080 (80 is already used on this machine), but I have no idea how to actually access the server from a browser as I have no URL or IP to type in!!! Help!! How do I find the IP? Or is there something that I have missed/done wrong/broken? I am sure that this is really simple but at the moment the only simple thing around here is me!! All thought or comments welcome. Thanks, Simon -- 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] user (system) authentification
Well, make sure you tunnel it securly with SSL or the like, but have a look at: http://us3.php.net/manual/en/function.crypt.php -Brad Hi, is there a way, to verify a password via php, if it matches it's entry in /etc/shadow ? I am trying to write a script, which needs a user authentification on a server wide basis and since the users come and go rather fast on the server in question, i thought that the best way would be to let the user enter his system username password and validate it with the one set in /etc/shadow for that entered username. md5() didn't work, so i guess that i am using the wrong method. Does anyone know, how i can achieve this? Regards, Duncan -- 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] thumbnails
Hello, I did a family photo gallery, and from my experiences it would be best if you handle the thumbnail generation during the upload process. Just make sure you have a naming convention or link the thumnail into your repository/DB so you don't loose that space when you delete the record. It really does not consume too much space, pretty easy to do, and a lot easier to manage if you do it in your control environment. -Brad Ok, I know thumbnails have been discussed and I have looked at the archives, I am just looking for opinions. I am doing a small website for a used vehicle dealer. I need to make it as easy as possible for him to add new vehicles. I plan to just give him a form for the information, and a place to upload a picture. The main page will have the thumbnails of all the vehicles and as you click on each one, you will see the normal sized photo. Should I: 1. Allow him to upload one picture and then somehow generate a thumbnail from that? If so, should I generate the thumbnail when the picture is uploaded and keep the original picture and the thumbnail on the server or generate the thumbnail on the fly when the page is loaded...and only store the original picture? 2. Should I have him generate thumbnails and upload both pictures to the server? Thanks, Eddie -- 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] chill out
Sorry to all who think this horse is sufficiently beat, but just to throw another couple of cents into the pot... I think this list is a product of its own behavior. Some people do get mad because of dumb or simple questions. We breed those questions though because instead of people explaining to the OP how to FIND the answers, we just type out the code for them. So, they essentially don't learn a thing and in a week or two they are back. So, it would be nice to have a concerted effort to perhaps teach/guide these newbies and others as to how to find the answers as there are numerous resources out there. Like the old saying goes, Give a man a fish and feed him for a day, but teach him to fish and feed him for a lifetime. -Brad It's really funny that this happened because not more than one week ago I was discussing the professionalism of this list with one of my co-workers. I've been very happy with it, but I remember when I first joined it I asked a pretty dumb question and got slammed by a bunch of people because it was simple, but I was just overlooking the solution. It did make me feel like an idiot, but I dealt with it because this was a GREAT resource for all kinds of other information. I'd have to say that this is one of the best, most informative lists I've had the pleasure of being a part of and I'd say it's worth getting slammed every now and again if that's what I have to deal with to get solutions to my problems. :-) Cheers... Brian -Original Message- From: Tim Thorburn [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2003 2:20 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] chill out Hi, I'd have to agree with the original poster on this topic - I've been on this list for about 3 years now, at times it is helpful - and then there's every other day. Granted, there are guru's out there that know all there is to know about PHP, and then there's the new kid that has no idea what it is, but either wants to learn or has to learn. And it is quite possible that not everyone is as adept at finding information online - if you're new to server-side programming languages in general - how or why would you know of the great many repositories of information available online? Sarcasm is one thing, gawd knows I use it on a by the minute basis ... but when a newbie posts a question that may seem simple to some - yet utterly impossible to others, is it constructive to tell them to go back and RTFM in a violent manner? Suggesting that they review the manual again may help, or better yet - if you think it's not worth your time, that's what the trash can button is for. In general, I've had great luck with this list - it just seems the majority of puter ppl don't have super ppl skills ;) Now back to work -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Manual w/ Comments?
I would say the dynamic nature of this guide requires it to be online, unless you want to make some sort of update feature. Otherwise you would only be downloading a snapshot. And then comes into play creating and maintaing all the various snapshots of this ever changing document. IMHO, I would prefer the PHP minds spend their time on making PHP better. -Brad Wasn't the php manual with user comments available for download at one time? Is it still there and I'm just not seeing it? If it was never there, can I suggest that as an option for the manual download from you good people at PHP? Damn, I'm just full of questions. -- 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] info required reg. PHP
Answer to number 1: I'm sure you could, but why would you want to when Javascript is more suited for this type of processing. If you don't know javascript google for some tutorials or for alert boxes, and I'm sure you will find plenty of examples. for #2: For Mysql check this: http://www.mysql.com/doc/en/Table_size.html And for the others, look around, that information should not be too hard to find. Hello ! I have got 2 doubts/questions for clarification. 1) Can we display an alert box using PHP. The objective is to fire back the user for his incorrect submission with an alert message. 2) I would like to know the max. number of records or max. space a database (mentioned below) can provide. Oracle, MS.Access, MySQL, SQL Server,... with thanks L. Yogendra -- 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] Live chat screen
Sure, in JAVA. Hi! Is it possible to create a chat screen that updates screen in some kind of loop from the database? So if someone sends a message to database it immediately shows on chat screen? Kind regards, Sami -- 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] Php 4.3
Check the archives about global variables in the php.ini file Hello, I am having issues after I upgraded from 4.0.5 to 4.3 Alot of my link pages were based in www.something.com/phptest.php?foo=9323 Now that I have upgraded, I get foo errors. It says that it no longer gets the foo value... how can I fix this? THanks -T -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Client Side PHP
One language across the whole web In a word: JAVA Has the cross-platform flexability of PHP with a little more versitility and power under the hood. Of course PHP still has its niche, but I'm still waiting to go to an ecommerce page that fires up and interactive store applet on the client side and streams sales information via XML, so I can really shop from my desktop. I am doing now ;) How would you guys like the idea, though? -- Maxim Maletsky [EMAIL PROTECTED] Pete [EMAIL PROTECTED] wrote... : Has any one ever considered creating browser / client-side php to replace Javascript and vb?? One language across the whole web ;-) Posted this question in the evangelism so I'd be interested in more reaction: Pete -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Client Side PHP
Like a previous poster said, you would have to develop some type of plug-in to work with the browsers that would incorporate PHP on the client side. Or talk Microsoft into including it in Internet Exploder by default :-) This strategy depends on user experience studies..I know many people who are simply turned off and loose interest when they have to download/install another plug-in. -B PHP codes gets executed at the server (server side), so I wonder how you can make it to work at the client side? But good thinking :) huzz - Original Message - From: Pete [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 06, 2003 12:55 PM Subject: [PHP] Client Side PHP Has any one ever considered creating browser / client-side php to replace Javascript and vb?? One language across the whole web ;-) Posted this question in the evangelism so I'd be interested in more reaction: Pete -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] backslash t
You need to escape the '/' with a '/', as it is a special character. So, anytime you run into an issue where it looks like PHP is trying to interpret something you just want it to print. The best first guess is to try and escape it. Just Thought I would offer a little more explaination. --- Jan Grafström [EMAIL PROTECTED] wrote: I want php to print \tab echo \\tab; Chris -- 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] building web album - design questions
Hi, I'm planning to build a web album for my digital photographs, and have some questions regarding the design: 1) Is it better to store the images within the database, or just store pointers to the images which is put outside, in the filesystem? IMHO, store a link of pointer to the images 2) At log in, I want to show to which albums new pictures have been added since last visit. For performance reasons, should information about last added pictures be added to the database, or is it ok to make a MySQL-query each time, comparing the add-date for every picture in every album with the users last log in date? How often will this get hit? If often you could also update a string in a test file the same time you do your database/album updates. But a huge traffic is not a cause for concern you should be able to safely execute a query every time to find out the lastest pictures/albums updated. 3) If I've understood things right, there is functions within PHP that can handle picture resizing? Is that correct? Yes, some good tutorials out there. I don't know about internal PHP functions, I often just call ImageMagik from inside my php script to re-size my images, but I'm sure there are plenty of ways... HTH -brad Best regards, Anders Thoresson -- 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] *Cannot connect to db
the '@' sign suppresses the error/warning messages. Perhaps you would want to leave that off in a development environment. It may lead to some good keys to finding the solution.. -Brad mySQL; php running in safe mode; compared to the other code on the same server. here is mine - I don't get any connection. What could be wrong? Also, what does this @ sign mean before the mysql_connect? function dbopen(){ $tablename = balzerdez02; $dbname = marketingcompany; $hostname=localhost; $username=tmc; $password=t7t7k1k1; $dbconn=@mysql_connect($hostname,$username,$password); mysql_select_db($dbname) or die (Could not find the table); echo($dbconn :- connect); } dbopen(); Thanks. -Alex -- 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] Re: *Cannot connect to db
Can you get into the mysql DB via command line? If so, try to get in there and make sure this user has permissions in the mysql.users table to connect via localhost. Also verufy password they are using. Try to have this user connect via the commandline in MYSQL, which if he is unable to there, it would rule out your PHP being the problem... -Brad Warning: MySQL Connection Failed: Access denied for user: 'tmc@localhost' (Using password: YES) in e:\~~~\~~~\apache\website\~~~\testdb.php on line 8 The guy at the support says, that everybody else can connect no problems, sent me the code, which I copy-pasted and I still have this error. :(( Bastian Vogt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, leave out the @, and give us the error message. @ suppresses error messages of any function. HTH, Bastian -- 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] Creating reports in database systems implemented over Web interface
Quality HTML/embedded with PHP? (Same way any reports are printed from the web) -or- Perhaps, check out PDFLib. -Brad Hi everybody: Over linux, I'm using PostgreSQL , Apache server, and PHP pages to create a database systems with web interface. I need to know how programmers have solved the problem about printing hig h quality reports using the databases information. Thanks in advance Enediel Happy who can penetrate the secret causes of the things ¡Use Linux! -- 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] PHP + MySQL looping question
Mark, Try looking at : http://www.php.net/manual/en/function.mysql-data-seek.php and see if that function gives you the desired result. HTH -Brad I was wondering if there is a easy way to loop through the same SQL results many times. I have a for loop that loops 3 time. Each time I want to loop through the SQL result printing. The end result is printing the SQL results 3 times in a order. The problem is I have to reset the SQL result array on each for loop. How do you do that? for ($i = 1; $i = 3; $i++) { while ($row = mysql_fetch_array($result)) { //Some Code echo $row['filed']; } //Reset $result - SQL result } Thanks, Mark. -- 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] Add column to table
look at the alter table syntax on the mysql Documentation page. nice version of RTFM -Brad Hi, please could someone tell me what the sql command is to add a colummn to a table? Thanks for your help -- 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] Boucing Emails
Hello... I gotten a few of these, was wondering if this account is going to be axed from the distrbution list, hopefully soon. This is an automatically generated Delivery Status Notification. Delivery to the following recipients failed. [EMAIL PROTECTED] Thanks -Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 2.4.3 and Apache 2.0.x
Wow, PHP Version 2, that's OLD school. If you mean 4.2.3, check out the archives for the list. I believe there has been discussion on the issue and it seems like Apache 2.0.x is really still in development at this point so it is a use at your own risk, but they whouls work, just might not be as simple as configuring apache 1.3.x with PHP. -Brad Hello, PHP 2.4.3 can work with Apache 2.0.x or I need Apache 1.3.x? PHP 2.4.3 can work with Apache 2.0.x or I need Apache 1.3.x? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] which PHP debugger?
h... I *think* PHP is platform independant for the most part, and it is not like it is a compiled language where you have fancy debuggers to set breakpoints, step through the code, etc... Why not use the functions built into PHP? echo ; if a mysql problem: mysql_error() -Brad Hi all, please which PHP debugger is the best one? (fast keyboard commands, variables, includes, reliability etc.). Which PHP debugger works well under Windows, which under Linux? thanks... --- Odchozí zpráva neobsahuje viry. Zkontrolováno antivirovým systémem AVG (http://www.grisoft.cz). Verze: 6.0.419 / Virová báze: 235 - datum vydání: 13.11.2002 -- 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] new php version
I think there is a PHP release mailing list, that should keep you in the loop, or check php.net. The news is usually fresh there. -Brad When will there be a new release of php? With kind regards, Richard Pijnenburg Klik-on Internet Solutions -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating a voting system.
Have you by chance read any documents or tutorials? I know there are many helpful ones at places like phpbuilder.com, and many others. This list is more helpful when you have a specific question to be answered, this is too open ended. -Brad Hello, I am making a page where people can vote for their favourite image. People can give points from 1 to 5. I want the votes counted in a table in my mysql dbbase called votes. How do I make such a system? thank you for helpfull hints. -- 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] seeding using mt_srand();
What Version :-) Check the manual, it has an interesting note: Note: Since PHP 4.2.0 it's no longer necessary to seed the random number generator before using it. HTH -Brad Let's say you have a simple PHP file that just displays a random number. When the user hits the submit button, the page will reload and display another random number. How often do you need to call mt_srand(); ? Just once? Or each time the page gets reloaded? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 4.3.0pre1
Is there a changelog for this, so we know what to test? -Brad Hello, PHP 4.3.0pre1 is available for download from http://qa.php.net. PHP 4.3.0 incorporates a very large number of changes, new features, and bugfixes, and thus requires extensive testing. This preliminary release is meant to kick-start this testing while the fixes are still being performed. Please join in and help us make this a high-quality release. You can use the build tracker at http://qa.php.net/buildtest-submit.php to report the results of your testing. Thank you, -Andrei http://www.gravitonic.com/ * Quantum Mechanics: The Dreams of Which Stuff is Made. * -- 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] Need help with fsockopen()
http://www.php.net/manual/en/function.fsockopen.php Seems to be A LOT of useful information there? Did you check it out? -Brad I have a script that downloads html pages from many different sites. The script executes as expected but is slw. I would like to replace fopen() with fsockopen() so that I can set a time limit for the page downloads. Here is an example of how I'm using fopen(): $OpenFile = fopen($site_url, 80); //$site_url = www.domainname.com/complete/path/to/the/page.htm $getFile = fread($OpenFile, 5); Simply put, how do I do the exact same thing as above with fsockopen(). Thanks, Cliff -- 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] Trying to add table prefix variable to query
Maybe you should assign the query to is's own value doing your string concatenation... i.e. $query = select * ...; then echo out the query: echo $query; I think you will see the problem them, I would guess that when you are adding the table_prefix to the table name that you are getting an extra space in there... So, try that out, and see if it helps -Brad This query worked until I tried to add support for a table prefix in the config file. Now it can¹t seem to find the table. Any pointers to what I am doing wrong? Thanks, v Original query: ?php include(config.php); $open = mysql_pconnect($hostname,$user,$password); mysql_select_db($db,$open); $result = mysql($db,SELECT * FROM teams WHERE username = 'admin'); $i = 0; $total_rows = mysql_numrows($result); ? This is my query: ?php include(config.php); $open = mysql_pconnect($hostname,$user,$password); mysql_select_db($db,$open); $result = mysql($db,SELECT * FROM . $table_prefix . teams WHERE username = 'admin'); $i = 0; $total_rows = mysql_numrows($result); ? This is my config file: ?php $db = sports; $hostname = localhost; $password = mypassword; $user = myuser; $table_prefix = ccl_; ? This is my table name: ccl_teams This is the error: Warning: Supplied argument is not a valid MySQL result resource in... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Troubles Inserting into MYSQL
If you read: http://www.php.net/manual/en/function.mysql-query.php You will see what $sql4 can be. My guess would be he is connected to 2 or more different databases, and this is specifiying which one to execute the query on. -Brad [snip] if ($update_type == update_Williams) { mysql_query(INSERT INTO events ('user', 'detaildesc', 'index', 'reference', 'date_added') VALUES (\'$cookiewho\', \'$add_Williams\',\'\',\'$row_num\',\'$last_update\'), $sql4) or die (could not do update); } [/snip] Try this if ($update_type == update_Williams) { mysql_query(INSERT INTO events (user, detaildesc, index, reference, date_added) VALUES (' . $cookiewho . ', ' . $add_Williams . ', '', ' . $row_num . ', ' . $last_update . '), $sql4) or die (could not do update); } First of all, seems there is extra stuff in the query that shouldn't be there (what is $sql4?) and you may have parentheses out of place. HTH! Jay -- 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] Problem with inserting values into database through php
Just and FYI update, in case someone else has this problem... The problem was the example was using $PHP_SELF as the form action variable, of course it has been discussed on this list that in the newer versions of PHP, register_globals is turned off in php.ini, so $PHP_SELF had no real meaning, so no data was actually being passed. So, just an update to change it to: form action=?php echo $_SERVER['PHP_SELF']? method=post -Brad [snip] I´m quite a newbie in making php, but I managed to run the test you suggested, but nothin happened. This time it was propably the code I did: first I added the or die(Invalid query: $sql); part and ran the form, but everything happened just like when refreshing a page. Then I did this: $result = mysql_query($sql) or die(Invalid query: $sql); echo $sql; but the database was silentit just refreshed the page and cleared out the form. [/snip] 1. Here is a different method of error checking for queries; if the query is $query = SELECT foo FROM BAR ; if(!($result = mysql_query($query, $database_connection))){ print(MySQL reports the following error: . mysql_error() . \n); exit(); } 2. Check your web access and error logs for clues. 3. Does the user have permission to INSERT and/or UPDATE? If you set thos e on the database did you flush the grant tables? HTH! Jay In clinical trials for diabetes medications do they give sugar pills as placebos? * * Texas PHP Developers Conf Spring 2003* * T Bar M Resort Conference Center* * New Braunfels, Texas * * Contact [EMAIL PROTECTED] * * * * Want to present a paper or workshop? Contact now! * * -- 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] Image Resizing ... lets try this again.
What I found works very well for this is the function: getimagesize(); $image_file = something.jpg; $size = getimagesize($image_file); //$size[0] = height and $size[1] = width (double check on php.net) //Then just divide them... $width = $size[1]/2; $height=$size[0]/2; DISPLAY IMAHE height=$height width=$width This way it will keep the original deminsions of the photo, just cut it in half, or however much you want to cut it down. Of course this approach makes viewing eaiser, but does not really cut down on the download time of the JPG, so if that is your primary concern, then another approach may be in order? HTH -Brad I sent this email out earlier this morning and got no response. It was quite early so I thought I would send it again now that more people are hopefully at work :-) I have been trying to figure out the best way to resize photo quality images to thumbnail size and have them come out looking good. I have read about the function http://www.php.net/manual/en/function.imagecreatetruecolor.php http://www.php.net/manual/en/function.imagecreatetruecolor.php imagecreatetruecolor() and it looks like it may do this. However I do not have GD 2 installed which is required for this function to work. In the process of trying to figure out how to install GD v2 I came across the following page. http://www.php.net/manual/en/ref.image.php http://www.php.net/manual/en/ref.image.php http://www.php.net/manual/en/ref.image.php http://www.php.net/manual/en/ref.image.php On this page is says; Since PHP 4.3 there is a bundeled version of the GD lib. This bundeled version has some additional features like alpha blending and should be used in preference to the external library since it's codebase is better maintained and more stable. I thought the most recent version of php was 4.2.2? Anyway if there is a better way to resize images to create high quality thumbnails I would love to hear about it. I am on a redhat 7.3 server and not very familiar with linux. I would prefer not to have to take the time involved in learning how to install new packages right now, but realize this may be unavoidable. Thanks in advance for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Link for downloading?
Question 1: I think this has to do with how you attribute your file extensions in httpd.conf (Apache thing, not PHP), so check out the docs on apache.org Question 2: I woudl tend to believe it depends what kind of link it is... is it and HTTP downlaod site (which would use the windows save file as dialog, or is it a link to an FTP site, which may use your local FTP software... HTH -Brad Hello, How to create a link that when click it will lauch file downloading at client's end. And another question which might be biased from this topic, but still related with the subject of this message: why some downloading link will lauch a ftp client such as NetAnts or Download Accelerator while other link will start a Window's builtin download window? Alex -- 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] Re: Hardware Address
Someone already posted a solution, which was a great idea actually :-) exec(arp $_SERVER[REMOTE_ADDR], $output); echo H/W Addr should be: $output[1]br; Because you are on a LAN, you should be easily able to acertain the MAC address through ARP. This would not qork for non-LAN situations, but it should for you. -Brad Hello all, The application I am trying to should only be accessible from work as it is a timeclock. Consequently, a login will, unfortunately, not work. An IP address may work, but the whole university is on DHCP and I do not want t hem to clock in from other parts of the university (student labs, etc.). I am not set on using hardware addresses, but it seems like a way to do it if PHP allows, which it appears to not. I am open to any suggestions any of you might have. I believe all the computers are on the same collision domain. I dont know if that helps though... Thanks for all your help, Chris From: Brent Baisley [EMAIL PROTECTED] To: Tyler Longren [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [PHP] Re: Hardware Address Date: Fri, 6 Sep 2002 08:49:35 -0400 To get the hardware address you need to dig down through the network layers. If you look at the OSI 7 network model (used on all systems), yo u will see that PHP really operates on layers 6 7. The hardware address (MAC Address) is down on layer 2, the data link layer. The layered model is designed to assure compatibility and ease of implementation. Meaning, ea ch layer does what it is supposed to and doesn't care how the other layers accomplish their job. I highly doubt that PHP would be permitted to dig down into the network stack when it's not running as root. I'm not sure what you mean by universities and broadband isp do 'this'. If you are referring to limiting bandwidth, this should be, and usually is, done on the router level. ISP's want to limit use of their network bandwidth, not their ser ver bandwidth. Limiting use of an application is normally done through a user login. Wouldn't you want to limit the user not a specific computer? Besides, it 's easy enough to override the hardware address of a network card or even u se a different one. Easier than IP spoofing. On Thursday, September 5, 2002, at 09:45 PM, Tyler Longren wrote: using exec() or system() will only be able to execute commands on the machine php is installed on. I sometimes wonder how universities and broadband isp's do this. I'd be interested in seeing how it works. Sorry, I'm not much help anymore. tyler On Fri, 6 Sep 2002 01:24:07 +0200 [EMAIL PROTECTED] wrote: Hi, The best way I think is to use exec() or system() to ask that to the system. May be someone knows something better too. -- Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com - Hébergement de sites Internet Chris Cook [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] Hello all, I am working on a LAN application and am interested in obtaining the user's network card address to limit usage of the program. Is there a way to do this in PHP? I am on a network that uses DHCP so using the IP address probably wont work and I am also worried about IP spoofing. Thanks for any help you can provide, Chris _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- 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 -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- 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] passing error code vars
If the variable is within a form you could do: input type=hidden name='name_of_var' value=$err_code This would pass to the next page, otherwise the ?name_of_var=$err_code mau be the way to go? -Brad hi there i am trying to pass error code vars within a page say i post to a query string like ?action=upload i would like to be able to send an error code if any back to the page and then it can bring it up the only way i can think of it when i redirect back to the previous page is adding a ?errorcode=1 etc -- 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