[PHP] Reading Form Buttons
Hello, I cant figure this one out. In one form I have two button that needs to trigger their respective functions. input type= submit name =Update value =Update Record input type= submit name =Delete value =Delete Record In php, how would I read the values or the names of the buttons pressed? -Dan
Re: [PHP] Reading Form Buttons
Oh, so its the same as reading post data from form fields. Cool. That makes it easy. Thank you - Original Message - From: Jeff McKeon [EMAIL PROTECTED] To: Dan J. Rychlik [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, September 25, 2003 2:38 PM Subject: RE: [PHP] Reading Form Buttons If(isset($_post['update'])) { do something; } If(isset($_POST['delete'])) { do something; } Jeff -Original Message- From: Dan J. Rychlik [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 3:35 PM To: [EMAIL PROTECTED] Subject: [PHP] Reading Form Buttons Hello, I cant figure this one out. In one form I have two button that needs to trigger their respective functions. input type= submit name =Update value =Update Record input type= submit name =Delete value =Delete Record In php, how would I read the values or the names of the buttons pressed? -Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] rename variables
Global works... - Original Message - From: Jennifer Goodie [EMAIL PROTECTED] To: Boyd Pearson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, September 24, 2003 3:44 PM Subject: RE: [PHP] rename variables I'm trying to rename some variables. first I have a function - randomize (3,4); //has created unique $numbers then I want to create a function for the renaming: renameit($sculp); //sends $sculp for the new variable name and this function (and variations) function renameit($var){ $z = 1; foreach ($numbers as $currNum){ $var[$z++] = $output[$currNum]; //creates $sculp[1 and 2] } } but failed if I use $z = 1; foreach ($numbers as $currNum){ $sculp[$z++] = $output[$currNum]; after randomize (3,4); it works fine -but I want it in a function. Any suggestions? Read up on scope. If you want $numbers to be available to your function it has to be in that function's scope. Either pass it or declare it global. http://us2.php.net/variables.scope -- 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] SQL statement
Hello, Im having a bit of trouble with the DATE_FORMAT function in mysql. $query = ('SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') FROM custlogon'); I know its failing because php doesnt like the quotation before the format parameters. Ive tried to fix this without any luck. Any Ideas ? DATE_FORMAT ( timestamp, ' %d%m%y ') Thanks in advance, -Dan
Re: [PHP] Re: SQL statement
Tried that, it failed. I recieve undefined index timestamp. when executing. - Original Message - From: Ney André de Mello Zunino [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 7:04 PM Subject: [PHP] Re: SQL statement Dan J. Rychlik wrote: $query = ('SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') FROM custlogon'); Trying enclosing the whole SQL query string in double quotes. Regards, -- Ney André de Mello Zunino -- 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] SQL statement
Ive used this $query = (SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') FROM custlogon); But I recieve unknown index timestamp. *shrug* - Original Message - From: Chris W. Parker [EMAIL PROTECTED] To: Dan J. Rychlik [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 7:07 PM Subject: RE: [PHP] SQL statement Dan J. Rychlik mailto:[EMAIL PROTECTED] on Tuesday, September 23, 2003 4:58 PM said: I know its failing because php doesnt like the quotation before the format parameters. Ive tried to fix this without any luck. Any Ideas ? It's failing because the ' before the %d is closing the string. Here's how I work out SQL stuffs: $sql = SELECT username\n . , password\n . , DATE_FORMAT(timestamp, '%d%m%y')\n .FROM custlogon; $query = ($sql); Althought it looks like it takes a lot more time to write (which is true) it looks great when you are debugging. echo pre$sql/pre; Alternatively you should be able to do this: $query = (SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') FROM custlogon); 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] SQL statement
Jennifer, you're right, I am using fetch_array... I tried to use your suggestion, and it failing as well, It wont even execute Do you have a better method of looping through all these records?? - Original Message - From: Jennifer Goodie [EMAIL PROTECTED] To: Dan J. Rychlik [EMAIL PROTECTED]; Chris W. Parker [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 7:15 PM Subject: RE: [PHP] SQL statement Ive used this $query = (SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') FROM custlogon); But I recieve unknown index timestamp. *shrug* You are receiving the error on an array returned by fetch_array? If so, it is because the index is DATE_FORMAT(timestamp, '%d%m%y'), not timestamp, which isn't so great. You can see this by doing a print_r on the array to see what is actually in it. Use aliasing in your query to give it a better index. SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') as formatted_ts FROM custlogon or something like that. -- 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] SQL statement
I dont believe it to be an error because Ive run this from the CLI on my zeus system. I have also echoed out the sql statement to read exactly what is being read. The other elements in the record are return as expected, except for the timestamp in which the DATE_FORMAT mysql function is called. I know its got to be problem with the string terminators and or the way the fetch_array reads the elements of a record in my database. - Original Message - From: Jennifer Goodie [EMAIL PROTECTED] To: Dan J. Rychlik [EMAIL PROTECTED]; Chris W. Parker [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 7:25 PM Subject: RE: [PHP] SQL statement Jennifer, you're right, I am using fetch_array... I tried to use your suggestion, and it failing as well, It wont even execute Do you have a better method of looping through all these records?? There's probably an error in my SQL syntax. What is mysql_error() telling you? If it was my query and my database I'd probably know what the problem is just by looking, but it isn't and I don't. -- 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] SQL statement
This didnt work as well. SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') as formatted_ts FROM custlogon; It caused my script to die and not execute at all - Original Message - From: Jennifer Goodie [EMAIL PROTECTED] To: Dan J. Rychlik [EMAIL PROTECTED]; Chris W. Parker [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 7:15 PM Subject: RE: [PHP] SQL statement Ive used this $query = (SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') FROM custlogon); But I recieve unknown index timestamp. *shrug* You are receiving the error on an array returned by fetch_array? If so, it is because the index is DATE_FORMAT(timestamp, '%d%m%y'), not timestamp, which isn't so great. You can see this by doing a print_r on the array to see what is actually in it. Use aliasing in your query to give it a better index. SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') as formatted_ts FROM custlogon or something like that. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SQL statement
Thank you for your time on this. I do apologize for being a pain. Here is my code... ?php // Function that runs reports on logon history function logonHist() { db_connect(); //establish connection $_qlogonhist = (SELECT username,host_info,status, DATE_FORMAT(timestamp, '%d%m%y') as formatted_ts FROM custlogon_hist); // Build query. //$_qlogonhist = ('SELECT * FROM custlogon_hist'); $_rlogonhist = mysql_query($_qlogonhist); ? table width=50% border=0 align=center cellpadding=0 cellspacing=0 ?php while ($row = mysql_fetch_array($_rlogonhist)) { ? tr td width=27%strongfont color=#00 size=2 face=Arial, Helvetica, sans-serifUsername/font/strong/td td colspan=3font color=#00 size=2 face=Arial, Helvetica, sans-serif ?php echo $row['username'];?/font/td /tr tr tdstrongfont color=#00 size=2 face=Arial, Helvetica, sans-serifHost Info /font/strong/td td colspan=3font color=#00 size=2 face=Arial, Helvetica, sans-serif ?php echo $row['host_info'];?/font/td /tr tr tdstrongfont color=#00 size=2 face=Arial, Helvetica, sans-serifStatus/font/strong/td td colspan=3font color=#00 size=2 face=Arial, Helvetica, sans-serif ?php echo $row['status'];?/font/td /tr tr tdstrongfont color=#00 size=2 face=Arial, Helvetica, sans-serifTime Stamp /font/strong/td td colspan=3font color=#00 size=2 face=Arial, Helvetica, sans-serif ?php echo $row['timestamp'];?/font/td /tr tr bgcolor=#99 tdnbsp;/td td width=38%nbsp;/td td colspan=2nbsp;/td /tr ?php } // end while ? /table ?php } // end function ? ERROR Username drychlik Host Info 127.0.0.1 Status OK Time Stamp Notice: Undefined index: timestamp in C:\Program Files\Apache Group\Apache2\htdocs\Ameriforms\admintool\includes\getlogonhist.php on line 44 - Original Message - From: Jennifer Goodie [EMAIL PROTECTED] To: Dan J. Rychlik [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 7:39 PM Subject: RE: [PHP] SQL statement Jennifer, you're right, I am using fetch_array... I tried to use your suggestion, and it failing as well, It wont even execute There's probably an error in my SQL syntax. What is mysql_error() telling you? I dont believe it to be an error because Ive run this from the CLI on my zeus system. I have also echoed out the sql statement to read exactly what I know its got to be problem with the string terminators and or the way the fetch_array reads the elements of a record in my database. Why don't you humor me and tell me what the error is and show me the code that is generating it. A PHP error message and the output from mysql_error() will go a long way in debugging a problem. I can't really work with it stops working and it fails to execute, those don't tell me much except that there's probably a problem with the query. -- 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] SQL statement
I tried this, and it failed. Thank you for the suggestion! - Original Message - From: Cody Phanekham [EMAIL PROTECTED] To: Dan J. Rychlik [EMAIL PROTECTED]; [EMAIL PROTECTED]; Chris W. Parker [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 7:43 PM Subject: RE: [PHP] SQL statement http://www.mysql.com/doc/en/Reserved_words.html [snip] 6.1.7 Is MySQL Picky About Reserved Words? A common problem stems from trying to create a table with column names that use the names of datatypes or functions built into MySQL, such as TIMESTAMP or GROUP. You're allowed to do it (for example, ABS is allowed as a column name). However, by default, in function invocations no whitespace is allowed between the function name and the following `(' character, so that a function call can be distinguished from a reference to a column name. [/snip] try renaming the field timestamp to something else and see if that helps? -Original Message- From: Dan J. Rychlik [mailto:[EMAIL PROTECTED] Sent: Wednesday, 24 September 2003 10:32 To: [EMAIL PROTECTED]; Chris W. Parker; [EMAIL PROTECTED] Subject: Re: [PHP] SQL statement This didnt work as well. SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') as formatted_ts FROM custlogon; It caused my script to die and not execute at all - Original Message - From: Jennifer Goodie [EMAIL PROTECTED] To: Dan J. Rychlik [EMAIL PROTECTED]; Chris W. Parker [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 7:15 PM Subject: RE: [PHP] SQL statement Ive used this $query = (SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') FROM custlogon); But I recieve unknown index timestamp. *shrug* You are receiving the error on an array returned by fetch_array? If so, it is because the index is DATE_FORMAT(timestamp, '%d%m%y'), not timestamp, which isn't so great. You can see this by doing a print_r on the array to see what is actually in it. Use aliasing in your query to give it a better index. SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') as formatted_ts FROM custlogon or something like that. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php * This e-mail, including any attachments to it, may contain confidential and/or personal information. If you have received this e-mail in error, you must not copy, distribute, or disclose it, use or take any action based on the information contained within it. Please notify the sender immediately by return e-mail of the error and then delete the original e-mail. The information contained within this e-mail may be solely the opinion of the sender and may not necessarily reflect the position, beliefs or opinions of Salmat on any issue. This email has been swept for the presence of computer viruses known to Salmat's anti-virus systems. For more information, visit our website at www.salmat.com.au. * -- 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] SQL statement
Well, we have a word for myself that over looks things and takes things literal. Its called pencil smoke It means dump, dunce, and lost. Jennifer was right, their was an error in my SQL query. SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') as timestamp FROM custlogon; not as formatted_ts. It worked fine even on zeus it tested fine. Thanks for your help Sincerely, Daniel - Original Message - From: Dan J. Rychlik [EMAIL PROTECTED] To: Cody Phanekham [EMAIL PROTECTED]; [EMAIL PROTECTED]; Chris W. Parker [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 7:50 PM Subject: Re: [PHP] SQL statement I tried this, and it failed. Thank you for the suggestion! - Original Message - From: Cody Phanekham [EMAIL PROTECTED] To: Dan J. Rychlik [EMAIL PROTECTED]; [EMAIL PROTECTED]; Chris W. Parker [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 7:43 PM Subject: RE: [PHP] SQL statement http://www.mysql.com/doc/en/Reserved_words.html [snip] 6.1.7 Is MySQL Picky About Reserved Words? A common problem stems from trying to create a table with column names that use the names of datatypes or functions built into MySQL, such as TIMESTAMP or GROUP. You're allowed to do it (for example, ABS is allowed as a column name). However, by default, in function invocations no whitespace is allowed between the function name and the following `(' character, so that a function call can be distinguished from a reference to a column name. [/snip] try renaming the field timestamp to something else and see if that helps? -Original Message- From: Dan J. Rychlik [mailto:[EMAIL PROTECTED] Sent: Wednesday, 24 September 2003 10:32 To: [EMAIL PROTECTED]; Chris W. Parker; [EMAIL PROTECTED] Subject: Re: [PHP] SQL statement This didnt work as well. SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') as formatted_ts FROM custlogon; It caused my script to die and not execute at all - Original Message - From: Jennifer Goodie [EMAIL PROTECTED] To: Dan J. Rychlik [EMAIL PROTECTED]; Chris W. Parker [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 7:15 PM Subject: RE: [PHP] SQL statement Ive used this $query = (SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') FROM custlogon); But I recieve unknown index timestamp. *shrug* You are receiving the error on an array returned by fetch_array? If so, it is because the index is DATE_FORMAT(timestamp, '%d%m%y'), not timestamp, which isn't so great. You can see this by doing a print_r on the array to see what is actually in it. Use aliasing in your query to give it a better index. SELECT username, password, DATE_FORMAT(timestamp, '%d%m%y') as formatted_ts FROM custlogon or something like that. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php * This e-mail, including any attachments to it, may contain confidential and/or personal information. If you have received this e-mail in error, you must not copy, distribute, or disclose it, use or take any action based on the information contained within it. Please notify the sender immediately by return e-mail of the error and then delete the original e-mail. The information contained within this e-mail may be solely the opinion of the sender and may not necessarily reflect the position, beliefs or opinions of Salmat on any issue. This email has been swept for the presence of computer viruses known to Salmat's anti-virus systems. For more information, visit our website at www.salmat.com.au. * -- 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
[PHP] Reading URL is changed
I am trying to figure out the best way to accomplish this task. I have one file that performs a certain amount of functions based on a user link choice. All the links point to the same document. I know I need a control structure that reads what link was read but Im not sure how to do this. for ex. a href = this.phpFirst Link/a a href= this.phpSecond Link/a Im cant figure out how to read First Link in php so that I can execute the needed function. Has anyone accomplished this? Thanks so much in advance, -Dan
Re: [PHP] Reading URL is changed
That seems to work pretty good. Thank you for this technique. -Dan - Original Message - From: Vail, Warren [EMAIL PROTECTED] To: Dan J. Rychlik [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, September 19, 2003 7:32 PM Subject: RE: [PHP] Reading URL is changed Not sure if this is what you are looking for, but have you tried; a href = this.php?L=1stlinkFirst Link/a a href= this.php?L=2ndlinkSecond Link/a and then in this.php $link = $_GET[L]; Warren Vail -Original Message- From: Dan J. Rychlik [mailto:[EMAIL PROTECTED] Sent: Friday, September 19, 2003 5:11 PM To: [EMAIL PROTECTED] Subject: [PHP] Reading URL is changed I am trying to figure out the best way to accomplish this task. I have one file that performs a certain amount of functions based on a user link choice. All the links point to the same document. I know I need a control structure that reads what link was read but Im not sure how to do this. for ex. a href = this.phpFirst Link/a a href= this.phpSecond Link/a Im cant figure out how to read First Link in php so that I can execute the needed function. Has anyone accomplished this? Thanks so much in advance, -Dan -- 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] Flash Chat
Hello, I was wondering if my solution would work in theory in providing a Flash chat application. I would use the AMFPHP to interface with the flash object. I would use a class to describe the chat room and creat new objects for private rooms. Do you think that this will truly work, In theory I mean. Has anyone accomplished this before? -Dan
Re: [PHP] Whats wrong with my code?
Your missing your default for your case switch statement And you ; at the end of line on your last include statement.. -Dan - Original Message - From: Stevie D Peele [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 16, 2003 4:10 PM Subject: [PHP] Whats wrong with my code? Can someone spot what Is wrong with my code? ?php $page = $_GET['id']; switch ($page) { case home: $include = /includes/index.html; break; case arts: $include = /includes/arts.html; break; case aaexpert: $include = /includes/aaexpert.html; break; case career: $include = /includes/career.html; break; case comics: $include = /includes/comics.html; break; case graphics: $include = /includes/graphics.html; break; case computers: $include = includes/computers.html; break; case consumers: $include = /includes/consumer.html; break; case dailies: $include = /includes/dailies.html; break; case forums: $include = /includes/forums.html; break; case downloads: $include = /includes/downloads.html; break; case editors: $include = /includes/editors.html; break; case educational: $include = /includes/educational.html; break; case electronics: $include = /includes/electronics.html; break; case entertainment: $include = /includes/entertainment.html; break; case shopping: $include = /includes/shopping.html; break; case free: $include = /includes/freetime.html; break; case government: $include = /includes/government.html; break; case governments: $includes = /includes/governments.html; break; case healthnews: $includes = /includes/healthnews.html; break; case homegarden: $includes = /includes/homegarden.html; break; case homework: $includes = /includes/homework.html; break; case stuffworks: $includes = /includes/hsworks.html; break; case inthenews: $includes = /includes/inthenews.html; break; case infokiosk: $includes = /includes/kiosk.html; break; case knowledge: $includes = /includes/builder.html; break; case money: $includes = /includes/money.html; break; case yahoo: $includes = /includes/yahoo.html; break; case museums: $includes = /includes/museums.html; break; case othernews: $includes = /includes/othernews.html; break; case pictures: $includes = /includes/pictures.html; break; case politics: $includes = includes/politics.html; break; case quotations: $includes = /includes/quotes.html; break; case recreation: $includes = /includes/recreation.html; break; case reference: $includes = /includes/reference.html; break; case reviews: $includes = /includes/reviews.html; break; case search: $includes = /includes/search.html; break; case society: $include = /includes/society.html; break; case sports: $include = /includes/sportsnews.html; break; case studyhelp: $include = /includes/study.html; break; case travel: $include = /includes/travel.html; break; case USA: $includes = /includes/usa.html; break; case USNews: $includes = includes/usnews.html; break; case weather: $includes = /includes/weather.html; break; case webmaster: $includes = /includes/webmaster.html; break; case goodbad: $includes = /includes/goodbad.html; break; case world: $includes = /includes/world.html; break; } include ($include) ? It says Line 195 which is the ? Would it matter I don't have all of these files (i.e. /includes/world.html) were uploaded yet? Thanks, Stevie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Control Structure problem
Thank you guys. I truly know the level of expertise on this mailing list, and I know that it proves invaluable. Thank you again. -Dan - Original Message - From: Luke Skywalker [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 16, 2003 7:01 PM Subject: Re: [PHP] Control Structure problem try if ( $var == TEST ONE || $var == TEST TWO || $var == TEST THREE) { do something; } luke - Original Message - From: Dan J. Rychlik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 9:53 AM Subject: [PHP] Control Structure problem This doesnt work as expected. if ( $var === TEST ONE || TEST TWO || TEST THREE) { do something; } It returns true on all strings. Ive tried using the or operator and the == but these fail as well. Any Ideas? -Dan -- 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] Control Structure problem
This doesnt work as expected. if ( $var === TEST ONE || TEST TWO || TEST THREE) { do something; } It returns true on all strings. Ive tried using the or operator and the == but these fail as well. Any Ideas? -Dan
[PHP] Calling functions from Button actions
Is their an easy way to call a function based upon a button action? -Dan
[PHP] Dynamic Drill down menus
Hello, I have created a db that holds specific information ie a business name. I am running into a problem on a form when you choose the business name another list is suppossed to populate the address or addresses, if multiple occur, and you can select the address. I am not able to sucessfully pull off this dynamic drill down list in my form because I do not know how to check data from a form field that hasnt been posted through $POST VARS array. My question is, is their a way to do this in PHP? Do I have to learn javascript in order to accomplish this task or will I have to have a submit button for each form element? Thanks in advance, Daniel
Re: [PHP] The stupidest question of the month.
I wrote a similiar IO Socket script by what you are describing. I used perl and the IO::Socket module. It was pretty straight forward and their is plenty of docs out there on that module. Just a thought Good Luck! Daniel - Original Message - From: René Fournier [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Thursday, July 17, 2003 4:17 PM Subject: [PHP] The stupidest question of the month. (Okay, now you're prepared...) I need to write a little program that opens and maintains a TCP socket connection to a server across the Internet. This little program would wait for messages from the server it's connected to, then record those messages and send a kinda of acknowledgment Got it. I've written a fair amount of PHP scripts for web sites, but nothing that would run in the background, independently say of a web browser or server. In other words, I don't really know what I'm doing, or where to start. I've looked at PHP.net's socket docs, but everything seems to scream experimental, use at own risk, etc. This little program, while operationally simple, needs to be very reliable. For example, if the socket connection dies for some reason, it would know to open a new one. Or if the server doesn't acknowledge my little program's periodic Hey, you still there-type pings, it would close the connection and reopen a new one. (In fact, at the end of this message I'll list the basic operation and flow of the little program as stated by the company running the server to which I would connect.) In any case, what I want to know is, can this be done with PHP on a run-of-the-mill PHP-savvy ISP? Or would I need something more configurable? Would I need to learn C and compile a UNIX program to do this? Any ideas where to start? Resources, links? Anything would be much appreciated Thanks very much in advance. Here is how the little program should function, according to the Company: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- The following describes the basic operation and flow needed within the DC: Setup and open tcp socket using IP address and port number13 Send a Password_DS to the DS Send a Resend_DS to the DS Enter infinite loop: Wait for messages from the DS Upon receipt of a Send_DS from the DS Store message contents appropriately Send a Send_DS_Ack to the DS Send message contents to other CSP applications Upon receipt of a Ping_DS Respond with a Ping_DS_Ack Upon receipt of a Status_DS Respond with a Status_DS_Ack If needed, send message to other CSP process(es) Periodically, send a Ping_DS to the DS If the Ping_DS transmit fails Clean-up and restart the socket connection If a Ping_DS_Ack is not received from the DS Clean-up and restart the socket connection In this sequence, the data formats for the messages must follow the requirements shown earlier. I.e., the Startup_DS message must include the correct client type; the Send_DS_Ack messages must include the hostID and sequenceID data, etc. The data contents received by the DC will usually be formatted and forwarded to other CSP-internal procedures for further processing. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ...Rene -- 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] Is their a flash and php mailing list?
Is their a flash and php mailing list? or PHP for Flash mailing list?
[PHP] Passing value back to SWF
I have a swf file that I have created with a appropriate loadvarnum() function. I have created a $statusmsg dynamic text field. When I execute my script with a button action I am able to This works fine. print statusmsg=.Passing value; But when I print statusmsg=. $testvariable; Returns null, or no value... Im not sure why this wont work, Ive read some documents on how to make flash and php talk. Any ideas or suggestions?
[PHP] Code and Good Design Methods
I am reading PHP and MySQL web development 2nd edition book. Chapter 6 talks about displaying dynamic web content using class objects. For the type of project that I am building, this is not optimal. How do I keep my self from having html mixed with my PHP code? In other words how do I serperate the two. I need to concentrate on writing good code and not designing a nice looking website. (someone else is going to do that) Can I assign include() statements to a variable ? How would you guys accomplish this? Thanks so much in advance, Daniel
Re: [PHP] Re: Code and Good Design Methods
hmm.. ill have a look. Thanks again. - Original Message - From: zbranigan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, July 12, 2003 9:15 PM Subject: [PHP] Re: Code and Good Design Methods Dan == Dan J Rychlik [EMAIL PROTECTED] writes: Dan I am reading PHP and MySQL web development 2nd edition book. Dan Chapter 6 talks about displaying dynamic web content using Dan class objects. For the type of project that I am building, Dan this is not optimal. How do I keep my self from having html Dan mixed with my PHP code? try having a look at the Smarty templating engine. -- no toll on the internet; there are paths of many kinds; whoever passes this portal will travel freely in the world -- 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