[PHP] newbie question about code

2010-09-10 Thread Adam Williams
I'm looking at someone's code to learn and I'm relatively new to programming. In the code I see commands like: $code->do_command(); I'm not really sure what that means. How would that look in procedural style programming? do_command($code); or something else? -- PHP General Mailing List

[PHP] stripping first comma off and everything after

2010-06-18 Thread Adam Williams
I'm querying data and have results such as a variable named $entries[$i]["dn"]: CN=NTPRTPS3-LANIER-LD335c-LH107-PPRNP9A92,OU=XXf,OU=XX,OU=X,DC=,DC=xx,DC=xxx Basically I need to strip off the first command everything after, so that I just have it d

Re: [PHP] html email showing instead of line breaks

2009-09-24 Thread Adam Williams
oh nevermind, i see double quotes translate the \r\n to its appropriate EOL character. Adam Williams wrote: Thanks, i'll try that. what is the difference in using '' and ""? I thought they were interchangeable. Jonathan Tapicer wrote: \r\n should be bet

Re: [PHP] html email showing instead of line breaks

2009-09-24 Thread Adam Williams
Thanks, i'll try that. what is the difference in using '' and ""? I thought they were interchangeable. Jonathan Tapicer wrote: \r\n should be between double quotes: "\r\n" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] html email showing instead of line breaks

2009-09-24 Thread Adam Williams
I have users enter support tickets into a a form and then it emails it to me, I'm trying to get the emails to display when they hit enter correctly, so i'm changing the \r\n to , but in the email i'm getting, its displaying the instead of a line break: here is the code: $message = "new supp

[PHP] running php script as a user?

2009-07-15 Thread Adam Williams
I have a page where a user authenticates, fills in some information in an HTML form, and then when clicking on the submit button, will need to execute a php schell script as that user to write some data to their /home/username directory. Since apache web server runs as the user nobody, how wil

Re: [PHP] fixing new lines from in an email?

2009-06-26 Thread Adam Williams
Daniel Brown wrote: In a cursory glance, I've noticed the following code: htmlspecialchars(nl2br(str_replace('\r','',$_POST["problem"]))) You are using a literal '\r' in your str_replace() function. This should instead be replaced with double quotes to translate the \r to its appropr

[PHP] fixing new lines from in an email?

2009-06-26 Thread Adam Williams
I have staff fill out a form that contains a with their problem description and emailed to me when they click submit. Staff will press enter in the text area, but I'm having problems converting the \r\n into a new line in the email that is sent to me, here is the code: $subject = "new suppor

[PHP] graphical integrated development environment recommendations?

2009-05-01 Thread Adam Williams
With the wide range of users on the list, I'm sure there are plenty of opinions on what are good graphical IDE's and which ones to avoid. I'd like to get away from using notepad.exe to code with due to its limitations. Something that supports syntax/code highlighting and has browser previews

Re: [PHP] SMTP mail server

2009-04-24 Thread Adam Williams
Ron Piggott wrote: How do I specify an actual SMTP server? (Like mail.host.com) This is what I have so far: mail($email, $subject, $message, $headers); I was to http://ca2.php.net/manual/en/function.mail.php and saw this syntax: mail ( string $to , string $subject , string $message [, stri

Re: [PHP] I need ideas for things to code

2009-04-24 Thread Adam Williams
Andrew Hucks wrote: I've been coding PHP for about a year, and I'm running out of things to code that force me to learn new things. If you have any suggestions, I'd greatly appreciate it. I'm currently writing an in-house PHP helpdesk ticket system. I looked at all the open source ones i

Re: [PHP] help with explode()

2009-04-24 Thread Adam Williams
Jan G.B. wrote: Yes, preg_match_all returns all matches and the subpattern matches (the "stuff" inside the brakes) You can ommit stop it by using (?:) instead of ().. So: preg_match_all('/(?:[a-z]+|"[a-z ]+")/i', $_POST["terms"], $termsarray) You might want to check out the regular expression

Re: [PHP] help with explode()

2009-04-24 Thread Adam Williams
Jan G.B. wrote: You could try it with regular expression matching.. for example: Regards Thanks. That seems to create 2 duplicate arrays, though. Can it be narrowed down to just array [0]? preg_match_all('/([a-z]+|"[a-z ]+")/i', $_POST["terms"], $termsarray); echo $_POST["terms"]."

[PHP] help with explode()

2009-04-24 Thread Adam Williams
I have a form where users submit search terms and it explodes the terms into an array based upon spaces. But, how can I have explode() keep words in quotation marks together? For example, if someone enters on the form: John Jill "Judy Smith" and I run $termsarray = explode(" ", $_POST["term

Re: [PHP] how to determine if a mysql query returns an empty set?

2009-04-23 Thread Adam Williams
Andrew Ballard wrote: It won't be any of those because the query is successful even if it returns no records. You could use http://us2.php.net/manual/en/mysqli-stmt.num-rows.php to determine how many rows were returned. Andrew Oh ok, thanks that makes sense. Thanks for the link also --

Re: [PHP] how to determine if a mysql query returns an empty set?

2009-04-23 Thread Adam Williams
Nitsan Bin-Nun wrote: mysql_num_rows() maybe? if not I probably haven't understood your question. Thanks, I never thought of trying that. This code works! $mysqli_get_requests = mysqli_query($mysqli,$get_requests); if (!mysqli_num_rows($mysqli_get_requests))

[PHP] how to determine if a mysql query returns an empty set?

2009-04-23 Thread Adam Williams
Is there a way to determine if a mysql query returns an empty set? I am selecting 10 results at a time with a limit statement and need to know when i've ran out of rows. I've only got 2 rows in the database, so when I start with row 10, it returns an empty set. I have the following code: /

Re: [PHP] php isn't displaying mysql query correctly

2009-04-17 Thread Adam Williams
Shawn McKenzie wrote: No. How about: while ($row = mysqli_fetch_array($mysqli_get_support_types_result)) { echo "".$row['types']; } thanks, now that you provided that, I see that I left out the $row variable! -- PHP General Mailing List (http://www.php.net/) To uns

[PHP] php isn't displaying mysql query correctly

2009-04-17 Thread Adam Williams
I have the code: $mysqli_get_support_types = "Select types from support_types order by types"; $mysqli_get_support_types_result = mysqli_query($mysqli,$mysqli_get_support_types) or die(mysqli_error($mysqli)); while (mysqli_fetch_array($mysqli_get_support_types_result)) { echo "

Re: [PHP] GIS with PHP tutorial

2009-04-15 Thread Adam Williams
have you looked into this? http://postgis.refractions.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] header() and passing sessions

2009-04-15 Thread Adam Williams
abdulazeez alugo wrote: Hi, Well I'ld say the reason is quite obvious. You have simply not set $_session["username"] . I'ld have done something like: -- option.php -- header('Location: http://intra.mdah.state.ms.us/helpdesk/viewpending.php?PHPSESSID='.SID); //

[PHP] header() and passing sessions

2009-04-15 Thread Adam Williams
I need some help passing a session variable with a header() function. According to www.php.net/header, the documentation states: *Note*: Session ID is not passed with Location header even if session.use_trans_sid is enabled. It must by passed manually using *SID* constant. so, I'm trying

Re: [PHP] Re: help with end of line charater

2009-01-30 Thread Adam Williams
Shawn McKenzie wrote: This may be best handled in your sorting code. What does it look like? yeah just a second ago a big lightbulb went off in my head and i fixed my code to add a \r\n on saving, and strip it on viewing. I sort on viewing, not sort on saving. The viewing code looks lik

[PHP] help with end of line charater

2009-01-30 Thread Adam Williams
I have staff inputting email addresses into a named $list on a form and when they click submit, my php script sorts the email addresses and writes to disk. The problem is, lets say they enter the email addresses b...@mdah.state.ms.us ama...@mdah.state.ms.us sa...@mdah.state.ms.us j...@mdah.s

Re: [PHP] removing text from a string

2008-11-04 Thread Adam Williams
Thanks Boyd, your code did exactly what I wanted! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] removing text from a string

2008-11-04 Thread Adam Williams
I have a file that looks like: 1. Some Text here 2. Another Line of Text 3. Yet another line of text 340. All the way to number 340 And I want to remove the Number, period, and blank space at the begining of each line. How can I accomplish this? Opening the file to modify it is easy, I'm jus

[PHP] going from procedural style to object orientated style coding

2008-05-30 Thread Adam Williams
I was wondering if anyone knew of some books/tutorials/howto's, etc on going from procedural style coding to object orientated coding with PHP? I've been using PHP since version 3 and am used to the procedural style, but I'm noticing that PHP's trend is going to the object orientated style, bu

Re: [PHP] New search related question

2008-02-05 Thread Adam Williams
http://search.mnogo.ru Jason Pruim wrote: Hi Everyone! :) Just a quick question, I've done some googling but haven't been able to find what I need... I am looking at doing a search function for someone's website, the website is just static HTML files, and she doesn't want to redo the entire

Re: [PHP] checking user input of MM-DD-YYYY

2008-01-15 Thread Adam Williams
Andrew Ballard wrote: All the more reason I would turn it into a timestamp or DateTime object in PHP first. That will prevent trying to insert something like what I used above. Then I would get rid of the MySQL STR_TO_DATE function in the $mysqli_insert_sql value just replace it with something li

Re: [PHP] checking user input of MM-DD-YYYY

2008-01-15 Thread Adam Williams
Andrew Ballard wrote: Just curious why you won't take 1-15-2008. Once you validate it, you can always assign it to a variable as either a timestamp or a DateTime object and then format it however you want when you display it, send it to a database, or whatever you are doing with the date. FWIW

Re: [PHP] checking user input of MM-DD-YYYY

2008-01-15 Thread Adam Williams
Thanks, I think I have it: $dateexplode = explode("-", $_POST["date_entered"]); if (!preg_match("/^(\d{2})$/", $dateexplode[0],$data1) || !preg_match("/^(\d{2})$/", $dateexplode[1],$data2) || !preg_match("/^(\d{4})$/", $dateexplode[2],$data3)) { die ("you have entered an invalid dat

[PHP] checking user input of MM-DD-YYYY

2008-01-15 Thread Adam Williams
I'm having users enter dates in MM-DD- format. is there a way to check if what they have entered is invalid (like if they enter 1-15-2008 instead of 01-15-2008) ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] handling ' with mysql/php insert and select

2008-01-03 Thread Adam Williams
In my form, I am parsing all the text inputs through mysql_real_escape_string() before inserting the data. however, when I look at the SQL query in PHP, when I type the word blah's to my text box variable, and then insert it into mysql after being ran through mysql_real_escape_string(), it doe

[PHP] Re: mysql date question

2008-01-03 Thread Adam Williams
nevermind, figure it out, had to take the ' ' away from contract.length_start :) Adam Williams wrote: I have a field in mysql as shown by describe contract; | length_start | date| YES | | NULL || Which stores it in the mysql format

[PHP] mysql date question

2008-01-03 Thread Adam Williams
I have a field in mysql as shown by describe contract; | length_start | date| YES | | NULL || Which stores it in the mysql format of -MM-DD. However, I need the output of my select statement to show it in MM-DD- format. I can select i

[PHP] Fatal error: Function name must be a string

2008-01-02 Thread Adam Williams
I'm getting the following error and I don't see whats wrong with my line. Any ideas? *Fatal error*: Function name must be a string in */var/www/sites/intra-test/contract/perform.php* on line *57* and my snippet of code is: if ( $_POST["perform"] == "View Contracts" ) { $mysql

[PHP] Wrong parameter count for imap_open()

2008-01-02 Thread Adam Williams
I'm running PHP 5.2.4 and getting the error: *Warning*: Wrong parameter count for imap_open() in */var/www/sites/intra-test/contract/login.php* on line *9 *My code is: $mbox = imap_open("\"{mail.mdah.state.ms.us/imap/novalidate-cert:143}INBOX\", \"".$_POST["username"]."\", \"".$_POST["passwor

Re: [PHP] how to handle inserting special characters into a mysql field

2007-12-14 Thread Adam Williams
Thanks for all the replies everyone. I have a question on mysql_real_escape_string(). The PHP example page shows: $query = sprintf("SELECT * FROM users WHERE user='%s' AND password='%s'", mysql_real_escape_string($user), mysql_real_escape_string($password)); and I unders

[PHP] how to handle inserting special characters into a mysql field

2007-12-14 Thread Adam Williams
I'm going to be inserting data from a PHP form into a mysql field. The data could contain special characters like < > ' " \ /, etc. How do I handle that? just $data = addslashes(htmlspecialchars($data)); before the insert query? because later on the data will be read back from the mysql db

Re: [PHP] mysql DATE_FORMAT() question

2007-12-12 Thread Adam Williams
nevermind, I see I had a mistake in my mysql statement, I should of been: select DATE_FORMAT(testdate, '%m\-%d\-%Y') as date_column from testtable; please disregard. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] mysql DATE_FORMAT() question

2007-12-12 Thread Adam Williams
I ran the commands: CREATE TABLE testtable ( testdate DATETIME); INSERT INTO testtable (testdate) VALUES (now()); and then I want to select it but format it to show the date only (not the time, and yes I know I could use DATE instead of DATETIME, but there may be cases where I need to show th

[PHP] parsing text for special characters

2007-11-29 Thread Adam Williams
I've got an html form, and I have PHP parse the message variables for special characters so when I concatenate all off the message variables together, if a person has put in a ' " or other special character, it won't break it when it used in mail($to, "MMH Suggestion", "$message", "$headers");

Re: [PHP] problem with foreach

2007-10-22 Thread Adam Williams
Robert Cummings wrote: On Mon, 2007-10-22 at 18:07 +0100, Stut wrote: Adam Williams wrote: I have an html page with checkboxes: Modern Mississippi Civil Rights MilitaryHistory and mailform2.php containing: echo "you selected: "; /* line 81 */ foreach ($_POST[opt

[PHP] problem with foreach

2007-10-22 Thread Adam Williams
I have an html page with checkboxes: Modern Mississippi Civil Rights MilitaryHistory and mailform2.php containing: echo "you selected: "; /* line 81 */ foreach ($_POST[option] as $a) { echo "$a"; } but I'm getting the error: you selected: *Warning*: Invalid argument

Re: [PHP] echo'ing a variable and cat'ing text

2006-03-02 Thread Adam Williams
got it! i had to have my block of code look like this: if ( $file = file ( $filename ) ) { foreach ( $file as $line ) { if ( $line != "" ) { $line = trim($line); echo ( $line . "@mdah.state.ms.us" ); echo "\n"; } } } else { echo ( "

Re: [PHP] echo'ing a variable and cat'ing text

2006-03-02 Thread Adam Williams
John Nichel wrote: Well, you're not telling fgets how much to read for one, and I'd do this a different way to begin with... if ( $file = file ( $filename ) ) { foreach ( $file as $line ) { if ( $file != "" ) { echo ( $line . "@mdah.state.ms.us" ); } } } else

Re: [PHP] echo'ing a variable and cat'ing text

2006-03-02 Thread Adam Williams
Hi, I just tried that, didn't make a difference, still not getting my expected output. [EMAIL PROTECTED] wrote: [snip] echo "$thedata"."@mdah.state.ms.us"; [/snip] Try echo "$thedata".'@mdah.state.ms.us'; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www

[PHP] echo'ing a variable and cat'ing text

2006-03-02 Thread Adam Williams
I have a file called userlist. I'm trying to read the file, and then echo their name and add @mdah.state.ms.us with it. In the file userlist, it looks like: userabc userdef userxyz and I have the following code: But when I run it, I get: @mdah.state.ms.ususerabc @mdah.state.ms.ususerdef

[PHP] grabbing source of a URL

2004-12-10 Thread Adam Williams
Hi, I don't know what functions to use so maybe someone can help me out. I want to grab a URL's source (all the code from a link) and then cut out a block of text from it, throw it away, and then show the page. For example, if I have page.html with 3 lines: hi this is line a this is line b

[PHP] stripping text from a string

2004-10-29 Thread Adam Williams
Hi, I use a piece of proprietary software at work that uses weird session ID strings in the URL. A sample URL looks like: http://zed2.mdah.state.ms.us/F/CC8V7H1JF4LNBVP5KARL4KGE8AHIKP1I72JSBG6AYQSMK8YF4Y-01471?func=find-b-0 The weird session ID string changes each time you login. Anyway, how c

Re: [PHP] fopen and http://

2004-10-08 Thread Adam Williams
On Fri, 8 Oct 2004, Hendrik Schmieder wrote: > What say phpinfo about Registered PHP Streams ? > >Hendrik > > Hi, I think I just figured out my problem...I had to use rtrim($line) because I think there was a \n or an invisible character at the end of the line that was being passed to

Re: [PHP] fopen and http://

2004-10-08 Thread Adam Williams
On Fri, 8 Oct 2004, Matt M. wrote: > > But I don't understand why I am getting that error about failed to open > > strem: HTTP request failed, when I can bring up the links fine in a > > browser on the server running the php script. So can anyone help me out? > > Thanks > > do you have allow_url

[PHP] fopen and http://

2004-10-08 Thread Adam Williams
Hi, I'm having a problem with fopen and http files. I keep getting the error: Warning: fopen(http://zed/htdocs/rgfindingaids/series594.html ) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/awilliam/public_html/rgfaidstest.php on line 15 http://zed

[PHP] opposite of array_unique()?

2004-08-04 Thread Adam Williams
array_unique() removes duplicate values from an array. Is there an opposite function or way of keeping all values in a single dimentional array that are duplicates and removing all that are duplicates? for example if I have an array: array( [0] => 'dog', [1] => 'cat', [2] => 'rabbit', [3] => '

[PHP] single dimensional array questions

2004-08-04 Thread Adam Williams
Here is my snippet of code. It takes cardnum from the database, removes the duplicates for each individual date, and then counts how many discrete numbers there was. //database connect and selection here, now my sql statement: $sql = "select convert( varchar,eventime, 110) as date, cardnum f

Re: [PHP] converting a char variable to an int?

2004-06-14 Thread Adam Williams
eh nevermind, I found settype(); :) thanks On Mon, 14 Jun 2004, Adam Williams wrote: > Hi, I have a variable that is created using the date command: > > $date = date("Ymd"); > > but its not working in my database this way (when I explicity enter > 20040614 in

[PHP] converting a char variable to an int?

2004-06-14 Thread Adam Williams
Hi, I have a variable that is created using the date command: $date = date("Ymd"); but its not working in my database this way (when I explicity enter 20040614 in my database, it works though). so I think PHP is making $date a character variable, so how can I force or change the caste of $date

Re: [PHP] rounding average to one decimal point

2004-05-10 Thread Adam Williams
On Mon, 10 May 2004, Richard Davey wrote: > Hello Adam, > > Monday, May 10, 2004, 7:03:36 PM, you wrote: > > AW> Hi, I have a randon group of numbers I need the average of. When I add > AW> them up and divide by how many there are and print the result, I get a > AW> lot of decimal places. The

[PHP] rounding average to one decimal point

2004-05-10 Thread Adam Williams
Hi, I have a randon group of numbers I need the average of. When I add them up and divide by how many there are and print the result, I get a lot of decimal places. The number comes out to look like 29.3529411765, but I don't need that many decimal places. rounding to one decimal place will

[PHP] adding -'s to a numeric string

2004-04-21 Thread Adam Williams
Hi, I have a form where I have a user entering in the date in a numeric string. For today they would enter 04212004 and so on...I'm working on this date within mysql server, and mssql server handles dates as 04-21-2004 when you use convert(varchar,field,110). So how in PHP can I change a vari

Re: [PHP] ocilogon

2004-03-30 Thread Adam Williams
Hi, I figured out what was wrong, I had php_oci8.dll uncommented in php.ini but not php_oracle.dll. Fixed that and now I get an ORA-12705 error, which looking on google has something to do with NLS. Going to do more reading, thanks :) -- PHP General Mailing List (http://www.php.net/) To unsu

Re: [PHP] ocilogon

2004-03-30 Thread Adam Williams
es.ora ($ORACLE_HOME/network/admin) > > Let's say that you make connection to Oracle using sqlplus: > User: scott > pass: tiger > dbstring: test > > this in PHP would be: $conn = OCILogon("scott", "tiger", "test"); > > > -William

[PHP] ocilogon

2004-03-30 Thread Adam Williams
Hi, what is the syntax for using ocilogon() to connect to a remote server? The remote server's name is zed.mdah.state.ms.us (ip is 10.8.5.4) and the database is zed.aleph0. Locally on zed I can do ociogon("user","pw","zed.alpeh0") and connect fine, but on a remote server I try ociogon("user",

[PHP] str_replace or regex

2004-03-18 Thread Adam Williams
Hi, I was wondering if I can get some help with either a str_replace or a regex. I have some data and it always begins with $$ but it can end with any letter of the alphabet. so sometimes its $$a and sometimes its $$b and sometimes $$c all the way to $$z. $$a all the way to $$z needs to be ch

Re: [PHP] regex to change ' to ?

2004-03-04 Thread Adam Williams
Thank you, that works great! On Thu, 4 Mar 2004, Richard Davey wrote: > Hello Adam, > > Thursday, March 4, 2004, 3:36:06 PM, you wrote: > > AW> What would be the PHP expression to change any and all ' to ? in a > AW> variable? > > AW> I want to change any and all ' in $_POST[data] to ? > > $o

[PHP] regex to change ' to ?

2004-03-04 Thread Adam Williams
What would be the PHP expression to change any and all ' to ? in a variable? I want to change any and all ' in $_POST[data] to ? what would be the statement? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] authentication using /etc/passwd

2004-02-05 Thread Adam Williams
Hi, is there a way to authenticate a username/password someone enters in a form with what is in /etc/passwd? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] authentication comparing to /etc/passwd

2004-02-03 Thread Adam Williams
Hi, is there a PHP function or some sort of way to have a user enter their username and password in a form, and compare the username and password and see if the username exists and the password is correct? basically I want to have a page where a person enters their username and password and if

[PHP] date conversion

2003-12-10 Thread Adam Williams
Hi, is there a PHP function that will convert MM/DD/ to MMDD? Also I will need to take into affect some people may put in M/D/ (some people may put in 1 instead of 01, 2 instead of 02, etc). Is there a way to do this? -- PHP General Mailing List (http://www.php.net/) To unsubscri

[PHP] date convertion

2003-12-09 Thread Adam Williams
I have a script where a user inputs a date in MMDD format, and I need to convert it to month day, year. For example they will enter 20031209 and I need the script to return the date as December 09, 2003. They won't be entering today's date, so I can't use the timestamp with the date funct

Re: [PHP] escaping ' when inside a " "

2003-11-17 Thread Adam Williams
Yeah thats what I meant to do, my PHP is very rusty if you can't tell (and so is my SQL) :) Jay Blanchard wrote: [snip] If I have the SQL statement: $sql = "select subject from subwhile where subject = '*$var[0]*'"; Don't you want to do: $sql = "select subject from subwhile where subject LIK

[PHP] escaping ' when inside a " "

2003-11-17 Thread Adam Williams
If I have the SQL statement: $sql = "select subject from subwhile where subject = '*$var[0]*'"; do I need to put a \ before each '? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] explode()

2003-11-17 Thread Adam Williams
I am having a user enter a phrase into a textbox, and then I need to seperate the words he has typed into variables so I can use each one in an sql statement. I know I will use the explode() function to do this, but how will I know how many variables I've created. For instance, if a user type

Re: [PHP] keyword searching

2003-11-12 Thread Adam Williams
I'm using Informix SQL. Do you know how to do full text searching on Informix? If so, please share the details :) Jay Blanchard wrote: [snip] I am selecting a field in a database called description for keyword searching. The field contains names of people, states, years, etc. When someone s

[PHP] keyword searching

2003-11-12 Thread Adam Williams
Hello, I am selecting a field in a database called description for keyword searching. The field contains names of people, states, years, etc. When someone searches for say "holmes north carolina" the query searches for exactly that, fields which have "holmes north carolina", and not fields t

[PHP] testing a variable

2003-11-12 Thread Adam Williams
Hello, I need to test a variable to see if it contains a value or not, and if not, do something. My php is a little rusty, so which would be better? if ( !$var ) { echo "do something";} or if ( !isset($var ) { echo "do something";} or are both of those wrong, and if so, how hsoudl I check if

Re: [PHP] ignoring case

2003-11-12 Thread Adam Williams
Hi, I finally found it in my notes, it was sql_regcase() Rolf Brusletto wrote: Adam Williams wrote: Hi, does anyone happen to know off hand the function that will ignore case for data inputted via text from a ? I don't remember it off hand and can't find it in the function list

[PHP] ignoring case

2003-11-12 Thread Adam Williams
Hi, does anyone happen to know off hand the function that will ignore case for data inputted via text from a ? I don't remember it off hand and can't find it in the function list on php.net. Basically it changes the text in the string from a character to [a-Z] for each character. I know it

[PHP] sql query/displaying results question

2003-10-23 Thread Adam Williams
I have a php page I am writing with an SQL query. I am going to query the database for a couple of fields. One of the fields I am querying is the title oh the document someone is searching for. The title will be used at the top of the html page and will say: "you are searching for document n

[PHP] displaying time on the server

2003-10-15 Thread Adam Williams
Hello, I was wondering if someone knew how to display the time on the server to a web page that resides on that server, and have it update the time each second? I was looking at javascript for this, but they all use the client PC viewing the page to get the time, but I want it to display the s

[PHP] allowing access to php page by IP

2003-10-07 Thread Adam Williams
Hello, I want to allow access to a php page but am not sure how I should verify the IP once I get it. I want to allow 10.8.4.* and 10.8.5.* to access a certain webpage and keep everyone else out. I have written code to figure out what someone's IP is, but am not sure about how I should verify

[PHP] PHP 4.3.3 compile error

2003-09-05 Thread Adam Williams
Hello, I'm trying to compile PHP 4.3.3. My configure is: ./configure --enable-track-vars --without-mysql --with-mail --with-apxs2=/usr/local/apache2/bin/apxs --with-informix and when doing make I get: [EMAIL PROTECTED] php-4.3.3]# make /bin/sh /root/php-4.3.3/libtool --silent --preserve-dup-d

Re: [PHP] fwrite() question

2003-07-01 Thread Adam Williams
Hi, when I do that, nothing is written to news.txt, and I'm not sure why. This is the entire script: unable to write to news.txt"; exit; } Header("Location: http://archives1.mdah.state.ms.us/news.php"; ); } ?> News update Please make your changes below and then click

[PHP] fwrite() question

2003-07-01 Thread Adam Williams
Hello, I have a block of code: unable to write to news.txt"; exit; } Header("Location: http://archives1.mdah.state.ms.us/news.php"; ); } ?> and when I access it, I get the error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /usr/l

Re: [PHP] reading CD information

2003-02-05 Thread Adam Williams
l the correct .exe file on it to load the application. Its for a library and will be used by the general public, so I am making it as simple as possible :) Adam On Wed, 5 Feb 2003, John Nichel wrote: > Guess it's not on Linux, eh? :) > > Adam Williams wrote

Re[2]: [PHP] reading CD information

2003-02-05 Thread Adam Williams
Thanks Tom, that works perfect! Adam On Thu, 6 Feb 2003, Tom Rogers wrote: > Hi, Adam > > > TR> You could try the vol command using exec{} and parse out the volume name > > TR> -- > TR> regards, > TR> Tom > > This should do it: > exec("vol g:",$resu

RE: [PHP] reading CD information

2003-02-05 Thread Adam Williams
It would be in the cd-rom drive of the webserver. The CD's would be rotated periodically and the only way I have to identify what is on each cd and which .exe to run on it is by identifying it by its cd label. I've searched google and php.net but haven't found a function that can read cd labels.

[PHP] reading CD information

2003-02-05 Thread Adam Williams
Is it possible to have PHP read cd label information? You know in windows like after you put in a CD and use Windows Explorer and go to your CD rom drive's letter it will say like D: (MSOffice2K) or D: (date of burned cd) or D: (XPProCD), etc...If you know what I am talking about, is there a way t

Re: [PHP] Pls Help: Moving script from Win to Linux

2002-12-10 Thread Adam Williams
is register globals enabled? On Tue, 10 Dec 2002, Shane wrote: > Greetings gang. > > You know me, I never ask for help if I haven't checked all my other options, but >this is day two, and I'm getting spanked on this one. > > Some recently moved scripts from a WIN2K server running PHP 4.2.1 to an

Re: [PHP] Changeing user

2002-12-04 Thread Adam Williams
change the directory ownership to the user apache runs as, or make the dir 777. Adam On Wed, 4 Dec 2002, [iso-8859-1] Davíð Örn Jóhannsson wrote: > I need to be able to create dirs, chmod and other stuff on the server, > but I get : Warning: MkDir failed (Permission denie

Re: [PHP] PHP and Apache

2002-12-04 Thread Adam Williams
Yes On Wed, 4 Dec 2002, Vicente Valero wrote: > Excuseme my confussion, I meant PHP 4.2.3. So you suggest me PHP 4.2.3 and Apache >1.3.x?? -- 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

2002-12-04 Thread Adam Williams
If you mean PHP 4.2.3, it'll work with apache 2.0, but not that great. I'm also using PHP 4.3.0-rc2 with Apache 2.0 and its not any better. Adam On Wed, 4 Dec 2002, Vicente Valero wrote: > Hello, > > PHP 2.4.3 can work with Apache 2.0.x or I need Apache 1.3.x? -- PHP G

Re: [PHP] "x" as a multiplier

2002-12-03 Thread Adam Williams
I don't think he's trying to multiply, I think he wants to print #x#, like 800x600 or 1024x768, etc... Adam On Tue, 3 Dec 2002, Kevin Stone wrote: > Is it possible you're mistaken somehow? x isn't an operator in PHP. > Executing $a x $b will give you a parse error. Anyt

Re: [PHP] phpUpLoad

2002-11-22 Thread Adam Williams
You either need to make the directory 777 or change the ownership of the dir to apache or nobody (depending on which user httpd runs as) Adam On Fri, 22 Nov 2002, Vicky wrote: > Yup, both directorys are chmoded to 755. Lots of users are going to use this > script so... >

Re: [PHP] how can php get the values of a group of checkbox

2002-11-21 Thread Adam Williams
user name=cb[] and PHP will automatically make the array. then call it with $_GET["cb"][#] Adam On Thu, 21 Nov 2002, Xin Qi wrote: > hi there, > > if i have a group of checkboxes, and they have the SAME name, when they are > submited into a php script, how can this php f

Re: [PHP] How I Got PHP4.2.2, Apache 2.0, mySQL and RedHat 8.0 towork

2002-11-19 Thread Adam Williams
Not to burst your bubble, but I'have had all of this working since the day RedHat 8.0 was released. Though I compiled everything by hand instead of using RedHat's RPMs. Just read the comments on php.net under the apache/unix install and did what they said to add to httpd.conf for PHP.

Re: [PHP] Run webscript from command line

2002-11-14 Thread Adam Williams
0 0 * * * lynx http://whatever/blah.php &; sleep 5; killall -9 lynx Adam On Thu, 14 Nov 2002, Aate Drageset wrote: > Not specifically php-problem, but.. > How could i run a php-script from command line (cron.daily) using no GUI or X ?? > There should be some way of using

Re: [PHP] passing multiple variables in a url

2002-11-14 Thread Adam Williams
Change the space in job enquiry to a + Adam On 14 Nov 2002, BigDog wrote: > Does this not work... > > > > > > On Thu, 2002-11-14 at 14:11, CJ wrote: > > I have a "contact us" php script on my site that allows users to email > > direct from the webiste. I want to be able

Re: [PHP] Error Message

2002-11-12 Thread Adam Williams
are you using header() after you've already sent data to the browser (such as printing something to the user)? Adam On Tue, 12 Nov 2002, Ben C. wrote: > I am receiving the following error on my change password form: > > Warning: Cannot send session cache limiter - headers

Re: [PHP] get the output from a program

2002-11-12 Thread Adam Williams
No if it works use it, but if you choose to go with system() you will need to pass the command through escapeshellcmd() as a security precaution. Adam On Tue, 12 Nov 2002, Greg wrote: > exec() worked jsut fine. Is there any drawback to using this? > -Greg >

  1   2   >