Re: [PHP] Combo Box containing field
Hi Michael, Yes I do! Take a look at the code snippet below: echo ""; $level2 = $db->execute("select typename from types"); do { $value=$level2->fields[0]; echo "$value"; $level2->nextRow(); } while (!$level2->EOF); $level2->close(); echo ""; Just change the query in the 2nd line of the code to the desired query. You'll see the result ;-) Best of luck, Ahmad Anvari da Code Guru - Original Message - From: RealGM To: [EMAIL PROTECTED] Sent: Saturday, March 10, 2001 4:21 PM Subject: [PHP] Combo Box containing field Hi, Does anyone know how I can create a combo box in my php file that reads the options in from a database field? I can create combo boxes fine containing values that I enter, but I want it to read the values from the database into the drop down box for the user to select. Thanks, Michael.
Re: [PHP] Need some help plz
Hi, what's up Mick?! Okay, what have you written in your script?! You never wrote it! try include ('./domain.php') instead of include ('domain.php') maybe it helps you! I tested that on my FreeBSD 4.2+apache/php but it seems that include ('domain.php') is also OK. Just give it a try or add the directory which domain.php belongs to, to your php include path. Take care, Ahmad "Mick" <[EMAIL PROTECTED]> wrote in message 98cr35$l7b$[EMAIL PROTECTED]">news:98cr35$l7b$[EMAIL PROTECTED]... > Hi, > > I installed PHP4 onto my FreeBSD 4.2 computer but i'm getting this error, > anyone able to tell me how i can fix it? > > > Warning: Failed opening '/usr/local/apache/htdocs/mick/domain.php' for > inclusion (include_path='') in Unknown on line 0 > > Thanks in advanced > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >
Re: [PHP] No same username
Or better using: create table test1 (t1 char(5), t2 char(5), primary key (t1), unique (t2)); when creating table. No duplicate records with the same t2 because it's unique. Ahmad Anvari - Original Message - From: Kath To: Brandon Feldhahn ; [EMAIL PROTECTED] Sent: Sunday, February 25, 2001 6:19 PM Subject: Re: [PHP] No same username $sql = "SELECT username FROM main_users WHERE username = '$username'"; $result = mysql_query($sql); $num = mysql_numrows($result); if ($num > "0") { die ("That username already exists, please chose another"); } - That could do it :) - Kath - Original Message - From: "Brandon Feldhahn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Sunday, February 25, 2001 7:33 AM Subject: [PHP] No same username > how do i make somthing with my database that knows it the username > entered is already a name in use? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] No same username
define a UNIQUE field :) - Original Message - From: Brandon Feldhahn To: [EMAIL PROTECTED] ; [EMAIL PROTECTED] ; [EMAIL PROTECTED] Sent: Sunday, February 25, 2001 4:03 PM Subject: [PHP] No same username how do i make somthing with my database that knows it the username entered is already a name in use? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] incrementing a date!
hi, try $tomorrow = mktime(0,0,0,date("m") ,date("d")+1,date("Y")); or maybe better than this, if you convert the date to the standard unix timestamp and use DATE function. Best of luck, Ahmad Anvari - Original Message - From: kaab kaoutar To: [EMAIL PROTECTED] Sent: Sunday, February 25, 2001 2:36 PM Subject: [PHP] incrementing a date! Hi all! s there a way with which we can increment a date (by day) without extracting the month the day and the year then increment some of them depending on the day the month and the year ? ex: 2001-03-28 'll become 2001-04-01 Thanks _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] status page between submit and results
Here?! Sunny today! ;-) I highly suggest you use client side scripting in this case. onLoad Event handler. A load event occurs when Navigator finishes loading a window or all frames within a tag. The onLoad event handler executes JavaScript code when a load event occurs. Here's a sample code for your result page: .. Some Coding Here ... .. The rest of coding.. That's the snippiest piece of code. [I didn't test it, however, I'm sure that it work out] Create a loading.gif animation gif which shows a [Loading...] animation. It will be replaced by a blank gif file named blank.gif which shows a blank screen. Take care, Ahmad Anvari - Original Message - From: Mitchell Hagerty To: [EMAIL PROTECTED] Sent: Saturday, February 24, 2001 7:02 PM Subject: [PHP] status page between submit and results Blizzard here, hows the weather there? :) The website I am working on has several forms, a search, and a login that can take close to a minute depending on much traffic it is recieving. I've noticed on other sites ("paypal" for instance) that when you submit it throws up a "loading..." page that goes onto the results page when it is returned. any ideas on how to do this? tks mitch -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] checking $more still does not work !
Hi Kaab, There must be another problem, it should work. Maybe it helps if you send your code here. To see how a simple script works, try this tiny script named test.php: Submit is pressed"; }; ?> If you first load the php page, you don't see anything rather than a submit button. If you press submit, you will see a message. Ahmad Anvari - Original Message - From: kaab kaoutar To: [EMAIL PROTECTED] Sent: Saturday, February 24, 2001 5:35 PM Subject: [PHP] checking $more still does not work ! Hi! i have a submit button called "more" in a page that calles itself i try to check whether the page was just loaded or called by clicking on that button using : if ($more) {echo "hi";} it never echo hi any idea ? Thanks _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] $result = $$function
Hi, I didn't get why you haven't used this: switch $var case something: $result=$build_result(); break; case somethingelse: $result=$build2(); break; blah blah blah... Ahmad - Original Message - From: Peter Van Dijck To: php gen list Sent: Saturday, February 24, 2001 4:00 PM Subject: [PHP] $result = $$function Hi, I'd like to do: $function = "build_result()"; $result = $$function; but it doesn't seem to work. The reason why I think I need it is that I have a generic function, but within it I have to call another function depending on who called it. I could build a switch within the generic function deciding which function to call, but tht seems less elegant, as I'd have to adjust the generic function every time a new function calls it. The build_result() function only gets called in certain cases by the generic function (if it's not cached), so I can't just put it outside fo the generic function. Any hints? Thanks! Peter ~ http://liga1.com ,a weblog on: - Localisation - Internationalisation - Globalisation - Accessibility -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Change dir mode to writable for uploading..
Hi Dhaval, You said in your previous e-mail 'C:\'. Are you using a NT based server or Unix based? If your server is a unix based one, consider trying this command: chmod 777 /path/to/directory Warning, this is a bit dangerous and might be vulnerable, are you running your webserver with nobody? Anyone else has access to write cgi scripts on your servers? If everything's set up carefully, you can chown your directory to nobody. It will work with the current permission. Ahmad Anvari - Original Message - From: Dhaval Desai To: [EMAIL PROTECTED] Sent: Saturday, February 24, 2001 11:55 AM Subject: [PHP] Change dir mode to writable for uploading.. Hi! I have problem uploading the file to a directory... It says permission denied. THe problem is taht ther directory is on the web. I connect using WS_ftp. THe directory is set to: drwxr-xr-x How do I make it writable..? I am using form to upload the files there.. Is there any way I can make the directory writable..? Thank You! Dhaval Desai __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] GD, TTF, and Anit-Alias
Hi Brandon, You asked me in a private e-mail about anti-aliasing. As far as I know if ImageTTFText function, if you use negative color reference [such as -1, -2], It turns off the anti aliasing. I think the text is automatically antialiased using a positive number. Anyone, with a sharp idea? ;-) Ahmad Anvari - Original Message - From: Brandon Orther To: PHP User Group Sent: Tuesday, February 06, 2001 9:07 PM Subject: [PHP] GD, TTF, and Anit-Alias Hello I am making a php script that make an image with the text that I send to the script. What I was wondering is if there was an anti-alias function in GD for my test. Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Passing an array as an argument.
Hi April, I suggest you code your array into one string (it depends to the size) then decode it at the other end using your own code. It's the easiest trick to pass the array, compress it into one variable, then extract it at the other end. Any other ideas? ;-) Ahmad - Original Message - From: April To: PHP General Sent: Tuesday, February 06, 2001 8:48 PM Subject: [PHP] Passing an array as an argument. How do you pass an array as an argument to a function? My code (or at least the important parts): function process_members($asker_rank, $email) { global $database_mysql; mysql_select_db($database_mysql); while (list ($key, $val) = each ($email)) { echo "$key => $val"; } } # This will display fine. # while (list ($key, $val) = each ($email)) { echo "$key => $val"; } # Doing the same thing with the function here returns this error, though. // Warning: Variable passed to each() is not an array or object in lib.inc on line 447 process_members($asker_rank, $total_members, $email); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] GD
Hi, Consider using ImageCreateFromGif will help you. Then use ImageTTFText to write some text on the loaded gif and ImageGIF it to output the image as gif :) Ahmad Anvari - Original Message - From: Brandon Orther To: PHP User Group Sent: Tuesday, February 06, 2001 7:50 PM Subject: [PHP] GD Hello, Hello I am starting to work with GD a little bit more lately and was looking for some more advanced stuff than just printing text on blue background. I was wondering if there is a way to load an image into GD to use as the background image of a image I want to create. Does anyone know where I can get a couple good GD tutorials, other than making graphs. Thank you, Brandon Orther WebIntellects Design/Development Manager [EMAIL PROTECTED] 800-994-6364 www.webintellects.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Save to Local Disk
Hi Karl, Simply put a save button on your page. When it's clicked, pass document.forms[0].textareaname.value to the other script, (it's written in javascript, if you're familiar with that), then you'll access the content of the text box. to save it on a local disk, simply use javascript again, it will help you save a file on disk. [altough there are some security reasons which prohibit you write on the client's side, you can still do that using the below script] it's a good guide. however, you have to change some parts: hope it works, Ahmad Anvari - Original Message - From: Karl J. Stubsjoen To: PHP Mailing List Sent: Tuesday, February 06, 2001 6:23 PM Subject: [PHP] Save to Local Disk Hello, I'd like to give the user an option to "Save to Disk" the contents of a text area. Any ideas how to do this? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Modulus Formatting
Hi Michael, Use a temporary variable [counter], if counter%3 == 0 then write in the output. $counter=0; print ""; while($row = mysql_fetch_array($result)) { echo "".$row["user_id"].""; $counter++; if (!$counter%3) { echo ""; } } That's all ;-) Ahmad Anvari - Original Message - From: Michael Hall To: PHP List Sent: Tuesday, February 06, 2001 10:03 AM Subject: [PHP] Modulus Formatting > I can pull data out of a database using mysql_fetch_array and assemble it like this using a while statement: > > $data > $data > $data > etc ... > > What I'd like to do is assemble it like this: > > $data$data$data > etc... > > In other words, I need a break () every three times through the > loop. > > I've tried several snippets of code from this list's archive but none seem > to work. I've tried while statements, for statements and the list function > in every combination I can think of ... no go. I know that modulus is what I need but I can't crack the right code combination. > > Does anyone have a solution or can they point me to a resource somewhere? > > > Thanks > > Mick > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]