[PHP] RE: help with explode.....
Actually... That didn't work... The QuestionID and AnswerID are different from poll to poll Can I do something like a loop and pass the QuestionID and AnswerID into other variables... Ex. Here is my HTML that is dynamically created * html head titleUntitled Document/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body form action=play.php method=post name=Poll id=Poll pThe Cool Joe Survey/p pWhat color are you eyes?br blockquote input type=radio name=9 value=5Bluebr input type=radio name=9 value=7Greenbr /blockquote/p pWhat Letter does your name start withbr blockquote input type=radio name=14 value=19abr input type=radio name=14 value=20bbr input type=radio name=14 value=21cbr /blockquote/p pWhat Day is itbrblockquote input type=radio name=13 value=17Thursbr input type=radio name=13 value=18Fribr input type=radio name=13 value=16Tuesbr /blockquote/p p align=center input name=GoForm type=hidden id=GoForm value=1 input type=submit name=Submit value=Submit Survey /p /form /body /html Can I do something like this on the nest page * 1 Start the do statement til radio button name equals null 2 extract (from $_POST) the radio button name and plug it into $RadioName 3 extract (from $_POST) the radio button value and plug it into $RadioValue 4 insert it into a MySQL table 5 while statement sends you back to 1 * not exactly sure how I am going to do the while part LOL Thanks, Joe -Original Message- From: Shaunak Kashyap [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 1:14 AM To: Joe Harman Subject: Re: help with explode. The name of the set of radio buttons is the QuestionID (so it's a number)... And the options are the AnswerID (they are also numbers)... In that case, I assume your code looks something like this: input type=radio name=?=$QuestionID?... How about using an array instead of just the QuestionID as shown below: input type=radio name=Question[?=$QuestionID?... That way, on the next page (the one to which this form is being submitted) you can get the AnswerIDs by simply looping through the $_POST[Question] array (assuming your form submission method is post). Hope that made sense. Shaunak -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] help with explode.....
SO COOL... Thanks too all -Original Message- From: Binay Agarwal [mailto:[EMAIL PROTECTED] Sent: Thursday, July 24, 2003 1:48 PM To: Joe Harman Cc: [EMAIL PROTECTED] Subject: Re: [PHP] help with explode. Okay... this probably isn't that hard to do... but I am just not sure to do it... so i will ask you guys... i amsure someone is going to have a one liner for me here! I am making a survey/poll builder everything is dynamic... there is an admin section where the user can make the new survey.. and set certain surveys as active but this where I am coming into some difficulties the program builds the form dynamically... all radio buttons... when the user submits the form i need to disect each form answer and then dump it into MySQL... So I need to know if I can do something like use the 'explode()' function no this... and assign them to variables... I need to draw out the radio button id and what they answered... I really don know whether i got ur question or not. Probably ur questions is abt fetching the radio buttons id and their corresponding values, when a form is submitted . Well if u have large number of radio buttons then give some common name to all of them. like radbut1, radbut2, radbut3 and so on so u know anything starting from radbut is your radio button .. now use $HTTP_POST_VARS or GET_VARS depending upon ur form method to retrieve the variables/values pairs. i.e while(list($key,$value) = each($HTTP_POST_VARS)) { if (eregi(radbut,$key)) // radio button // Carry out operations u want } -- 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] Link acting as a submit button
* Thus wrote Matt Palermo ([EMAIL PROTECTED]): I am trying to create a submit button out of a hyperlink using the following code: (this is in a file called index.html) A href=javascript:go_where_my_variable_says('this.php');this page/a SCRIPT LANGUAGE=JavaScript !-- function go_where_my_variable_says(where) { document.forms[0].action = where; document.forms[0].submit(); } //-- /SCRIPT This works fine as an html document, however, when I try to echo the same code out in a PHP page, it gives me javascript errors. I am using the following to echo it out in PHP: echo A href=\javascript:go_where_my_variable_says('this.php');\this page/a SCRIPT LANGUAGE=\JavaScript\ !-- function go_where_my_variable_says(where) { document.forms[0].action = where; document.forms[0].submit(); } //-- /SCRIPT ; No need to echo out the statement, better to use this method so you dont have to escape each and every existing: // leave php to output html ? A href=javascript:go_where_my_variable_says('this.php');this page/a SCRIPT LANGUAGE=JavaScript !-- function go_where_my_variable_says(where) { document.forms[0].action = where; document.forms[0].submit(); } //-- /SCRIPT ?php // now back in php mode This displays the link fine for the submit hyperlink, but it gives the javascript error: Error: Object doesn't support this property or method. Code: 0 Like I said before, this code works perfectly fine if I have it an html document. Anyone got any ideas? With that being said I dont see a php problem here. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sorting algorithm(s) used by PHP's sort function
* Thus wrote Shaunak Kashyap ([EMAIL PROTECTED]): Does anyone know what sorting algorithm(s) -- quicksort, mergesort, radix sort, etc. -- does PHP use internally in its sort function? Zend actually does the sorting, and its quicksort. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include(remote HTML file) doesn't work since upgrade
my phpinfo output does not have that particular init value disable-url-fopen-wrapper. allow_url_fopen is enabled, safemode is off, and include_path is set to .:/usr/local/lib/php. further ideas? --- Curt Zirzow [EMAIL PROTECTED] wrote: * Thus wrote Police Trainee ([EMAIL PROTECTED]): When the server upgraded to php 4.3.1 from 4.2.x, I was no longer able to include remote html files. allow_url_fopen is still enabled and no other settings have changed. Running Apache 1.3.27 on Linux. This is one line that I use to call the remote html file. It also has not changed since the upgrade: ?include(http://143.43.222.103/sga;);? This line worked before, but no longer does. I have tried adding a trailing slash, using single quotes, no quotes, etc. Nothing apparently works. Please help! Was --disable-url-fopen-wrapper compiled in php? You can check your phpinfo() output in that. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Upgrade Problem
I thing, you must use $s = getenv('SCRIPT_URL'); and not $s = getenv('SCRIPT_NAME'); in php ver 4.3.2 Shaun wrote: Hi, The following code snippet is supposed to return the current page i am on and append some variables. $s = getenv('SCRIPT_NAME'); $link = $s?month=$monthyear=$yeargoto_date=yes; However, since upgrading to PHP version 4.3.2 it returns the following URL: execscriptdir/php.cgi?day=19month=07year=2003goto_date=yes when it should be bookings.php?day=19month=07year=2003goto_date=yes can anyone help please? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] arguments against moving site from Linux/Apache/PHP server to Windows/IIS/PHP needed
First of all, security.. Windows is full of security holes Did anyone mention the weak password encryption that cnet.com talked about recently? If you get a copy of the password file, you can break any MSW password in a few seconds. Macintosh passwords takes 4000 times as long (or 4000 times as much memory). And Microsoft saying Well, we don't think it's a problem. or something like that. At any rate, check the advisory lists, break them down by platform for management. Make sure they don't overlook Mac OS X Server and openBSD. Do some research -- the research your management is most likely to understand is research that is done in house. -- Joel Rees, programmer, Kansai Systems Group Altech Corporation (Alpsgiken), Osaka, Japan http://www.alpsgiken.co.jp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Redirection Question (I spoke to soon)
Finally, Thanks to all that tried to help, but I found part of the problem - sort of. In the file that I am trying to redirect to I have a form with the line: FORM onSubmit=return checkrequired(this) ACTION=season-write.php action=post name=testing It appears this line was corrupt somehow. CR/LF in your files brought over from MSWindows? After I rewrote the line from scratch it solved the problem of my paths being screwed up - why - I have no idea. Maybe it had some weird control characters or something that was screwing things up. However, there is still a problem with the header function - it still will not redirect. So did you check for things like CR/LF? -- Joel Rees, programmer, Kansai Systems Group Altech Corporation (Alpsgiken), Osaka, Japan http://www.alpsgiken.co.jp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] arguments against moving site from Linux/Apache/PHP server to Windows/IIS/PHP needed
* Thus wrote Joel Rees ([EMAIL PROTECTED]): First of all, security.. Windows is full of security holes Did anyone mention the weak password encryption that cnet.com talked about recently? If you get a copy of the password file, you can break any MSW password in a few seconds. Macintosh passwords takes 4000 times I can see it already But Sir, if we do it like this it will make password easily... Screw it, Says the Marketer/Manager/Head of sales, we have more important things to do. And slaps down a piece of paper marked in big red ink URGENT over some barely legible small print that says Network security exploit: unable to implement BSD's tcp stack properly ...Meanwhile, another VIP type person is on his way to the poor programmers desk with a stack of papers tainted with RED ink. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] cms design xml-php ?
Hi there. Is there any php book that discusses general design issues for cms's and webservices in php? Also, what is your take on xml? Is it worthwhile waiting for v5 to be released before buying a xml-php book? thanks Thomas -- +++ GMX - Mail, Messaging more http://www.gmx.net +++ Jetzt ein- oder umsteigen und USB-Speicheruhr als Prämie sichern! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Thank you everyone
Thank you everyone for making my programming get easier, I have been programming for now 9 mnths and the whole time i have been coding the LONG and HARD way, just looking at your problems and resolutions to problems has highly advanced my programming techniques. I made a very long script which was at a comfortable 6800 lines, (My admin script) after reading through techniques talked about in this list i have just re-writen the script and its not MORE powerful and only 1,500 lines :D I Know its off topic, but thank you and have a good weekend all Brenton Dobell IT Technician Lead Intranet Programmer Le Fevre High School 90 Hart St SEMAPHORE STH Phone: (08) 8449 7004 Ext 225 Fax: (08) 8449 1220 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] command line or http browser?
My uneducated guess is you are running cgi version of php binary, which is different from cli version. ermelir wrote: Hi list, I search to detect if a script is call from command line or if the call from a client http browser. for doing that, I test if: php_sapi_name()=='cli' which returns TRUE if script calls from command line; this work fine with PHP 4.2, but with PHP 5 php_sapi_name() returns cgi-fcgi so, I would know if with others php version there is others returns values? and if there is another way to detect if script is call from command line? thanks in advance for yours answers best regards _ Envie de discuter en live avec vos amis ? Tlcharger MSN Messenger http://www.ifrance.com/_reloc/m la 1re messagerie instantane de France -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uploading a file from a form
Don't you need to use $HTTP_POST_FILES array because you have register_globals off? Amanda McComb wrote: I am having a problem with uploading a file from a form. I changed the permission on the directory, but I am still getting an error. Here is my error: Copy failed./home/vencel/www/images/apt/company_logo/14Update Failed! It looks like it's not finding the file type. Here is my code: ? include(../includes/database.php); ? ? $long_path = /home/vencel/www/images/apt/; $short_path = ../images/apt/; if (($REQUEST_METHOD=='POST')) { for(reset($HTTP_POST_VARS); $key=key($HTTP_POST_VARS); next($HTTP_POST_VARS)) { $this = addslashes($HTTP_POST_VARS[$key]); $this = strtr($this, , ); $this = strtr($this, , ); $this = strtr($this, |, ); $$key = $this; } //Check for form fields, insert them. //Pull out the id auto-incremented from previous insert. //Check to see if a full-sized photo was uploaded if ($photo == none) { echo No photo.; } else { $end = strrchr($photo_name, .); echo $end; $new_photo_name = $company_id[0] . $end; if ([EMAIL PROTECTED]($photo, $long_path . company_logo/ . $photo_name)) { echo Copy failed.; echo $long_path . company_logo/ . $photo_name; echo $new_photo_name; } else { $long_photo_path = $long_path . company_logo/ . $new_photo_name; $photo_path = $short_path . company_logo/ . $new_photo_name; if ([EMAIL PROTECTED]($long_path . logo/ . $photo_name, $long_photo_path)){ echo Full sized photo not renamed.; } } } $add_image_query .= UPDATE apt_company_t set company_logo_path='$photo_path', ; $add_image_query .= WHERE company_cd = $company_id[0]; mysql_query($add_image_query) or die(Update Failed!); } } ? FORM METHOD=post ACTION=? echo $PHP_SELF ? table TR td colspan = 2BUse the iBrowse/i button to locate your file on your computer or local network./B/td/tr tr tdCompany Logo File: /tdtdinput type=file name=photo size=30/td/tr tr td colspan=2 align=centerINPUT TYPE=submit VALUE=Add/td /tr /table /FORM Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Webpage like MySql- need to be able to see all fieldsand edit
You guys should not forget htmlspecialchars() :) input name=firstname value=?= htmlspecialchars($array['firstname']) ? Jay Blanchard wrote: input type=text value=?php print($db_table_stuff); ? Adam Voigt wrote: input name=firstname value=?php echo $array['firstname']; ? input name=lastname value=?php echo $array['lastname']; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Webpage like MySql- need to be able to see all fields and edit
Hi, You might want to look at phpFriendlyAdmin at sourceforge http://sourceforge.net/projects/phpfriendly/ quote the web developer's answer to simplify content management for the masses! This package is a remote database management tool made specifically for web developers who want to ease an audience into the world of content management /quote I recently incorporated it in a homegrown Content Management System and am very happy with it... As always everything depends on the knowledgeability of your userbase... Hope this helps, Dirk Maetens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP webpage like MySQL, PART 2
Matt Hedges wrote: html headtitleUpdate Sister Info./title/head body ?php $host=host; $user=user; $password=pw; $database=db; $id=1; Why $id=1, you want to edit any sister info $connection = mysql_connect($host,$user,$password) or die (couldn't connect to server); $db = mysql_select_db($database,$connection) or die (Couldn't select database); if (@$first == no) { $query = UPDATE table SET FirstName='$FirstName',MiddleName='$MiddleName',LastName='$LastName',GradYea r='$GradYear',Email='$Email',MarriedName='$MarriedName' WHERE id='$id'; $result = mysql_query($query) or die (Couldn't execute query.); echo Thank you! Information entered. a href=actives.phpView Actives/abr; exit(); } else { $query = SELECT * FROM table WHERE id='$id'; $result = mysql_query($query) or die (Couldn't execute query.); $row = mysql_fetch_array($result); extract($row); } /* Display user phone in a form */ echo brp align='center' font size='+1'bPlease check the sister below and correct if necessary./b/font hr form action='updatesister.php?first=no' method='post' should be form action='updatesister.php?first=noid=$id' method='post' div align='center' table width='50%' border='0' cellspacing='0' cellpadding='2' trtd align='right'B$id/br/td td align='center'input type='text' name='FirstName' size='20' maxlength='20' value='$FirstName' /td td align='center'input type='text' name='MiddleName' size='20' maxlength='20' value='$MiddleName' /td td align='center'input type='text' name='LastName' size='20' maxlength='20' value='$LastName' /td td align='center'input type='text' name='GradYear' size='20' maxlength='20' value='$GradYear' /td td align='center'input type='text' name='Email' size='20' maxlength='20' value='$Email' /td td align='center'input type='text' name='MarriedName' size='20' maxlength='20' value='$MarriedName' /td /tr trtd/tdtd align='center' brinput type='submit' value='Update Sister'/td /tr /table /form; ? /body /html Visit this page as updatesister.php?id=#id# -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problems
hi eric, as far as i can see, there is no definition for your '$subnav' in your 'incHeader.php'. if you call your main script like this: 'http://example.com/index.php?subnav=home;', this should work with your inclusion. ciao SVEN Eric Fleming wrote: Here is a snippet from the header file. You can see that I am just trying to determine what the value of the subnav variable is set to in order to determine which navigational link is bold. There are other places the variable is used, but you can get an idea based on what is below. Thanks for any help. -incHeader.php-- html head title[Site Name]/title /head body table cellpadding=0 cellspacing=0 border=0 align=left tr td ? if($subnav == home){ ?b? }?a href=index.phphome/a? if($subnav == home){ ?b? }? /td /tr /table -incHeader.php-- Jennifer Goodie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Without seeing what you have in your includes, it will be hard to determine where your scope is messed up. ?php $subnav = home; include(incHeader.php); !--- CONTENT AREA --- The content would go here. !--- END CONTENT AREA --- ?php include (incFooter.php); ? Now, when I try to reference the subnav variable in the inHeader.php or incFooter.php files, it comes up blank. I am basically trying to adjust the navigation on each page depending on the page I am on. I am just learning PHP, have programmed in ColdFusion for years and in ColdFusion this was not a problem. Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] RE: help with explode.....
-Original Message- From: Joe Harman [mailto:[EMAIL PROTECTED] Sent: 25 July 2003 06:12 The name of the set of radio buttons is the QuestionID (so it's a number)... And the options are the AnswerID (they are also numbers)... This is technically invalid for PHP -- all your form field names should conform to the rules for PHP variable names, so it would be better to use name=q1, name=q2, etc. The reason is that if you were to turn register_globals on, PHP would try to create global variables using your field names, and $1, $2, etc. are not valid variables. Whilst PHP *may* get this right if you have register_globals turned off, there is no absolute guarantee that $_POST['1'] etc. will be handled correctly. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ereg problem?
by the way, it's to complicated. the brackets [ and ] are used for cha-groups. you can leave them for only one char. so this would be the same: \\n (you have to escape the backslash with a backslash) Curt Zirzow wrote: * Thus wrote John W. Holmes ([EMAIL PROTECTED]): [EMAIL PROTECTED] wrote: who can tell me what's the pattern string mean. if(ereg([\\][n],$username)) { /*Do err*/ } It's looking for a \ character or a \ character followed by the letter n anywhere within the string $username. I hope that isn't looking for a Carriage Return, cause it never will... Just in case it is strstr($username, \n); Curt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Classes
I need to create a class that looks like this: class Artikel { var $id[]; var $rubrik[]; var $ingress[]; var $kategori[]; var $frontbildtyp[]; var $frontbild[]; var $kategoribild[]; var $aktuell; function SetId($id) { $this-id[$this-aktuell] = $id; } function SetRubrik($id) { $this-id[$this-aktuell] = $id; } function SetIngress($id) { $this-id[$this-aktuell] = $id; } function SetKategori($id) { $this-id[$this-aktuell] = $id; } function SetKategoriBild($id) { $this-id[$this-aktuell] = $id; } function SetFrontbildtyp($id) { $this-id[$this-aktuell] = $id; } function SetFrontbild($id) { $this-id[$this-aktuell] = $id; } function SetNextPost() { $this-aktuell++; } function SetStartPost() { $this-aktuell = 0; } } the problem is that php wont let me :/, any ideas? regards patrick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ereg problem?
-Original Message- From: sven [mailto:[EMAIL PROTECTED] Sent: 25 July 2003 10:35 by the way, it's to complicated. the brackets [ and ] are used for cha-groups. you can leave them for only one char. so this would be the same: \\n (you have to escape the backslash with a backslash) And then we get into the typical double-quoted-regexp-backslash-proliferation problem -- the above will pass \n as the regexp, which matches a newline *not* the intended literal \n. So now you have to escape the escaped escape, to get: n Which passes \\n as the regexp, which does indeed match a literal \n ! Another way to go is to use single quotes around the regexp, since a single-quoted string does not interpret \-expressions (except for \', of course!) -- so this is the same regexp as above: '\\n' I know which I prefer, but YMMV of course! Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Classes
do you get an error-message? which? maybe you use var $id = array(); instead of var $id[]; ciao SVEN Patrik Fomin wrote: I need to create a class that looks like this: class Artikel { var $id[]; var $rubrik[]; var $ingress[]; var $kategori[]; var $frontbildtyp[]; var $frontbild[]; var $kategoribild[]; var $aktuell; function SetId($id) { $this-id[$this-aktuell] = $id; } function SetRubrik($id) { $this-id[$this-aktuell] = $id; } function SetIngress($id) { $this-id[$this-aktuell] = $id; } function SetKategori($id) { $this-id[$this-aktuell] = $id; } function SetKategoriBild($id) { $this-id[$this-aktuell] = $id; } function SetFrontbildtyp($id) { $this-id[$this-aktuell] = $id; } function SetFrontbild($id) { $this-id[$this-aktuell] = $id; } function SetNextPost() { $this-aktuell++; } function SetStartPost() { $this-aktuell = 0; } } the problem is that php wont let me :/, any ideas? regards patrick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with cache-proxies
Hi to all, i have a big problem, i use a phpBB forum in my page, here in Spain the ISP's use a cache proxie system. And when change anything in my forum such as image or new functionality, my users can not view the forum. Yesterday i include a visual system confirmation to register, and today my users can not view the forum. This is the header directives of the header file of the forum if (!empty($_SERVER['SERVER_SOFTWARE']) strstr($_SERVER ['SERVER_SOFTWARE'], 'Apache/2')) { header ('Cache-Control: no-cache, pre-check=0, post-check=0'); echo Apache 2; } else { header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0'); echo Apache; } header ('Expires: 1'); header ('Pragma: no-cache'); Any one can help me Excuse my broken english Un saludo, Danny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] call for authors
WebDevMagazine will start in September an international edition of magazine.If you want to be an author of this magazine please email to : [EMAIL PROTECTED] the folowing things: 1. Your details - name , age ,...etc 2. Your expirience 3. In what topic from Web Development you want to write articles(news, reviews) Regards Bogomil Shopov http://webdevmagazine.co.uk/n/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] function: global, static and...?
Hi, I was just thinking about functions, and I believe there were more than two keywords like global and static, which could be used in functions... does anybody know them and their functions? thx for help Michi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RE: help with explode.....
The threading is messed up on this message, so sorry for the top post. Actually, the method that Shaunak gave is the best method to use. If you took your questions and had them formatted from this: pWhat color are you eyes?br blockquote input type=radio name=9 value=5Bluebr input type=radio name=9 value=7Greenbr /blockquote/p to this: pWhat color are you eyes?br blockquote input type=radio name=q[9] value=5Bluebr input type=radio name=q[9] value=7Greenbr /blockquote/p You now have all of your questionIDs and answerIDs in the $_POST['q'] array. foreach($_POST['q'] as $questionID = $answerID) { $query = INSERT INTO answers (questionID, answerID) VALUES ('$questionID','$answerID'); } Throw in some validation, of course, and then you're done. How much easier can it be? This is what I do in my survey system. You can see a demo at http://sepodati.realxl.net/ The admin password is just password. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com Joe Harman wrote: Actually... That didn't work... The QuestionID and AnswerID are different from poll to poll Can I do something like a loop and pass the QuestionID and AnswerID into other variables... Ex. Here is my HTML that is dynamically created * html head titleUntitled Document/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body form action=play.php method=post name=Poll id=Poll pThe Cool Joe Survey/p pWhat color are you eyes?br blockquote input type=radio name=9 value=5Bluebr input type=radio name=9 value=7Greenbr /blockquote/p pWhat Letter does your name start withbr blockquote input type=radio name=14 value=19abr input type=radio name=14 value=20bbr input type=radio name=14 value=21cbr /blockquote/p pWhat Day is itbrblockquote input type=radio name=13 value=17Thursbr input type=radio name=13 value=18Fribr input type=radio name=13 value=16Tuesbr /blockquote/p p align=center input name=GoForm type=hidden id=GoForm value=1 input type=submit name=Submit value=Submit Survey /p /form /body /html Can I do something like this on the nest page * 1 Start the do statement til radio button name equals null 2 extract (from $_POST) the radio button name and plug it into $RadioName 3 extract (from $_POST) the radio button value and plug it into $RadioValue 4 insert it into a MySQL table 5 while statement sends you back to 1 * not exactly sure how I am going to do the while part LOL Thanks, Joe -Original Message- From: Shaunak Kashyap [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 1:14 AM To: Joe Harman Subject: Re: help with explode. The name of the set of radio buttons is the QuestionID (so it's a number)... And the options are the AnswerID (they are also numbers)... In that case, I assume your code looks something like this: input type=radio name=?=$QuestionID?... How about using an array instead of just the QuestionID as shown below: input type=radio name=Question[?=$QuestionID?... That way, on the next page (the one to which this form is being submitted) you can get the AnswerIDs by simply looping through the $_POST[Question] array (assuming your form submission method is post). Hope that made sense. Shaunak -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] File upload
I want to upload some file to my web site. I'm using this script: html head titleUpload Form/title /head body form action=upload_single.php method=post enctype=multipart/form-data INPUT TYPE=hidden name=MAX_FILE_SIZE value=102400 Upload a file: input type=file name=thefilebrbr input type=submit name=Submit value=Submit /form /body /html The upload_single.php script is just this: ?php $ime = $_FILES[thefile][name]; print ($ime); ? I just want for begining to print the name of file. But It doesn't work. Operating system is Linux. Web server is Apache. Can anyone help me. Greetings! Peda. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File upload
Peda wrote: I want to upload some file to my web site. [snip] But It doesn't work. Do you have file uploads enabled in php.ini? Take a look at a phpinfo() page for details. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] File upload
The upload_single.php script is just this: ?php $ime = $_FILES[thefile][name]; print ($ime); ? I just want for begining to print the name of file. But It doesn't work. Do you get anything if you change name to tmp_name to beging with? If I'm not mistaken ,name isn't filled in with anything unless You've used move_uploaded_file() first. Also check if uploads are enabled in php.ini. Oh, and if you have permissions to write in The tmp directory as well. /Jonas --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.501 / Virus Database: 299 - Release Date: 2003-07-14 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Link acting as a submit button
I have tried this method as well, but I still seem to get the same error. I have the form tag put in there and everything, with this bit of script inside the tags, but still no luck. Is there an easier way to accomplish what I want to do? Please let me know if there is. Thanks. Matt = Original Message From Curt Zirzow [EMAIL PROTECTED] = * Thus wrote Matt Palermo ([EMAIL PROTECTED]): I am trying to create a submit button out of a hyperlink using the following code: (this is in a file called index.html) A href=javascript:go_where_my_variable_says('this.php');this page/a SCRIPT LANGUAGE=JavaScript !-- function go_where_my_variable_says(where) { document.forms[0].action = where; document.forms[0].submit(); } //-- /SCRIPT This works fine as an html document, however, when I try to echo the same code out in a PHP page, it gives me javascript errors. I am using the following to echo it out in PHP: echo A href=\javascript:go_where_my_variable_says('this.php');\this page/a SCRIPT LANGUAGE=\JavaScript\ !-- function go_where_my_variable_says(where) { document.forms[0].action = where; document.forms[0].submit(); } //-- /SCRIPT ; No need to echo out the statement, better to use this method so you dont have to escape each and every existing: // leave php to output html ? A href=javascript:go_where_my_variable_says('this.php');this page/a SCRIPT LANGUAGE=JavaScript !-- function go_where_my_variable_says(where) { document.forms[0].action = where; document.forms[0].submit(); } //-- /SCRIPT ?php // now back in php mode This displays the link fine for the submit hyperlink, but it gives the javascript error: Error: Object doesn't support this property or method. Code: 0 Like I said before, this code works perfectly fine if I have it an html document. Anyone got any ideas? With that being said I dont see a php problem here. Curt -- I used to think I was indecisive, but now I'm not so sure. -- 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] File upload
Do you have file uploads enabled in php.ini? Take a look at a phpinfo() page for details. Yes I have. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File upload
i think ['name'] isn't empty, it contains the real name whereas tmp_name contains the full path to the temp_file on the server maybe you should try $HTTP_POST_FILES? Jonas Thorell [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] The upload_single.php script is just this: ?php $ime = $_FILES[thefile][name]; print ($ime); ? I just want for begining to print the name of file. But It doesn't work. Do you get anything if you change name to tmp_name to beging with? If I'm not mistaken ,name isn't filled in with anything unless You've used move_uploaded_file() first. Also check if uploads are enabled in php.ini. Oh, and if you have permissions to write in The tmp directory as well. /Jonas --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.501 / Virus Database: 299 - Release Date: 2003-07-14 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Link acting as a submit button
I just remembered (I'm not sure if it makes a difference) that I am using frames on this page. Does this matter at all? Thanks. Matt = Original Message From Matt Palermo [EMAIL PROTECTED] = Fixing the javascript that you specified still gave me the same errors... Got any more suggestions? Thanks for your help, Matt -Original Message- From: Jim Lucas [mailto:[EMAIL PROTECTED] Sent: Thursday, July 24, 2003 6:40 PM To: Matt Palermo Subject: Re: [PHP] Link acting as a submit button Your javascript is wrong. change this document.forms[0].action = where; to this document.forms[0].action.value = where; Jim Lucas - Original Message - From: Matt Palermo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 24, 2003 3:35 PM Subject: [PHP] Link acting as a submit button I am trying to create a submit button out of a hyperlink using the following code: (this is in a file called index.html) A href=javascript:go_where_my_variable_says('this.php');this page/a SCRIPT LANGUAGE=JavaScript !-- function go_where_my_variable_says(where) { document.forms[0].action = where; document.forms[0].submit(); } //-- /SCRIPT This works fine as an html document, however, when I try to echo the same code out in a PHP page, it gives me javascript errors. I am using the following to echo it out in PHP: echo A href=\javascript:go_where_my_variable_says('this.php');\this page/a SCRIPT LANGUAGE=\JavaScript\ !-- function go_where_my_variable_says(where) { document.forms[0].action = where; document.forms[0].submit(); } //-- /SCRIPT ; This displays the link fine for the submit hyperlink, but it gives the javascript error: Error: Object doesn't support this property or method. Code: 0 Like I said before, this code works perfectly fine if I have it an html document. Anyone got any ideas? Thanks, Matt -- 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] Include(remote HTML file) doesn't work since upgrade
[EMAIL PROTECTED] Police Trainee: my phpinfo output does not have that particular init value disable-url-fopen-wrapper. allow_url_fopen is enabled, safemode is off, and include_path is set to .:/usr/local/lib/php. further ideas? What happens when you try to include it? Is there an error? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Link acting as a submit button
[EMAIL PROTECTED] Matt Palermo: I just remembered (I'm not sure if it makes a difference) that I am using frames on this page. Does this matter at all? Thanks. Matt No, it doesn't... well it shouldn't anyway. Check the source code of the outputted page. Is it exactly what you want it to be? If not, you might want to try using single quotes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File upload
maybe you should try $HTTP_POST_FILES? I have tryed that too, but nothing happened. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File upload
a litle example of my upload file form enctype=multipart/form-data method=post action=doupload.php p align=center input name=userfile type=file size=30 style=font-family: v; font-size: 10pt; color: #5E6A7B; border: 1px solid #5E6A7B; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1br br button type=submit style=font-family: v; font-size: 10pt; color: #5E6A7B; border: 1px solid #5E6A7B; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1Transferir/button /p /form doupload.php ?php include configimage.php; $image_name= $HTTP_POST_FILES['userfile']['name']; //El nombre original del fichero en la máquina cliente. $image_type= $HTTP_POST_FILES['userfile']['type'];//El tipo mime del fichero (si el navegador lo proporciona). Un ejemplo podría ser image/gif. $image_size= $HTTP_POST_FILES['userfile']['size'];//El tamaño en bytes del fichero recibido. $image_tmp= $HTTP_POST_FILES['userfile']['tmp_name']; //El nombre del archivo temporal $mime_type=array(image/jpeg, image/pjpeg, image/gif, image/x-png ); $ext = strrchr($image_name,'.'); $endresult = font size=\2\El archivo ha sido transferido bra target=_blank href=http://bmwfaq.com/uploads/$image_name http://www.bmwfaq.com/uploads/$image_name /a/font; if ($image_name == ) { $endresult = font size=\2\No se han seleccionado archivos/font; }elseif (($size_limit == yes) ($limit_size $image_size)){ $endresult = font size=\2\El archivo es demasiado grande/font; }elseif (($limit_ext == yes) (!in_array(strtolower ($ext),$extensions))) { $endresult = font size=\2\Este tipo de archivo no está permitido/font; } elseif (!in_array($image_type, $mime_type)) { $endresult = font size=\2\Este tipo de archivo no es una imágen/font; } elseif (file_exists($absolute_path/$image_name)) { $endresult = font size=\2\El archivo ya existe en el servidor/font; } else { if (is_uploaded_file($image_tmp)){ copy ($image_tmp,$absolute_path./.$image_name); }else{ Possible file upload attack. Filename: . $HTTP_POST_FILES['userfile']['name']; } } ? Peda [EMAIL PROTECTED] Para: [EMAIL PROTECTED] cc: 25/07/2003 13:51 Asunto: Re: [PHP] File upload maybe you should try $HTTP_POST_FILES? I have tryed that too, but nothing happened. -- 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] File upload
maybe you should try $HTTP_POST_FILES? I have tryed that too, but nothing happened. Hm, can't think of whatever else is wrong right Now but I just tried out your script on my Server just to see, and it outputs the Filename alright. So it's nothing wrong With your script. Granted, my server is Windows/IIS instead of Linux/Apache so Maybe there's something wrong with the Httpd.conf file somewhere? /Jonas --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.501 / Virus Database: 299 - Release Date: 2003-07-14 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Link acting as a submit button
Actually, I found out what the problem is. I have a normal submit button in the same page, however when I take out the submit button, the javascript code works fine. When I put the submit button back in, I get the error again. Is there a fix for this, or do I need to make the submit button into a link instead? Thanks, Matt = Original Message From Comex [EMAIL PROTECTED] = [EMAIL PROTECTED] Matt Palermo: I just remembered (I'm not sure if it makes a difference) that I am using frames on this page. Does this matter at all? Thanks. Matt No, it doesn't... well it shouldn't anyway. Check the source code of the outputted page. Is it exactly what you want it to be? If not, you might want to try using single quotes... -- 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] Link acting as a submit button
[EMAIL PROTECTED] Matt Palermo: Actually, I found out what the problem is. I have a normal submit button in the same page, however when I take out the submit button, the javascript code works fine. When I put the submit button back in, I get the error again. Is there a fix for this, or do I need to make the submit button into a link instead? Thanks, Matt But you say it works in a HTML page. So I still think you should check if the output is right. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] XML support in PHP 5
I read in the site www.php.net that XML support has been completely redone in PHP 5. I would like to know if the old commands (like xml_parser_create, xml_parse, xml_set_element_handler...) will be removed or not. Where can I find more information about it? Thanks
Re: [PHP] File upload
could be a problem with the post settings in apache? i know apache sets some restrictions on the size and what's allowed. can't see how it'd be a linux problem... does the file appear in your tmp directory at all? - Original Message - From: Jonas Thorell [EMAIL PROTECTED] To: 'Peda' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, July 25, 2003 1:03 PM Subject: RE: [PHP] File upload maybe you should try $HTTP_POST_FILES? I have tryed that too, but nothing happened. Hm, can't think of whatever else is wrong right Now but I just tried out your script on my Server just to see, and it outputs the Filename alright. So it's nothing wrong With your script. Granted, my server is Windows/IIS instead of Linux/Apache so Maybe there's something wrong with the Httpd.conf file somewhere? /Jonas --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.501 / Virus Database: 299 - Release Date: 2003-07-14 -- 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] Link acting as a submit button
what is the javascript on it? sorry, missed the start of the thread... - Original Message - From: Matt Palermo [EMAIL PROTECTED] To: Comex [EMAIL PROTECTED]; php-general [EMAIL PROTECTED] Sent: Friday, July 25, 2003 1:05 PM Subject: RE: [PHP] Link acting as a submit button Actually, I found out what the problem is. I have a normal submit button in the same page, however when I take out the submit button, the javascript code works fine. When I put the submit button back in, I get the error again. Is there a fix for this, or do I need to make the submit button into a link instead? Thanks, Matt = Original Message From Comex [EMAIL PROTECTED] = [EMAIL PROTECTED] Matt Palermo: I just remembered (I'm not sure if it makes a difference) that I am using frames on this page. Does this matter at all? Thanks. Matt No, it doesn't... well it shouldn't anyway. Check the source code of the outputted page. Is it exactly what you want it to be? If not, you might want to try using single quotes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP should know my data!
[snip] Unfortunately I don't think some people got the joke. Next thing you know their going to complain that PHP should have told them the punchline ;) [/snip] RTFM at http://www.php.net/itsajoke or STFW at http://www.google.com/search?hl=enie=UTF-8oe=UTF-8q=PHP+jokes (which, BTW has a link to PHP + XML as its first linkFreud?) It's just too bad that the subject wasn't HELP ME! :-) Thanks for the smile! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 4.3.3-RC1 = possible bug in in_array()?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi. I've just found weird thing about in_array() function. Platform: FreeBSD 5.1/PHP 4.3.3-RC1 Consider this code: $this-_array_a and $this-_array_b ARE IDENTICAL $data = array(); foreach ($this-_array_a as $key = $value) { if (! in_array($key, $this-_array_b) $data['added'][$key] = $this-_array_a[$key]; } Therefore after execution $data should be empty. But there is whole $this-_array_a in $data after execution... The following code works ($data is empty after execution): foreach ($this-_array_a as $key = $value) { if (! isset($this-_array_b[$key])) $data['added'][$key] = $this-_array_a[$key]; } Why is this happening? Brane -BEGIN PGP SIGNATURE- iD8DBQE/ISOGfiC/E+t8hPcRAll7AJ9EbH6FwwJC/vjsBNG3qMWvWVdmbQCggILs UvLwPdDkKk2UrXxpPo6vF5M= =OqAg -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Link acting as a submit button
[EMAIL PROTECTED] skate: what is the javascript on it? sorry, missed the start of the thread... http://tinyurl.com/i0un -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 4.3.3-RC1 = possible bug in in_array()?
in_array searches for a value, you suply key. This will work as you expect: $data = array(); foreach ($this-_array_a as $key = $value) { if (! in_array($value, $this-_array_b) $data['added'][$key] = $this-_array_a[$key]; } Branko F. Grac(nar wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi. I've just found weird thing about in_array() function. Platform: FreeBSD 5.1/PHP 4.3.3-RC1 Consider this code: $this-_array_a and $this-_array_b ARE IDENTICAL $data = array(); foreach ($this-_array_a as $key = $value) { if (! in_array($key, $this-_array_b) $data['added'][$key] = $this-_array_a[$key]; } Therefore after execution $data should be empty. But there is whole $this-_array_a in $data after execution... The following code works ($data is empty after execution): foreach ($this-_array_a as $key = $value) { if (! isset($this-_array_b[$key])) $data['added'][$key] = $this-_array_a[$key]; } Why is this happening? Brane -BEGIN PGP SIGNATURE- iD8DBQE/ISOGfiC/E+t8hPcRAll7AJ9EbH6FwwJC/vjsBNG3qMWvWVdmbQCggILs UvLwPdDkKk2UrXxpPo6vF5M= =OqAg -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Site structure and sessions
I am contemplating the structure for a new site. I would like to organize the site with sub domains as in domain.com subdomain1.domain.com subdomain2.domain.com subdomain3.domain.com I understand that sessions are not passed from domain to domain or domain to subdomain. I did some searching and found out a few things. There doesn't seem to be much on the subject. There is a setting in php.ini called session.cookie_domain. It is normally left set to . However, you can set it to your domain and php will use that domain to store all sessions. This allows you to use sessions across domains. This is fine if your domains are the only domains using php on the server. I happen to use an ISP so changing the ISPs php.ini file is not an option for me. I can use ini_set() and temporarily modify the value of session.cookie_domain for the life of the script as in: ini_set(session.cookie_domain, .domain.com); The . before domain.com is needed so that it is available to subdomains as well. This line needs to be called before session_start(). I could put this in an include file and call it from each page that uses a session. I also read that ini_set() can be used in an .htaccess in the root directory of each domain, subdomain and directory where pages may use sessions. It would look something like: php_value session.cookie_domain .domain.com Setting the value in an .htaccess would be a lot easier than including ini_set(session.cookie_domain, .domain.com); on each page that uses sessions. I have not tested any of these options as I am now gathering info in order to make a decision. I would appreciate any feedback on organizing the site, using subdomains, and passing session values from domain to domain. Is this more trouble than it is worth? Should I just use directories to organize the site? Thanks in advance, Blaine -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 4.3.3-RC1 = possible bug in in_array()?
[EMAIL PROTECTED] Marek Kilimajer: in_array searches for a value, you suply key. This will work as you expect: array_key_exists searches for a key. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP should know my data!
I'm trying to open a pop-up window with PHP but I keep getting an error. HELP! Does anyone know if they plan to fix this bug in PHP5? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP should know my data!
[EMAIL PROTECTED] Step Schwarz: I'm trying to open a pop-up window with PHP but I keep getting an error. HELP! Does anyone know if they plan to fix this bug in PHP5? LOL! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysqldump
This is an attempt to create an backup script for my online databases. There are few things to sort out and the coding is not the most effiecient out there yet!!! I just wanted to check on what you guys think, am I going the right way, is there anything I should keep in mind? Mario Code below - ?php $host = localhost; $user = x; $password = x; $database = xx; $field = xxx; $db_link = mysql_connect($host, $user, $password) or die (error connect); mysql_select_db($database,$db_link); $query=DESC $field; $results=mysql_query($query); while ($row=mysql_fetch_array($results)) { if ($row[3]==PRI) { $thepri = $row[0]; } $thesql .= $row[0] . . $row[1]; if ($row[2]==YES) { $thesql .= default NULL; } else { $thesql .= NOT NULL; } $thesql .= . $row[5]; $thesql .= , \n; } $thecreate = CREATE TABLE . $field . _backup ( \n; $thecreate .= $thesql; $thecreate .= PRIMARY KEY ( . $thepri . )\n; $thecreate .= ) TYPE=MyISAM;; echo The CREATE STATEMENTbr; echo $thecreate; echo br; echo br; //==// // INSERT CODE ==// //==// $result = mysql_list_tables($database); if (!$result) { print DB Error, could not list tables\n; print 'MySQL Error: ' . mysql_error(); exit; } $z=1; while ($row = mysql_fetch_row($result)) { //*** //IMPROVE //echo $row[0] . \nbr; $z++; } // //MAKE THE FOLLOWING DYNAMIC $query2 = SELECT * from . $field; $results=mysql_query($query2); $m=0; while ($row=mysql_fetch_array($results)) { for ($i=0;$i=$z-1;$i++) { $x = $row[$i]; if (($i == 0) ($m0)) { $therest .= ),; } if ($i == 0) { $therest .= (; } if (!isset($x)) { $x = NULL; } else { $x = ' . addslashes($x). '; } if ($i0) { $therest .= ,; } $therest .= $x; } $m++; } $therest .= ); echo The INSERT STATEMENTbr; $theinsert = INSERT INTO . $field . _backup VALUES ; $theinsert .= $therest . ;; echo $theinsert; ?
[PHP] Get the current file name
Hi, due to a current PHP upgrade i am unable to use the following code to get the filename of the page: $s = getenv('SCRIPT_NAME'); I need to get the filename without any avariables attached. For example if the URL is www.mydomain.com/test.php?test=yes using $s = getenv('PHP_SELF'); returns test.php?test=yes how can I return just test.php i.e. the filename on its own Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Get the current file name
$tmp=split(\\|/,__FILE__); $s=$tmp[count($tmp)-1]; or something.. -- // DvDmanDT MSN: [EMAIL PROTECTED] Mail: [EMAIL PROTECTED] Shaun [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] Hi, due to a current PHP upgrade i am unable to use the following code to get the filename of the page: $s = getenv('SCRIPT_NAME'); I need to get the filename without any avariables attached. For example if the URL is www.mydomain.com/test.php?test=yes using $s = getenv('PHP_SELF'); returns test.php?test=yes how can I return just test.php i.e. the filename on its own Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get the current file name
u can try $filename=$_SERVER[SCRIPT_NAME]; Manoj Shaun wrote: Hi, due to a current PHP upgrade i am unable to use the following code to get the filename of the page: $s = getenv('SCRIPT_NAME'); I need to get the filename without any avariables attached. For example if the URL is www.mydomain.com/test.php?test=yes using $s = getenv('PHP_SELF'); returns test.php?test=yes how can I return just test.php i.e. the filename on its own Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get the current file name
thanks for your reply, but that doesn't seem to work either, how about removing everything after and including the ?, how would i do that? Manoj Nahar [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] u can try $filename=$_SERVER[SCRIPT_NAME]; Manoj Shaun wrote: Hi, due to a current PHP upgrade i am unable to use the following code to get the filename of the page: $s = getenv('SCRIPT_NAME'); I need to get the filename without any avariables attached. For example if the URL is www.mydomain.com/test.php?test=yes using $s = getenv('PHP_SELF'); returns test.php?test=yes how can I return just test.php i.e. the filename on its own Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP should know my data!
Quit horsing around fellas, what if the developers take interest in this thread and decide it's a good idea to release PHP6 with cranial electrodes that will detect what I want to do, and instead of me having to code the application, PHP will just spit out the application... That way our bosses won't need us... ;P On Fri, 2003-07-25 at 15:08, Comex wrote: [EMAIL PROTECTED] Step Schwarz: I'm trying to open a pop-up window with PHP but I keep getting an error. HELP! Does anyone know if they plan to fix this bug in PHP5? LOL! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: File upload
Peda wrote: I want to upload some file to my web site. The upload_single.php script is just this: ?php $ime = $_FILES[thefile][name]; print ($ime); I just want for begining to print the name of file. But It doesn't work. did you look what comes from your form? try: var_export($_FILES); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP should know my data!
[snip] Quit horsing around fellas, what if the developers take interest in this thread and decide it's a good idea to release PHP6 with cranial electrodes that will detect what I want to do, and instead of me having to code the application, PHP will just spit out the application... That way our bosses won't need us... [/snip] Do not forget the automated file-upload of the files that I haven't created yet, this feature needs a single function call...place_on_any_server($thought) Thx! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sending POST-data
I'm making a search-engine script for my site that redirects users to other search engines. Point is that on the website, there's a drop-down box with some engines and one textfield. 1. User enter the search query. 2. User selects which engine to use. 3. User submits. 4. PHP scripts checks which engine and redirects the user and the query to the selected engine. Now the thing is that some of these engines use POST method, which makes it a bit harder to redirect the query. For those who use GET I just have to use something like Header(Location: http://somewnine.com/query=$query;); So, does anyone have any good solution to this problem? //Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uploading a file from a form
* Thus wrote Amanda McComb ([EMAIL PROTECTED]): mysql_query($add_image_query) or die(Update Failed!); Print out the $add_image_query to see whats wrong with it. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP should know my data!
and much needed function debug_and_test_all_my_code(); Jay Blanchard wrote: [snip] Quit horsing around fellas, what if the developers take interest in this thread and decide it's a good idea to release PHP6 with cranial electrodes that will detect what I want to do, and instead of me having to code the application, PHP will just spit out the application... That way our bosses won't need us... [/snip] Do not forget the automated file-upload of the files that I haven't created yet, this feature needs a single function call...place_on_any_server($thought) Thx! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Link acting as a submit button
(this is in a file called index.html) A href=javascript:go_where_my_variable_says('this.php');this page/a try this a href=javascript: go_where_my_variable_says('?php echo $PHP_SELF;?');this page/a -- BigDog -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sending POST-data
--- Simon Fredriksson [EMAIL PROTECTED] wrote: Now the thing is that some of these engines use POST method, which makes it a bit harder to redirect the query. For those who use GET I just have to use something like header(Location: http://somewnine.com/query=$query;); So, does anyone have any good solution to this problem? You have to either let the user POST (rather than redirecting from your site to the target) or send the POST request yourself and display the result to the user. If you choose the latter, search the archives for sample code to send POST requests from PHP. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cms design xml-php ?
Is there any php book that discusses general design issues for cms's and webservices in php? I have not seen one dedicated to general design issues for cms' as web services in php. However, there are many great books on general design issues. Relating to various languages that can be done also in php. Those might be worth a look at. Also, what is your take on xml? Is it worthwhile waiting for v5 to be released before buying a xml-php book? There are some books that deal with xml + php that are fairly decent. However, I personally find that it is easier to separate the 2. For example, I have a great xml book and the php manual. The one thing that i notice is that when you combine the 2 then you end up missing somethings out of both. -- BigDog -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Get the current file name
how about this: $_SERVER[PHP_SELF]; ciao SVEN Shaun wrote: thanks for your reply, but that doesn't seem to work either, how about removing everything after and including the ?, how would i do that? Manoj Nahar [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] u can try $filename=$_SERVER[SCRIPT_NAME]; Manoj Shaun wrote: Hi, due to a current PHP upgrade i am unable to use the following code to get the filename of the page: $s = getenv('SCRIPT_NAME'); I need to get the filename without any avariables attached. For example if the URL is www.mydomain.com/test.php?test=yes using $s = getenv('PHP_SELF'); returns test.php?test=yes how can I return just test.php i.e. the filename on its own Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP should know my data!
Dont tell you boss about those new intelligent features of PHP ;-) LOL. Petre Agenbag wrote: Quit horsing around fellas, what if the developers take interest in this thread and decide it's a good idea to release PHP6 with cranial electrodes that will detect what I want to do, and instead of me having to code the application, PHP will just spit out the application... That way our bosses won't need us... ;P On Fri, 2003-07-25 at 15:08, Comex wrote: [EMAIL PROTECTED] Step Schwarz: I'm trying to open a pop-up window with PHP but I keep getting an error. HELP! Does anyone know if they plan to fix this bug in PHP5? LOL! -- --- Davy Obdam Web application developer Networking4all email: [EMAIL PROTECTED] email: [EMAIL PROTECTED] internet: http://www.networking4all.com --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] cms design xml-php ?
[snip] Is there any php book that discusses general design issues for cms's and webservices in php? [/snip] http://www.glasshaus.com has a book on CMS, but it is fairly general. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Link acting as a submit button
On Fri, 2003-07-25 at 05:30, Matt Palermo wrote: I just remembered (I'm not sure if it makes a difference) that I am using frames on this page. Does this matter at all? Thanks. Yes it matters tons with the javascript call. Here is some info on it...however, these questions are now javascript and not php... 1. make sure you pass in a valid page to your function. 2. make sure that you have a form that you are accessing. 3. make sure that when you access the form you are accessing the correct frame page. Example: when you set up the frames use the name attribute to assign names to the frames... so if you have a frame named frame1...then you can do this... frame1.document.forms[0].action.value = where; frame1.document.forms[0].submit; I might be off on this a little but that should get you started in the right direction. -- BigDog -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sending POST-data
Output the required form with hidden fields from your script and use onload=document.forms[0].submit(); Simon Fredriksson wrote: I'm making a search-engine script for my site that redirects users to other search engines. Point is that on the website, there's a drop-down box with some engines and one textfield. 1. User enter the search query. 2. User selects which engine to use. 3. User submits. 4. PHP scripts checks which engine and redirects the user and the query to the selected engine. Now the thing is that some of these engines use POST method, which makes it a bit harder to redirect the query. For those who use GET I just have to use something like Header(Location: http://somewnine.com/query=$query;); So, does anyone have any good solution to this problem? //Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include(remote HTML file) doesn't work since upgrade
Warning: main(http://143.43.222.103/sga) [function.main]: failed to create stream: Invalid argument in /hsphere/local/home/domain/mydomain.com/includesite.php on line 2 Warning: main() [function.main]: Failed opening 'http://143.43.222.103/sga' for inclusion (include_path='.:/usr/local/lib/php') in /hsphere/local/home/domain/mydomain.com/includesite.php on line 2 What happens when you try to include it? Is there an error? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File upload
* Thus wrote Peda ([EMAIL PROTECTED]): I want to upload some file to my web site. I'm using this script: Please Read: http://us3.php.net/manual/en/features.file-upload.php Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: File upload
did you look what comes from your form? try: var_export($_FILES); It comes the empty array: array( ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] function: global, static and...?
* Thus wrote Michael Müller ([EMAIL PROTECTED]): Hi, I was just thinking about functions, and I believe there were more than two keywords like global and static, which could be used in functions... does anybody know them and their functions? hm. I dont even know where global and static are defined in the manual. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Link acting as a submit button
I found out that it works fine without the submit button that I had in there. When I take the submit button out, it works, if I put it back in there I get the error message again. Any ideas? Matt = Original Message From [EMAIL PROTECTED] = On Fri, 2003-07-25 at 05:30, Matt Palermo wrote: I just remembered (I'm not sure if it makes a difference) that I am using frames on this page. Does this matter at all? Thanks. Yes it matters tons with the javascript call. Here is some info on it...however, these questions are now javascript and not php... 1. make sure you pass in a valid page to your function. 2. make sure that you have a form that you are accessing. 3. make sure that when you access the form you are accessing the correct frame page. Example: when you set up the frames use the name attribute to assign names to the frames... so if you have a frame named frame1...then you can do this... frame1.document.forms[0].action.value = where; frame1.document.forms[0].submit; I might be off on this a little but that should get you started in the right direction. -- BigDog -- 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] Freeze Pane
This is probably under the category of javascript, however I would like ot know if it is possible to be done with php. Let's say I have a table that is 30 columns wide and so the entire table doesn't fit on the screen. Is it possible (with php) to freeze columns while scrolling across so you don't lose the original 2 columns? And since it probably isn't, can someone suggest a language that would cover this subject? Thanks, Jay
[PHP] PHP + Sybase - auto_commit disabled
My site got it's Sybase 'auto_commit' disabled, I mean, if I type a (INSERT, UPDATE, DELETE) query on ISQL's console I got the correct result, but the same doesn't happen when I run the query via PHP. Check the code below: ? //includes with database connection and stuff $xSql= INSERT INTO oab_mailing_logs (nvaNomeMailing, nvaInicioEnvio, nvaFimEnvio, dtDataEnvio, numTamanhoMailing, intLidos) VALUES ('teste', '0', '0', '2003-01-01', 0, 0); $xQuery = sybase_query($xSql); if($xQuery) //sybase_query returns me nothing. $xQuery is not tested on the 'if' clause, it just pass through both 'if' and 'else'. { OK!br; } else { Erro!br; } //sybase_query(commit); //if I uncomment 'sybase_query(commit)' I got what I want, I mean, the INSERT is done correctly, but note that I hadn't to do this before, it's just stop running as it used to //echo xQuery- .$xQuery.br; //it outputs '1' echo Executando a query: b.$xSql./bbr; echo Linhas afetadas: .sybase_affected_rows($xQuery); //there's not output here... it's kinda empty sybase_free_result($xQuery); ? I haven't got any kind of error message, even on Sybase errorlog. Can you help me ? Thanks and the best regards -- Nilo Desenvolvedor WEB A B I L I T Y Soluções interativas +55 21 38526657 www.ability.com.br -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP + Sybase - auto_commit disabled
My site got it's Sybase 'auto_commit' disabled, I mean, if I type a (INSERT, UPDATE, DELETE) query on ISQL's console I got the correct result, but the same doesn't happen when I run the query via PHP. Check the code below: ? //includes with database connection and stuff $xSql= INSERT INTO oab_mailing_logs (nvaNomeMailing, nvaInicioEnvio, nvaFimEnvio, dtDataEnvio, numTamanhoMailing, intLidos) VALUES ('teste', '0', '0', '2003-01-01', 0, 0); $xQuery = sybase_query($xSql); if($xQuery) //sybase_query returns me nothing. $xQuery is not tested on the 'if' clause, it just pass through both 'if' and 'else'. { OK!br; } else { Erro!br; } //sybase_query(commit); //if I uncomment 'sybase_query(commit)' I got what I want, I mean, the INSERT is done correctly, but note that I hadn't to do this before, it's just stop running as it used to //echo xQuery- .$xQuery.br; //it outputs '1' echo Executando a query: b.$xSql./bbr; echo Linhas afetadas: .sybase_affected_rows($xQuery); //there's not output here... it's kinda empty sybase_free_result($xQuery); ? I haven't got any kind of error message, even on Sybase errorlog. Can you help me ? Thanks and the best regards -- Nilo Desenvolvedor WEB A B I L I T Y Soluções interativas +55 21 38526657 www.ability.com.br -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Link acting as a submit button
[snip] I found out that it works fine without the submit button that I had in there. When I take the submit button out, it works, if I put it back in there I get the error message again. Any ideas? [/snip] Are you naming the submit buttons? Not just value, but id or name? You must keep them seperate. HTH! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Freeze Pane
You could use frames for it and then set the scrolling on specific frames. -- BigDog On Fri, 2003-07-25 at 09:49, Jason Martyn wrote: This is probably under the category of javascript, however I would like ot know if it is possible to be done with php. Let's say I have a table that is 30 columns wide and so the entire table doesn't fit on the screen. Is it possible (with php) to freeze columns while scrolling across so you don't lose the original 2 columns? And since it probably isn't, can someone suggest a language that would cover this subject? Thanks, Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Freeze Pane
[snip] And since it probably isn't, can someone suggest a language that would cover this subject? [/snip] JavaScript or any other client-side magic. HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP + Sybase - auto_commit disabled
I don't know a lot about sybase, but if it's anything like oracle it works like this: A query from the console will be commited when the console is exited (plus of course any select queries performing checks at the console will reveal the result as it will be after the commit has occurred). With auto_commit turned off, a php connection needs to tell the database to actually commit before it breaks the connection (otherwise the transaction - ie update query) will roll back, ie go back to the state it was before you attempted the update. Therefore you wil lneed the sybase_query(commit) line in place to commit the transaction. Mark -Original Message- From: Nilo [mailto:[EMAIL PROTECTED] Sent: 25 July 2003 15:42 To: php-general Cc: lgjunior; Rodolfo Subject: [PHP] PHP + Sybase - auto_commit disabled My site got it's Sybase 'auto_commit' disabled, I mean, if I type a (INSERT, UPDATE, DELETE) query on ISQL's console I got the correct result, but the same doesn't happen when I run the query via PHP. Check the code below: ? //includes with database connection and stuff $xSql= INSERT INTO oab_mailing_logs (nvaNomeMailing, nvaInicioEnvio, nvaFimEnvio, dtDataEnvio, numTamanhoMailing, intLidos) VALUES ('teste', '0', '0', '2003-01-01', 0, 0); $xQuery = sybase_query($xSql); if($xQuery) //sybase_query returns me nothing. $xQuery is not tested on the 'if' clause, it just pass through both 'if' and 'else'. { OK!br; } else { Erro!br; } //sybase_query(commit); //if I uncomment 'sybase_query(commit)' I got what I want, I mean, the INSERT is done correctly, but note that I hadn't to do this before, it's just stop running as it used to //echo xQuery- .$xQuery.br; //it outputs '1' echo Executando a query: b.$xSql./bbr; echo Linhas afetadas: .sybase_affected_rows($xQuery); //there's not output here... it's kinda empty sybase_free_result($xQuery); ? I haven't got any kind of error message, even on Sybase errorlog. Can you help me ? Thanks and the best regards -- Nilo Desenvolvedor WEB A B I L I T Y Soluções interativas +55 21 38526657 www.ability.com.br -- 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] function: global, static and...?
Curt Zirzow wrote: * Thus wrote Michael Müller ([EMAIL PROTECTED]): Hi, I was just thinking about functions, and I believe there were more than two keywords like global and static, which could be used in functions... does anybody know them and their functions? hm. I dont even know where global and static are defined in the manual. hi, look here: http://www.php.net/manual/en/language.variables.scope.php ciao SVEN -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Link acting as a submit button
Why do you have a submit button and a link to submit the form. Dont u want them to use the submit button for the form? -- BigDog On Fri, 2003-07-25 at 09:02, Jay Blanchard wrote: [snip] I found out that it works fine without the submit button that I had in there. When I take the submit button out, it works, if I put it back in there I get the error message again. Any ideas? [/snip] Are you naming the submit buttons? Not just value, but id or name? You must keep them seperate. HTH! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP + Sybase - auto_commit disabled
I forgot to tell that the column 'PKintIDLog' (identity column) is incremented as if the insert was done correctly. For example: I select the max PKintIDLog column value and I got '20', then I try to insert some data on the table via PHP, I select the max PKintIDLog (I should get '21', right ?), but I got '20' cuz I had no row affected. So I insert some data via ISQL console, select the max PKintIDLog and I got '22'. Even with the misinsertion the identity column is incremented. It's pretty weird, isn't it ? I don't know a lot about sybase, but if it's anything like oracle it works like this: A query from the console will be commited when the console is exited (plus of course any select queries performing checks at the console will reveal the result as it will be after the commit has occurred). With auto_commit turned off, a php connection needs to tell the database to actually commit before it breaks the connection (otherwise the transaction - ie update query) will roll back, ie go back to the state it was before you attempted the update. Therefore you wil lneed the sybase_query(commit) line in place to commit the transaction. Mark -Original Message- From: Nilo [mailto:[EMAIL PROTECTED] Sent: 25 July 2003 15:42 To: php-general Cc: lgjunior; Rodolfo Subject: [PHP] PHP + Sybase - auto_commit disabled My site got it's Sybase 'auto_commit' disabled, I mean, if I type a (INSERT, UPDATE, DELETE) query on ISQL's console I got the correct result, but the same doesn't happen when I run the query via PHP. Check the code below: ? //includes with database connection and stuff $xSql= INSERT INTO oab_mailing_logs (nvaNomeMailing, nvaInicioEnvio, nvaFimEnvio, dtDataEnvio, numTamanhoMailing, intLidos) VALUES ('teste', '0', '0', '2003-01-01', 0, 0); $xQuery = sybase_query($xSql); if($xQuery) //sybase_query returns me nothing. $xQuery is not tested on the 'if' clause, it just pass through both 'if' and 'else'. { OK!br; } else { Erro!br; } //sybase_query(commit); //if I uncomment 'sybase_query(commit)' I got what I want, I mean, the INSERT is done correctly, but note that I hadn't to do this before, it's just stop running as it used to //echo xQuery- .$xQuery.br; //it outputs '1' echo Executando a query: b.$xSql./bbr; echo Linhas afetadas: .sybase_affected_rows($xQuery); //there's not output here... it's kinda empty sybase_free_result($xQuery); ? I haven't got any kind of error message, even on Sybase errorlog. Can you help me ? Thanks and the best regards -- Nilo Desenvolvedor WEB A B I L I T Y Soluções interativas +55 21 38526657 www.ability.com.br -- 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] Site structure and sessions
* Thus wrote Blaine ([EMAIL PROTECTED]): I also read that ini_set() can be used in an .htaccess in the root directory of each domain, subdomain and directory where pages may use sessions. It would look something like: php_value session.cookie_domain .domain.com Setting the value in an .htaccess would be a lot easier than including ini_set(session.cookie_domain, .domain.com); on each page that uses sessions. Yes, this is a wiser choice vs. setting it system wide. You do have another alternative which would be to use the 5th argument in set cookie: bool setcookie ( string name [, string value [, int expire [, string path [, string domain [, int secure]) I have not tested any of these options as I am now gathering info in order to make a decision. I would appreciate any feedback on organizing the site, using subdomains, and passing session values from domain to domain. Is this more trouble than it is worth? Should I just use directories to organize the site? In general allowing subdomains (.yourdomain.com) is safe. But as a hosting company you might perhaps allow that cookie to be modified by other people if say you set up a simple hosting site for a user: user.yourdomain.com/ or yourdomain.com/~user/ But from what it looks like you arn't planing on using that methodology, for users. I tend to stay away from directories and use subdomains to distinguish between different aspects of the site as per some examples: domain.com main web pages for domain www.domain.com main web pages for domain dbadmin.domain.com Database interface logs.domain.com View my logs. Now going back to your cookie issue, you really dont want dbadmin and logs to be using the same cookie namespace. The only namespace you would want to share would be the www.domain.com and domain.com, because they are pointing to the same place. You could also opt out of using the cookie method of passing session id around and use the php SID query paramater. But you then have to be careful at which domains you going to pass your SID too. On the other hand you have more control and it is expected to work even if the user refuses your cookies. HTH, Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include(remote HTML file) doesn't work since upgrade
Police Trainee [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Warning: main(http://143.43.222.103/sga) [function.main]: failed to create stream: Invalid argument in /hsphere/local/home/domain/mydomain.com/includesite.php on line 2 Warning: main() [function.main]: Failed opening 'http://143.43.222.103/sga' for inclusion (include_path='.:/usr/local/lib/php') in /hsphere/local/home/domain/mydomain.com/includesite.php on line 2 Ok - this is kinda weird, but I got it to work on my machine after getting the same error. I tried including a page off a different server and it worked just fine. So I started messing around and got the following to work for the page you're trying to include: include('http://wiu.edu/SGA/'); Of course, the graphics don't show... Don't ask me why that works instead, but it does for me. Give it a shot. -- Rob What happens when you try to include it? Is there an error? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysqldump
* Thus wrote Marios Adamantopoulos ([EMAIL PROTECTED]): This is an attempt to create an backup script for my online databases. There are few things to sort out and the coding is not the most effiecient out there yet!!! I just wanted to check on what you guys think, am I going the right way, is there anything I should keep in mind? perhaps something like would be a whole lot easier: `mysqldump [options] db tables`; My general policy is don't revent the wheel unless it isn't round. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Freeze Pane
I recently had to do something similar, except with the first row, instead of the the first columns. The way I did it was by creating two different tables, and putting the second table inside a div tag something like follows: div style={width:xxx; height:xxx; overflow:scroll;} Here is an example I found on MS website about how to use this: http://msdn.microsoft.com/workshop/samples/author/dhtml/refs/scrollTop.htm Using this you can set how much data you want to display and then let it create scroll bars right inside your page. I think it's a little bit cleaner than frames. -- Rob Jason Martyn [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] This is probably under the category of javascript, however I would like ot know if it is possible to be done with php. Let's say I have a table that is 30 columns wide and so the entire table doesn't fit on the screen. Is it possible (with php) to freeze columns while scrolling across so you don't lose the original 2 columns? And since it probably isn't, can someone suggest a language that would cover this subject? Thanks, Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Freeze Pane
Inline frames http://www.cs.tut.fi/~jkorpela/html/iframe.html Jason Martyn wrote: This is probably under the category of javascript, however I would like ot know if it is possible to be done with php. Let's say I have a table that is 30 columns wide and so the entire table doesn't fit on the screen. Is it possible (with php) to freeze columns while scrolling across so you don't lose the original 2 columns? And since it probably isn't, can someone suggest a language that would cover this subject? Thanks, Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Some SESSION Vars not Registering
John and Curt; Thank you both very much for your help (and persistence) in this matter. Ultimately, I used John's suggestion: creating $_SESSION['userArray'][vars]. It works. I get to keep my vars named what I want. In some ways, it's more elegant than what I was doing in that it compartmentalizes the user vars. Curt Zirzow wrote: I was browsing the php.net site and came accross this: http://bugs.php.net/bug.php?id=23354 Note the last comment on the bug. It seems that person has been having the same problem as you. Yeah - seems similar, but not quite the same. You (Curt) were able to execute my code without problem. My code on my servers failed 100% of the time, whereas the bug in the report only showed up intermittently. Thank you both again! -- Jeff Stillwall -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysqldump
I agree with Curt, why reinvent the wheel. I mean even if you are like me and cannot access the command-line on your web server (which really really sucks) then there are still other tools that can do this very same thing. If you just want to click on a link and backup the db why not use the load data infile (of course this does not backup the database structure just the data) http://www.mysql.com/doc/en/LOAD_DATA.html. Or why not just get phpMyAdmin and upload it to your server. It already has these features plus many others, and of course the best part is it is open source http://sourceforge.net/projects/phpmyadmin/. So why take the time of reinventing the wheel? Of course this is just my dumb opinion...so you can always take it or leave it. David -Original Message- From: Curt Zirzow [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 10:33 AM To: '[EMAIL PROTECTED]' Subject: Re: [PHP] mysqldump * Thus wrote Marios Adamantopoulos ([EMAIL PROTECTED]): This is an attempt to create an backup script for my online databases. There are few things to sort out and the coding is not the most effiecient out there yet!!! I just wanted to check on what you guys think, am I going the right way, is there anything I should keep in mind? perhaps something like would be a whole lot easier: `mysqldump [options] db tables`; My general policy is don't revent the wheel unless it isn't round. Curt -- I used to think I was indecisive, but now I'm not so sure. -- 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] Link acting as a submit button
Okay, I got it to work. I just put the id parameter in the submit button tag and it works fine now. Thanks for all your help guys... = Original Message From [EMAIL PROTECTED] = Why do you have a submit button and a link to submit the form. Dont u want them to use the submit button for the form? -- BigDog On Fri, 2003-07-25 at 09:02, Jay Blanchard wrote: [snip] I found out that it works fine without the submit button that I had in there. When I take the submit button out, it works, if I put it back in there I get the error message again. Any ideas? [/snip] Are you naming the submit buttons? Not just value, but id or name? You must keep them seperate. HTH! -- 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] Re: Search question ..
Hi all... On Wednesday 23 July 2003 22:16, CPT John W. Holmes wrote: From: Curt Zirzow [EMAIL PROTECTED] preg_match('#\title\(.*)\/title\#im', $text, $matches): Also, if there's ever a case where could have title My Title /title i.e. things spread over multiple lines, then you'll need: preg_match('#title(.*)/title#is',$text,$matches); or, even better (ungreedy) preg_match('#title([^]+)/title#i',$text,$matches); Thanks for you all's help but, I've tried all three of these lines and get nothing at all, blank. On the other hand I tried exec( 'grep \title\ ' .$tmp, $match); I was abe to get the titles. The odd thing was that if for example I had a list of 8 hits there would be dups in the list. Checking it closer I found that grep was stopping at the sub-dir for example two files, same sub-dir: /~hatridge/bulletin/summer03/file1.php /~hatridge/bulletin/summer03/file2.php /~hatridge/bulletin/spring03/file3.php /~hatridge/bulletin/spring03/file4.php The returns would be title1 title1 title3 title3 Any ideas? TIA! JIM Jim Hatridge Linux User #88484 -- Our country was colonized by the religious, political, economic, and criminal rejects of every country in the world. We have been carefully breeding insane, obsessive, fanatic lunatics with each other for over 400 years, resulting in the glorious strain of humanity known as Americans. You have to expect some... peculiarities. Read about new German stamps each quarter: http:/www.fecundswamp.net/~hatridge/bulletin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP should know my data!
Robert Cummings [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Unfortunately I don't think some people got the joke. Next thing you know their going to complain that PHP should have told them the punchline ;) I guess I got burned on that. I honselty though I could save one soul after not helping out that beuford guy with the longest thread that I have seen I'm really getting annoyed with PHP. I guess this shows that I'm not over 35 though, since I am not that familiar with COBOL, and took what John said with a grain of salt. Anyways, it's good to see some light humour after see that extremely long eye sore of a thread. Have a good one. Bobby Cheers, Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] create pop account via fsockopen...
All, I'm having trouble creating an pop account usaign fsockopen(), here is whaty I have... is connects ok but does not seem to execite the GET. $fp = fsockopen ($host, 2082,$errno,$errstr); if (!$fp) { echo $errstr ($errno)br\n; } else { $authstr = $cpaneluser:$cpanelpass; $pass = base64_encode($authstr); $in = GET /frontend/$cpaneltheme/mail/doaddpop.html?email=$newuserdomain=$domainpass word=$mpasswordquota=$quota\r\n HTTP/1.0\r\nAuthorization: Basic $pass\r\n ; fputs($fp, $in); fclose ( $fp ); echo centerACCOUNT CREATED/center; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] incrementing string value
writing some client side javascript with some dynamic php, and I need to be able to print a dynamic number of variables to the javascript. I need to print: var a=; var b=; ...etc. Is there a way to increment a php $var much like $var++ would work? Jeremy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] create pop account via fsockopen...
* Thus wrote Brian McGarvie ([EMAIL PROTECTED]): All, I'm having trouble creating an pop account usaign fsockopen(), here is whaty I have... is connects ok but does not seem to execite the GET. $fp = fsockopen ($host, 2082,$errno,$errstr); is this the right port? if (!$fp) { echo $errstr ($errno)br\n; } else { $authstr = $cpaneluser:$cpanelpass; $pass = base64_encode($authstr); $in = GET /frontend/$cpaneltheme/mail/doaddpop.html?email=$newuserdomain=$domainpass word=$mpasswordquota=$quota\r\n HTTP/1.0\r\nAuthorization: Basic $pass\r\n ; fputs($fp, $in); fclose ( $fp ); echo centerACCOUNT CREATED/center; Are you sure it was? Absolutely no error checking, what is the result code back from the server? did the fputs work? } Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] incrementing string value
Yep that should work as does $var-- -Original Message- From: Jeremy [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 12:28 PM To: [EMAIL PROTECTED] Subject: [PHP] incrementing string value writing some client side javascript with some dynamic php, and I need to be able to print a dynamic number of variables to the javascript. I need to print: var a=; var b=; ...etc. Is there a way to increment a php $var much like $var++ would work? Jeremy -- 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] Sending POST-data
Simon-- Why not follow the KISS approach? Generate the GET or POST directly from the client. No PHP or server-side processing needed. --John On Friday 25 July 2003 10:09 am, Simon Fredriksson wrote: I'm making a search-engine script for my site that redirects users to other search engines. Point is that on the website, there's a drop-down box with some engines and one textfield. 1. User enter the search query. 2. User selects which engine to use. 3. User submits. 4. PHP scripts checks which engine and redirects the user and the query to the selected engine. Now the thing is that some of these engines use POST method, which makes it a bit harder to redirect the query. For those who use GET I just have to use something like Header(Location: http://somewnine.com/query=$query;); So, does anyone have any good solution to this problem? //Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php