[PHP] Sessions - going back in browser
Hello, I had an issue that I needed to be able to go back in the browser while in a session without getting page has expired, I was reading through the manual and came across a comment about adding the following to the sessions page to allow users to traverse back: header(Cache-control: private); (http://www.php.net/manual/en/function.session-start.php) This works fine on a Win32 dev box running Apache 1.3.x and PHP 5.0.3, but then I loaded the pages onto a RedHat box running PHP 5.0.3 on Apache 1.3.27. This box is running these pages through SSl (https) Anyone any ideas? Regards, Craig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re:^^
So now the page expires Any help appreciated. Craig Donnelly [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I had an issue that I needed to be able to go back in the browser while in a session without getting page has expired, I was reading through the manual and came across a comment about adding the following to the sessions page to allow users to traverse back: header(Cache-control: private); (http://www.php.net/manual/en/function.session-start.php) This works fine on a Win32 dev box running Apache 1.3.x and PHP 5.0.3, but then I loaded the pages onto a RedHat box running PHP 5.0.3 on Apache 1.3.27. This box is running these pages through SSl (https) Anyone any ideas? Regards, Craig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP5 FreeTDS
I had FreeTDS and PHP 4.3.x working fine, then I upgraded my PHP installation to PHP 5.0.3, now It isnt working. On the page where I connect to the MSSQL server I get the following error: Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: 172.16.xx.xxx in /var/ftpusers/tarot/tarot/admin/sqltest.php on line 4 This worked fine before, and I tested it on another box which is also running freeTDS with PHP 5.0.1 and it connects fine. Anyone any Ideas?? Regards, Craig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Using before a variable
http://php.us.themoes.org/manual/en/language.references.pass.php Passing by reference instead of value. HTH Craig Shaun [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I have noticed that some of the functions in a tutorial I am studying have an in the variable parameters i.e. function add($id) { /* function body */ } I would be most grateful if some can shed some light on this as i cant fnd any reference to this in the PHP manual... Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sessions nightmare continue...
Why are you testing if $_POST['submit'] is set are you posting something to the page?? In the two scripts you posted the code block wont be executed because there is no post variable being set. Try this: a1.php == ?php session_start(); header(Cache-control: private); // IE 6 Fix. $_SESSION[login]=inside; session_write_close(); header(Location: a2.php); exit(); ? pre ?php print_r($_SESSION); ? /pre == AND a2.php == ?php session_start(); header(Cache-control: private); // IE 6 Fix. if(!isset($_SESSION[login])){ echo(brsession variable NOT set); }else{ echo(brsession variable set); } echo(brsession ID: . session_id()); echo(brsession value: . $_SESSION[login]); ? pre ?php print_r($_SESSION); ? /pre == Works fine now. HTH Craig Angelo Zanetti [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, Still no luck with sessions. I have installed an older version: 4.3.1 and have register_globals=Off I have 2 test pages a1.php and a2.php All I want to do is register a session variable, set a value for it and then in a2.php check that it is still registered and view the session's value. a1.php: ? session_start(); header(Cache-control: private); // IE 6 Fix. if(isset($_POST['Submit'])) { $_SESSION[login]=inside; session_write_close(); header(Location: a2.php); exit(); } ? I can successfully register the session variable and set the value of it on page a1.php but when I go to page a2.php the session variable is not set and the value isnt set either. a2.php: ? session_start(); header(Cache-control: private); // IE 6 Fix. if(!isset($_SESSION[login])) echo(brsession variable NOT set); else echo(brsession variable set); echo(brsession ID: . session_id()); echo(brsession value: . $_SESSION[login]); ? I have been trying to get this to work for ages with no luck. I have been reading the manual and have googled and cant seem to find the problem. if anyone can help that would be great. thanks in advance Angelo Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: POST superglobal is empty
Show the code you are using... Craig Andy Loftus [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Does anyone have any ideas as to why $_POST would be empty when submitting a form to php? I am running PHP5 as CGI in apache 1.3.22 on redhat linux. I've also tried php4.3.8 CGI (same php configuration and .ini file) and I get the same behavior. When I submit an html form with method=post, the $_POST superglobal array is empty. GET works fine. I've tried many different configuration options with PHP but none seem to help. I've tried the default php.ini-dist config file with no luck. I've gone through all the relevant bug reports and search all the mailing lists, FAQ's and newsgroups. I can't find any useful, applicable information. My configure command is: ./configure \ --prefix=/usr/local/php/php5.0.0 \ --with-config-file-path=/usr/local/php/php5.0.0/ \ --with-config-file=/usr/local/php/php5.0.0/php.ini \ --enable-force-cgi-redirect \ --disable-path-info-check \ --enable-safe-mode \ --disable-short-tags \ --with-regex=system \ --with-mysql \ --enable-debug \ --with-mcrypt \ --enable-versioning \ --disable-libxml -- Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Checking for form submission
Hi Shaun, Your expression is evaluating, if you like does the $_POST superglobal exist and it does but might be empty, this would be the same for $_GET and other superglobals. If you did the following: if (isset($_POST) !empty($_POST)) { echo '(isset($_POST))'; } This would only appear if there was in fact a $_POST variable 'set'. If you want to test to see if a form has been submitted, I would suggest that you use the name from the submit button. e.g - input type=submit value=Send Form Data name=sendform if(isset($_POST['sendform'])){ echo Form has been submitted!; } So basically this checks if the form button sendform is set. HTH, Craig Shaun [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I am trying to create some code to check whether a form has been submitted. The following code seems to print evertime, whether a form has been submitted or not: if (isset($_POST)) { echo '(isset($_POST))'; } This seems most odd, could someone tell me why this happens? Thanks for your help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Checking for form submission
Ok, in simple form - If the submit button was clicked, If some one hits enter this would be a problem, easy way to resolve this would be to have a hidden form element flagged and to terst for that instead of the submit button, wouldnt you agree Jason? Craig Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Wednesday 04 August 2004 17:34, Craig Donnelly wrote: If you want to test to see if a form has been submitted, I would suggest that you use the name from the submit button. e.g - input type=submit value=Send Form Data name=sendform if(isset($_POST['sendform'])){ echo Form has been submitted!; } So basically this checks if the form button sendform is set. This is not reliable, some browsers does not set the submit button if it was not explicitly clicked on. Even some big name free webmail providers fall into this trap of just checking for the submit button rather than checking the form as a whole. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The biggest difference between time and space is that you can't reuse time. -- Merrick Furst */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Calling a function at a certain time of day.
Have a look at Cron http://www.webmasters-central.com/t/cron.shtml HTH Craig Angelo Zanetti [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] HI, Im slightly in the dark as to do the following. What I need is a thread of some sort that runs and when the time is midnight, it automatically calls a script that does something. Can anyone point me in the right direction as to where to start. Thanks Angelo Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Calling a function at a certain time of day.
Sorry I meant to say, assuming your on Unix/Linux system, Otherwise if Windows use task scheduler Control Panel Scheduled Tasks Cheers, Craig Craig Donnelly [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Have a look at Cron http://www.webmasters-central.com/t/cron.shtml HTH Craig Angelo Zanetti [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] HI, Im slightly in the dark as to do the following. What I need is a thread of some sort that runs and when the time is midnight, it automatically calls a script that does something. Can anyone point me in the right direction as to where to start. Thanks Angelo Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Parse Error, Unexpected $
Put all your values in the following {}... So: VALUES('{$Title}','{$ChristianName}','{$MiddleName}','{$Surname}'. and so on. HTH Craig Harlequin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I've checked my syntax but obviously missing something. Would anyone mind a quick scan: // Convert Values to Variables: $Title = $_POST[Title]; $ChristianName = $_POST[ChristianName]; $MiddleName = $_POST[MiddleName]; $Surname = $_POST[Surname]; $HomePhone = $_POST[HomePhone]; $Address01 = $_POST[Address01]; $Address02 = $_POST[Address02]; $Address03 = $_POST[Address03]; $City = $_POST[City]; $Postcode = $_POST[Postcode]; $Country = $_POST[Country]; $Nationality = $_POST[Nationality]; $Gender = $_POST[Gender]; $WorkPermitRequired = $_POST[WorkPermitRequired]; $MyStatus = $_POST[MyStatus]; // Dump Data Into MembersData: $UserDataDump = INSERT INTO MembersData (Title, ChristianName, MiddleName, Surname, DOB, TelephoneHome, Address01, Address02, Address03, AddressCity, AddressPostcode, AddressCountry, Nationality, Gender, WorkPermit, Status) VALUES('$Title','$ChristianName','$MiddleName','$Surname','$HomePhone','$Add ress01','$Address02','$Address03','$City','$Postcode','$Country','$Nationali ty','$Gender','$WorkPermitRequired','$MyStatus'); mysql_query($UserDataDump) or die(Couldn't Create User Data Entry. MySQL Error: . mysql_error()); -- - 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] Re: MySQL QUERY Results Not Appearing
$result is an array that has to be fetched...try this echo h3active members should appear here/h3; $query = mysql_query(SELECT * FROM RegisteredMembers) or die(could not execute query); while($result = mysql_fetch_array($query)){ echo $result['YOUR_DB_FIELDNAME']; } change YOUR_DB_FIELDNAME' to whatever the fields are you are querying. you could also: pre ?php print_r($result); ? /pre HTH Craig Harlequin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all... Despite being able to make a connection to the server and execute a query I am unable to do this through PHP using the following commands: echo h3active members should appear here/h3; $query = SELECT * FROM RegisteredMembers; $result = mysql_query($query) or die (could not execute query); echo $result; Any ideas...? -- - 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
Re: [PHP] Protecting database passwords
MD5 - http://ie2.php.net/md5 One way in encryption. Chris W. Parker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Bob Hockney mailto:[EMAIL PROTECTED] on Tuesday, June 29, 2004 5:58 PM said: I wrote a php script that accesses a database, and I am wondering about securing the password to the database. I could prompt the user for the password every session, but I don't necessarily want the user to have the password. you don't want the user to have the password?? how else are they supposed to login? Unless I'm missing something, any on-disk place I store the password needs to be readable by PHP, and therefore isn't very secure. 1. don't store the password in plain text. store it as a hash. 2. make the file readable only to root and the user that PHP/Apache runs under. that's about all i know. chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Running a PHP script on an automated regular schedule
Best way to achieve this would be cron/crontab http://www.webmasters-central.com/t/cron.shtml HTH Craig I.A. Gray [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi. I am wanting to use a PHP script to check on an hourly/daily basis on a few things- ie links on my sites, whether the sites are up and running and also to send an e-mail to me. I know how to do this using PHP but my problem is how to have this running 24/7. I can't really have this on a web page as wouldn't it time out? I don't have my own server and so use a hosting company. Is there a way of running a PHP script on a regular basis (say every 10 or 30 mins, or hourly or daily)? Would I have to set up my own server to do this? I just the simplest way of acheiving this. Any ideas? Does anyone know of any decent link checkers written in PHP that I could implement? Many thanks, Ian Gray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: SELECT
SELECT * FROM foo_table WHERE field_foo some_value The above will select all from foo_table except where field_foo is equal to some value. HTH Craig Phpu [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, Is there any way to select all entries in the database except one entry or tho entries? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: how to insert form data
?php include(connect.php); $name = $_POST['name']; $quote = $_POST['quote']; $sql = mysql_query(INSERT INTO whosaid (name,quote) VALUES (' . $name . ',' . $quote . ')); ? HTH Craig Bigmark [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am trying to learn how to take the value of $name and $quote from a form and put it in the database -whosaid but obviuosly i have it all wrong. Can anyone point out what im doing wrong. thx in advance ?php include(connect.php); $name = $_POST['name']; $quote = $_POST['quote']; $sql = INSERT INTO whosaid values (name='$name',quote='$quote'); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: WDDX
You bet it is.. :-) Sorry Dave. - Original Message - From: Sam Masiello [EMAIL PROTECTED] To: Craig [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, May 17, 2004 4:41 PM Subject: RE: [PHP] Re: WDDX Hehe must be too early on a Monday for Craig :) --Sam -Original Message- From: Craig [mailto:[EMAIL PROTECTED] Sent: Monday, May 17, 2004 9:31 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: WDDX take a look on http://www.phpclasses.org Good luck, Craig Dave Avent [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi All, Does anyone know if there is a WDDX Class for PHP. I have googled and checked phpclasses.org. I am unable to recompile my webserver so I cannot include wddx support that way, so if anyone can help me with any suggestions I would be very gratefull Cheers Dave -- 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] A work around my HTTP_REFERER Prob...
If returning a floating point variable, cast it back to an (int) hth Tristan Pretty [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Cheers for all ideas/suggetions so far.. I've made a little progres... Visit this URL: http://www.risk.sungard.com/secure.php?secure=126807.714285714 and here's the code.. ? $today_day = date(d); $code1 = ($today_day+1) * $_GET[secure]; $code2 = $today_day * $_GET[secure]; $code3 = ($today_day-1) * $_GET[secure]; $master_code = 887654; if (($code1 == $master_code) || ($code2 == $master_code) || ($code3 == $master_code)) { $woopee = h2DONE IT!!!/h2; } ? html head titleSecure Test/title /head body ?=$woopee ? bDebug:/b br /Secure: ?=$_GET[secure] ? br /Day: ?=$today_day ? br /Master: ?=$master_code ? br /Code 1: ?=$code1 ? br /Code 2: ?=$code2 ? br /Code 3: ?=$code3 ? /body /html If I change the GET requests to simple variables, and assign a new variable called $secure, and asign it the value: 126807.714285714 The page works! Makes me think there's a GET error? Can anyone spot my potentially obvious error? Tris... Jason Wong [EMAIL PROTECTED] 07/05/2004 13:37 To [EMAIL PROTECTED] cc Subject Re: [PHP] A work around my HTTP_REFERER Prob... On Friday 07 May 2004 20:05, [EMAIL PROTECTED] wrote: varibale called 'secure' we asign that variable that value of '4654376534' and divide it by the day (eg: if it's the 12th of may, we divide by 12.. 7th of June, we divide by 7) That would result in a floating point number ... if (($code1 == $master_code) || ($code2 == $master_code) || ($code3 == $master_code)) { ... which does not lend easily to such comparisons. If you're still intent on using this *ahem* 'security' scheme then I suggest you use multiplication instead (just make sure that the largest number you're processing is less than 2147483648 - or use the BCMath functions). -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* After all, it is only the mediocre who are always at their best. -- Jean Giraudoux */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Swear word substitution
http://www.evilwalrus.com/viewcode/560.php Cj [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'm posting this again as i got a mail saying Trend SMEX Content Filter has detected sensitive content. Place = [EMAIL PROTECTED]; ; Sender = CJ Subject = [PHP] Swear word substitution Delivery Time = November 14, 2002 (Thursday) 23:40:23 Policy = Dirty Words Action on this mail = Delete message Warning message from administrator: Sender, Content filter has detected a sensitive e-mail. There was not a swear word in my original post but there was a word that contained a swear word but is itself not a swear word. The word is Scu n thorpe and I need a script to allow wordslike this but remove proper swearwords. I've got a mysql based website with a php scripted fromt end. I want to parse the output the php scripts get from the database before printing it as html for swear words and substitute these for more acceptable words (on a word for word basis). I need to do it this way as I want to keep the original posts in their rude form in case I need evidence for misuse of the site. I need to be able to check for words separated by non alpha characters in case people get clever and write obscenities separated w i t h s p a c e s or with o_t_h_e_r characters or even new l i n e s or wordsruntogetherintoonelongword. I also want a list of permitted words that contain swearwords such as Sc%%thorpe which won't get changed. Has anybody done this? I have a feeling that there is a 1 line regular expression out there that will do this nicely. Any help appreciated Feeling rusty at coding... CJ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: confirm box
On your submit button put the following: input type=submit name=submit onClick=return confirm('Are you sure you want to delete??') Hope that helps, Craig Davy Obdam [EMAIL PROTECTED] wrote in message 001a01c26f9e$a1c78a80$960a@davy">news:001a01c26f9e$a1c78a80$960a@davy... Hi people, Maybe a bit off-topic, but i thought lets ask anyway. I have a guestbook admin page were i can delete multiple items from the database using checkboxes. So when i click on the Submit button i would like a javascript confirm box coming up. I have done that, but it deletes the item(s) anyway, also if i click on cancel. This is my javascript code in the head of the document: script language=JavaScript type=text/javascript !-- function ConfirmDelete() { input_box=confirm(Are you sure that you want to delete the selected items?); if (input_box!=true) { return false; } else { return true; } } //-- /script This is what i use in my PHP code: ?php //Guestbook admin page echo form name=\admin\ onSubmit=\ConfirmDelete();\; //The rest of my form echo input type=\submit\ name=\submit\ value=\delete\ /form; ? ?php //Delete items from guestbook if(isSet($submit)) { //Delete items } ? Any help is appreciated, thanks for your time, Best regards, Davy Obdam, mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sending Attachements through php email form
Edit this to what you need: http://www.evilwalrus.com/viewcode.php?codeEx=546 Regards, Heidi Belal [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I was wondering if anybody could tell me the best way and how to code sending an attachement with an email form. I want the user to be able to browse and select the file he wants to attach, and i want the reciepent to be able to see the file that has been attached with the email. Thanks, Heidi Belal Web Developer www.code-corner.com A bus stops at a bus station; a train stops at a train station; and on my desk i have a work station ... - Yahoo! - We Remember 9-11: A tribute to the more than 3,000 lives lost -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: checkbox question
This will work: http://www.php.net/array_merge Call your checkboxes like so: a.php == form action=b.php method=post input type=checkbox name=a1 value=Abr input type=checkbox name=a2 value=Bbr input type=checkbox name=a3 value=Cbr input type=checkbox name=a4 value=Dbr input type=checkbox name=a5 value=Ebr input type=checkbox name=a6 value=Fbr input type=submit name=submit value=SUBMIT /form == then post it to the desired page and do something like this: b.php == ?php $foo = array_merge($_POST['a1'],$_POST['a2'],$_POST['a3'],$_POST['a4'],$_POST['a5'] ,$_POST['a6']); echo $foo; // Returns an array echo pre; print_r($foo); // Look whats in the array echo /pre; ? == Best of luck, Craig B.C. Lance [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... if you can't use [] for the checkbox, the only way out is to have unique name for each checkbox. otherwise, php will always be returning the value of the last checked checkbox if all checkboxes share the same name without the []. --lance Alex Shi wrote: How to ontain data from a group of checkbox using same name? For example, in a form there're 6 checkboxes and all named as Interesting_Area. I know if put a pairs of square brackets at the end of the name then in php all the values of them can be ontained. However, for some reason I cannot use square brackets. Please help me out if anyone know how to do the trick. THanks! Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: checkbox question
Why cant you use square brackets?? call all your checkboxes the following: interesting_area[] Then post it to whatever page, now all the checkboxes that were checked are held in a array (interesting_area) To see what is contained in the array, do the following: ?php echo pre; print_r($_POST[interesting_area]); echo /pre; ? From here it depends on what you want to do with the data.. You can loop through the array, using for(), foreach() or while(), or alternatively write a function to manipulate the data. Hope that helps, Craig Alex Shi [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... How to ontain data from a group of checkbox using same name? For example, in a form there're 6 checkboxes and all named as Interesting_Area. I know if put a pairs of square brackets at the end of the name then in php all the values of them can be ontained. However, for some reason I cannot use square brackets. Please help me out if anyone know how to do the trick. THanks! Alex -- --- TrafficBuilder Network: http://www.bestadv.net/index.cfm?ref=7029 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: select box
Can you be a bit more clearer with your question? Meltem Demirkus [EMAIL PROTECTED] wrote in message 011c01c257f0$c4499780$5583@hiborya">news:011c01c257f0$c4499780$5583@hiborya... Hi, Can I put the selected option of select box later by using php? thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: SMS with PHP
You need to have an SMS gateway..Have a look on hotscripts.com here: http://www.hotscripts.com/search/?query=smscategory=php Regards, Craig Alexandra Aguiar [EMAIL PROTECTED] wrote in message 025f01c210a6$d1657ce0$[EMAIL PROTECTED]">news:025f01c210a6$d1657ce0$[EMAIL PROTECTED]... Hello ppl... i'd like to know if it's possible that a php script sends message to a cell phone... i please anything about it ... thnx in advance.. Alexandra Aguiar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Setting Cookies
http://www.php.net/manual/en/reserved.variables.php#reserved.variables.cooki es Use Superglobals...you will see what I mean. Also, Apache 2.0 is not recommended as of yet for PHP commercial development http://www.apacheweek.com/issues/02-06-07 Regards, Craig Scott 'Intense!' Reismanis [EMAIL PROTECTED] wrote in message 01c20e9f$c8720620$850d2dcb@intense">news:01c20e9f$c8720620$850d2dcb@intense... Hey all, I am having some troubles setting cookies at the moment wondering if anyone knows the solution. Anyhow basically what is happening, is that cookies are been set fine, however say I try to set two cookies in the one script i.e. setcookie(username, $HTTP_POST_VARS['username'], time()+31536000); setcookie(password, $HTTP_POST_VARS['password'], time()+31536000); only the cookie that was called last, i.e. 'password' will be set. I only started noticing this problem since I installed php4.2 and apache2.0, is that the cause? Has anyone shared a similar experience, and if so is there a fix? Thanks for your time as always. Regards, Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session Registering
Im using session in my form, there are 6 pages to the form, It all works fine, until You work your way back through the form, to ammend the filled in details. e.g - If I go to page 1, and fill out my name, and post to the next page, heres the code Im using: PHP: form method=post action=page2.php input type=text name=firstname value=?=$_SESSION['firstname'];? /form Its registered on the top of page2 with the following code: PHP: session_start(); $_SESSION['firstname']=$_POST['firstname']; That works fine, I have a link on all my pages that links back to the previous page e.g a href=page1.phpGo Back/a If I go back to the first page, from the second page the fields are populated fine, but If i continue onto page3.php then go back page1.php is no longer populated!! Any Ideas why this is happening?? and If so a remedy, Is it a code issue or a conf Issue?? Thanks C -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sessions not staying a session...
You should use session_start(); on every page that u want to pass session information.. Craig Jeff Lewis [EMAIL PROTECTED] wrote in message 00d601c1ec72$072a63d0$76a1a8c0@LEWISJCIT">news:00d601c1ec72$072a63d0$76a1a8c0@LEWISJCIT... I am storing session information by using $_SESSION[privs] and it works for the first screen but when I click on the next link it doesn't seem to carry over. Do I need to declare session start with this method? Do I need to make it global? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Tagi It!
Have a look here... http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=8txtCodeId =585 Craig Jason Whitaker [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am looking for a pre-wrote script thats does the same thing as what this company offers: http://www.tagit-board.com any one know where i can get one? to give ya an idea i want a script that will take a visitors name and message(maybe another field for a website) and write it to a page heres an example: http://www.geocities.com/babied0ll/tagit.html -- Jason Whitaker -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: newbie question: how to recompile PHP?
Strange..U sure you got the Win32 version?? Heres a mirror where u can get the installer: http://www.evilwalrus.com/downloads/php/4.1.2/php-4.1.2-installer.exe All the best, Craig Bogdan Popescu [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello all, I hope my newbie question don't bother you too much. I've downloaded the latest PHP for windows but when I try to use it I get a message that I have to re-compile it. (You may disable this restriction by recompiling the PHP binary with the --disable-force-cgi-redirect switch.) Can anybody tell me a couple of words about how to recompile PHP? Or this error message is just an issue of php.ini? I got the sources but what kind a compiler do I need, where from I can get it? -- TIA, Bogdan mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Including Files
Is there a way to setup either the apache/php directives to produce a custom 404 if an include file fails to be included ?? Or is this a job for .HTACCESS?? Regards, ~Craig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Another ?
Have a look here: http://www.evilwalrus.com/viewcode.php?codeEx=313 Craig Eric Coleman [EMAIL PROTECTED] wrote in message 001501c1d84e$42a4f480$0201a8c0@zaireweb">news:001501c1d84e$42a4f480$0201a8c0@zaireweb... Probably Opera - Original Message - From: Sean Kennedy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, March 30, 2002 12:28 PM Subject: [PHP] Another ? Hello, Whats the HTTP_USER_AGENT for opera? Thanks, -Sean Kennedy -- 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] $HTTP_USER_AGENT
Have a look here: http://www.evilwalrus.com/viewcode.php?codeEx=313 Craig Donnelly Eric Coleman [EMAIL PROTECTED] wrote in message 000b01c1d845$55158020$0201a8c0@zaireweb">news:000b01c1d845$55158020$0201a8c0@zaireweb... Why not echo $HTTP_USER_AGENT and find out? - Original Message - From: Sean Kennedy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, March 30, 2002 11:43 AM Subject: [PHP] $HTTP_USER_AGENT Hello, Im making a small php script, but I need to know how to do something. My problem is: I have a script thats like this: ?php if ($HTTP_USER_AGENT == WHAT GOES HERE FOR IE AND NS?) { echo You have Internet Explorer; } else { echo You have Netscape; } ? Do you know what I mean? Thanks, -Sean Kennedy -- 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] Custom 404
Custom 404 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 404 error triggered by Include error??
Is there a way to setup either the apache/php directives to produce a custom 404 if a file fails to be included ?? Or is this a job for .HTACCESS?? Regards, ~Craig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Connecting to a DB using PHP and mysql...
Try this for your connection: - ? // Database constants define(DATABASE_HOST, localhost); define(DATABASE_USER, root); define(DATABASE_PASSWORD, *YOUR_PASS*); define(DATABASE_NAME, *YOUR_DB_NAME*); // Establish connection $dbLink = mysql_connect(DATABASE_HOST, DATABASE_USER, DATABASE_PASSWORD); if(!$dbLink) { print Unable to connect to the database, please contact Sysadmin asap.; } else { $dbUse = mysql_select_db(DATABASE_NAME, $dbLink); } ? - Hope it helps ya, Craig Anthony Ritter [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Using the script below, I was able to connect to a database named contacts for output. *However*, when I insert a [username] and [password] in place of the , I get: Couldn't connect to the database - eventhough I am able to connect to mysql. How do I go about replacing the and to insert a password and username so that it can be connected to a database? Any advice will be greatly appreciated. TR . HTML BODY ? $connection=mysql_connect(localhost,,); if(!$connection) { echo Couldn't connect.; exit; } $db=mysql_select_db(contacts,$connection); if(!$db) { echo Couldn't connect to the database.; exit; } $sql=SELECT * FROM leads; $mysql_result=mysql_query($sql, $connection); $num_rows=mysql_num_rows($mysql_result); if($num_rows==0) { echo There is no information; } else { echoTABLE ALIGN=\Center\ BORDER=\1\; echoTRTHFONT FACE =\Arial\ SIZE=\2\First Name/THTHFONT FACE =\Arial\ SIZE=\2\Last Name/THTHFONT FACE =\Arial\ SIZE=\2\email/THTHFONT FACE =\Arial\ SIZE=\2\State/TH; while($row=mysql_fetch_array($mysql_result)) { $fname=$row[fname]; $lname=$row[lname]; $email=$row[email]; $state=$row[state]; $ID=$row[ID]; echo TRTHFONT FACE =\Arial\ SIZE=\2\$fname/THTHFONT FACE =\Arial\ SIZE=\2\$lname/THTHFONT FACE =\Arial\ SIZE=\2\$email/THTHFONT FACE =\Arial\ SIZE=\2\$state/TH/TR; } } mysql_close($connection); ? /BODY /HTML -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php