Re[2]: [PHP] Self Submitting Form
Hi Sam, I did that only because I was too lazy to upload and did the testing locally so I could grab the value in Javascript. Of course it works with post as well... test.html form name=myform1 method=get action= input type=hidden name=myvar1 value=testing script window.open(test2.html, test); /script /form test2.html BODY onLoad=document.forms[0].submit(); form name=myform1 method=post action=test.php INPUT TYPE=hidden NAME=do_preview VALUE=1 script document.write('INPUT TYPE=hidden NAME=itworks VALUE='+opener.myform1.myvar1.value+''); /script /FORM /BODY test.php ? print_r($_POST); ? Outputs: Array ( [do_preview] = 1 [itworks] = testing ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] undelivery mails
On Saturday 21 February 2004 01:41, Ryan A wrote: If you are sending out html mails you can learn a lesson from the low life bastard spammers, but in your case for a good cause (i hope), Write a script so that each email has a unique identifier as spedified in the database and from the email your script is called...(eg: via a img (src) tag )...after maybe 5 days of the person not viewing your email take them out of the db...this can be run via a cron. This will only work if the mail client does not have an option to turn off external downloads/links when viewing html mail. So the above method will unsubscribe all your smart users leaving behind the dumb ones! -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Do you think that illiterate people get the full effect of alphabet soup? */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error
On Saturday 21 February 2004 10:02, Tim Trimble wrote: Warning: Failed opening '/var/www/html/phpadmin/index.php' for inclusion (include_path='.:/php/include :/usr/share/php') in Unknown on line 0 Can you direct me to a fix for this... Look at php.ini and check the settings for the auto_prepend_file. If it is set, check that the file exists. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Woman's advice has little value, but he who won't take it is a fool. -- Cervantes */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Slight cleaning of code needed in str_replace command.
On Saturday 21 February 2004 14:39, Dave G wrote: Any advice would be most welcome. Well, you asked for it. The usage of str_replace() is not exactly rocket science, since the output is not what you expected just juggle your search replacement strings until it does what you want. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* At the end of your life there'll be a good rest, and no further activities are scheduled. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] delete a function
Hello! Is there any way to delete (unset) a function? I want to write some function with one constantyl defined name, then call a function_manager function, that will gice this function an unique name, than delete the original function, so I can start the process from the beginning. I will call this function through a wrapper, which will find the function I need. Thanks Dimi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Session question. Please help!
Hi, I've got a session problem that I don't understand. Here's the setup. There are 2 frames, frame1 and frame2 (within frame1). Frame1 is simply a static html page like the following: frameset rows=0,* frameborder=NO border=0 framespacing=0 frame src=http://mysite.ca/blank.html; name=topFrame scrolling=NO noresize frame src=http://mysite.ca/getPage.php?siteid=33page=homepage; name=mainFrame /frameset Frame 2 is the php file, namely getPage.php. In this php file, it starts the session and does some initialization to set the session variables. The php code is executed before any HTML code is outputted. So the session variables have been all set. It looks something like this: frameset rows=0,* frameborder=NO border=0 framespacing=0 frame src=blank.html name=topFrame scrolling=NO noresize frame src=?=$mypage;??mode=view name=mainFrame /frameset so $mypage is actually a dynamic string to another PHP page. The problem is, this $mypage that frame2 opens depends on the session variables that I've set at the beginning of frame2. And I realized that the session id of $mypage is not the same as that of frame2. So the variables will not load. So if i call up frame1 on the browser, $mypage will not get the session variables of frame2. The funny thing is that if i simply load up the url http://mysite.ca/getPage.php?siteid=33page=homepage, i.e. the URL of frame2, $mypage actually DOES get those variables and have the same session id. Although I've solved the problem using a hacked method (passing the session id to $mypage using GET), I'm wondering if there's anything wrong with the setup that causes the diverse outcomes. Thanks for any kind of response. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [PEAR] Re: PEAR DB 1.6.0 has been released
Justin Patrin wrote: I think you're confusing the issue. PEAR DB does support many databases, but it only loads the code for the ones that you are currently using. So if you're using one database it is effectively a one database API. Jakes wrote: What is performance like using this class? I've gone through the class and it just seams to be over kill, for a DB API (13 databases). Are there any time stats showing the different time in using a single DB API class to the PEAR class. Yes things are really not that bad. However expect to give up somewhere a fairly significant amount of performance. If you are using an abstraction layer you have to do it with a good reason (you need to support multiple databases mainly :-) ). Here is a benchmark John Lim came up with: http://phplens.com/lens/adodb/ It only tests MySQL though and it implements a very unrealistic scenario. The reason that ADODB scores so high can be read here: http://marc.theaimsgroup.com/?l=pear-devm=100793507904834w=2 regards, Lukas Smith [EMAIL PROTECTED] ___ BackendMedia www.backendmedia.com [EMAIL PROTECTED] Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Simple example of expiring download pages?
Hi, I'm building a very simple online store and I need expiring download pages for people to download the items they purchased. Surprisingly, I couldn't find an example of this code online. I know how to do it in Lasso, and it's quite easy. You just search the database against download attempts or expiration time/date, and if it succeeds, return this (it's Lasso code but you get the idea): [Output_None] [Var: 'file' = (Include_Raw: 'pathname/sourcefile.zip')] [Var: 'filename' = 'product.pdf'] [Var: 'content_type' = 'application/pdf'] [Header] HTTP/1.0 200 OK Server: Lasso/6.0 Content-Type: [$content_type] Content-Length: [$file-Length] Content-Disposition: attachment; filename=[$filename] [/Header] [/Output_None][$file] Can anyone suggest the PHP code for this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 21 Feb 2004 13:41:53 -0000 Issue 2603
php-general Digest 21 Feb 2004 13:41:53 - Issue 2603 Topics (messages 178419 through 178441): CMS and images, how? 178419 by: Toby Irmer Re: Self Submitting Form 178420 by: Toby Irmer 178432 by: Sam Masiello 178433 by: Tom Rogers 178434 by: Toby Irmer Upload and database 178421 by: Will 178425 by: electroteque HELP PLEASE! 178422 by: 3mip1s4la/Nath/Pisanty 178430 by: Nitin Mehta Error 178423 by: Tim Trimble 178424 by: John Nichel 178427 by: John Nichel 178428 by: Nitin Mehta 178437 by: Jason Wong HTML email problem: IMAP 178426 by: Ryan A 178429 by: Manuel Lemos Slight cleaning of code needed in str_replace command. 178431 by: Dave G 178438 by: Jason Wong Re: [PEAR] Re: PEAR DB 1.6.0 has been released 178435 by: Lukas Smith Re: undelivery mails 178436 by: Jason Wong delete a function 178439 by: Sztankó Demeter PHP Session question. Please help! 178440 by: Bon Simple example of expiring download pages? 178441 by: Brian Dunning Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Hi there, I am presently coding a little CMS. I want to give users the possibility to add images to articles as easily and flexibly as possible. Does anyone have a recommendation on how to do it? So far, you can upload an image which then is checked for its dimensions. If necessary, the user is redirected to a flash tool that enables you to resize the image (imagemagick), a given aspect ratio is kept. A thumb is created and those two files are written to the database. I also write the alignment to the database as chosen during upload. And I have a template system that replaces tags like #img1# in a template with a table to nicely display the images from the db. The only problem is: how do I allow users to insert those images in the text? If I work with a fixed template, the number of images in an article is limited... I have thought about using buttons that you could press while editing the text that would then capture the cursor position in the textarea. But that would only work in IE and is not a very nice solution... Thank you for your suggestions... toby ---End Message--- ---BeginMessage--- Hi Sam, I am not sure I know what you want to do... I tried to recreate your problem: test.html form name=myform1 method=get action= input type=hidden name=myvar1 value=testing script window.open(test2.html, test); /script /form test2.html BODY onLoad=document.forms[0].submit(); form name=myform1 method=get action=test3.html INPUT TYPE=hidden NAME=do_preview VALUE=1 script document.write('INPUT TYPE=hidden NAME=itworks VALUE='+opener.myform1.myvar1.value+''); /script /FORM /BODY test3.html script language=Javascript function parseQueryString (str) { str = str ? str : location.search; var query = str.charAt(0) == '?' ? str.substring(1) : str; var args = new Object(); if (query) { var fields = query.split(''); for (var f = 0; f fields.length; f++) { var field = fields[f].split('='); args[unescape(field[0].replace(/\+/g, ' '))] = unescape(field[1].replace(/\+/g, ' ')); } } return args; } var args = parseQueryString (); for (var arg in args) { document.write(arg + ': ' + args[arg] + 'BR'); } /script And the output is: do_preview: 1 itworks: testing As should be expected... Pls try to specify your problem. toby ---End Message--- ---BeginMessage--- Hi Toby! Thank you for your suggestion, but unfortunately you are using GET in your test2.html file. I specifically stated in my initial email that due to the fact that I am using textareas in my original form (your test1.html) that I did not want to use GET for it might run the risk of overstepping the bounds of how many characters the browser will accept in the GET string. Any other suggestions that anyone else has would be most appreciated as I am still pretty stuck on this. As always, thanks in advance! --Sam From: Toby Irmer [mailto:[EMAIL PROTECTED] Sent: Fri 2/20/2004 6:07 PM To: Sam Masiello Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Self Submitting Form Hi Sam, I am not sure I know what you want to do... I tried to recreate your problem: test.html form name=myform1 method=get action= input type=hidden
[PHP] Help with SQLite and ADOdb
I'm working on a website whose hosting package doesn't include any db (except maybe gdbm). I've install sqlite in the home directory. The question is what adjustment do I have to make to my PHP script and ADOdb in order for it to exicute SQLite in from the account home direcory? TIA, Davd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How can I use a value from a Html's Form
hi,all! if anyone can tell me how can i use a value from Html Form! I know, it is use like as %=Request.Form(item_name)% in a ASP's script. What i can do in a PHP script for a same function? Thanks! Mr.Zhaori
[PHP] Safe Mode
Hi, I'm running PHP4.3 with Apache 1.3.26 on Linux with a number of vittual domains. Safe_mode is set by default for obvious reasons. I wan't to install gallery http://gallery.menalto.com/modules.php?op=modloadname=Newsfile=index It requires to be run without safe_mode. Is it possible to set Apache in such a way that everyting is run under safe-mode, except for a directory and everything underneath in a virtual domain? Thanks Nico -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP class for XSL transformations?
On 20 Feb 2004 at 16:25, Juan Torres wrote: you try with XMLDOM Functions. You look this function: DomXsltStylesheet-process -- Applies the XSLT-Transformation on a DomDocument Object Thanks Juan, but I'm actually looking for a class that I can upload to a site rather than an extension that has to be compiled into PHP. The reason is that some of the hosts on which I need to run my code do not have either the XSLT or the DOM XML extensions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I use a value from a Html's Form
[EMAIL PROTECTED] wrote: hi,all! if anyone can tell me how can i use a value from Html Form! I know, it is use like as %=Request.Form(item_name)% in a ASP's script. What i can do in a PHP script for a same function? Thanks! Mr.Zhaori The manual is your friend... http://www.php.net/manual/en/language.variables.external.php -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
: Re: [PHP] How can I use a value from a Html's Form
The manual is your friend... http://www.php.net/manual/en/language.variables.external.php -- By-Tor.com It's all about the Rush http://www.by-tor.com = It is work now. Thank you very much! Mr.Zhaori
RE: [PHP] Slight cleaning of code needed in str_replace command.
Well, you asked for it. The usage of str_replace() is not exactly rocket science, since the output is not what you expected just juggle your search replacement strings until it does what you want. It's not as if I haven't experimented with different settings, but they haven't been successful. In any case, rocket science or not, I was actually looking for advice that might help me understand the logic behind the command better. I can't see anything syntactically wrong with the string I have put forward, so my current assumption is that there is something I don't understand about how the string input going into the command is parsed (it comes from a MySQL query), or about how the command interprets line breaks. Perhaps someone could offer something a little more concrete than essentially recommending I just 'try different stuff'. -- Yoroshiku! Dave G [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Slight cleaning of code needed in str_replace command.
On Sunday 22 February 2004 00:23, Dave G wrote: It's not as if I haven't experimented with different settings, but they haven't been successful. By settings one usually means something which alters behaviour, as such str_replace() does not have any settings. In any case, rocket science or not, I was actually looking for advice that might help me understand the logic behind the command better. It simply does a straight replacement: replace A with B in string C I can't see anything syntactically wrong with the string I have put forward, so my current assumption is that there is something I don't understand about how the string input going into the command is parsed (it comes from a MySQL query), or about how the command interprets line breaks. var_dump() every variable of importance and check that they are what you expect them to be. You might want to wrap the output in some pre tags so the browser doesn't eat up your \n's. Perhaps someone could offer something a little more concrete than essentially recommending I just 'try different stuff'. Anything more concrete would probably mean writing the code for you, that would be too easy (for you!). Here's another tip: start with a small test string (forget about grabbing stuff from the db), do a simple replacement, check your results, make the string more complex, repeat. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* It takes all sorts of in out-door schooling to get adapted to my kind of fooling - R. Frost */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple example of expiring download pages?
On Saturday 21 February 2004 21:41, Brian Dunning wrote: Hi, I'm building a very simple online store and I need expiring download pages for people to download the items they purchased. Surprisingly, I couldn't find an example of this code online. I know how to do it in Lasso, and it's quite easy. You just search the database against download attempts or expiration time/date, and if it succeeds, return this (it's Lasso code but you get the idea): [snip] Can anyone suggest the PHP code for this? Loads of examples in the archives, search for download file or similar. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Those who can, do; those who can't, simulate. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Safe Mode
On Saturday, Feb 21, 2004, at 09:18 America/New_York, [EMAIL PROTECTED] wrote: Is it possible to set Apache in such a way that everyting is run under safe-mode, except for a directory and everything underneath in a virtual domain? Very likely yes, if your admin permits it. The place to look for an answer is in documentation for httpd.conf. Good luck. - Lucas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] tow dimenshional arrays
Hallo, 1) I want to work with the rows und columns of a tow dimensional array[i][j]. With array[i] I get the i'th row. But how can I get the j'th column? 2) Is there any command to transpose a two dimensional array? Thanks for help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HTML email problem: IMAP
Hey, Thanks, even that htmlmail example was a bit too much for my needs but in 10 mins I cut it down to the simple stuff I wanted to do (just send a html message with a text part...). I really didnt need the attachment part/s and cut that out. There are still 2 parts I really dont understand even though I know how to use them :-)...but that class is really good and it shows how much interest and time you put into it, only thing I think is missing is a kind of readme file which contains documentation explaining each of the functions and the parameters they take. But no complaints from me...coz its working great! Cheers, -Ryan Hello, On 02/21/2004 01:39 AM, Ryan A wrote: I downloaded a class from php classes called clssendmail, the class was working on a different server but now I get this error when I try to use it: Call to undefined function: imap_8bit() in. The class is basically to send an email in 2 parts, plain text and HTML...if the person has html off or cannot view html email then the plain text one will display else the HTML part will display. After googleing I see that sometimes PHP is not compiled with Imap_8bit which causes this problem...:-( Yes, IMAP extension is optional but fortunately it is not necessary for what you want. Just try this other class that comes with an example to do exactly what you want. Check the HTML message example as it explains how to compose and send a message with an HTML part and an alternative text part. It may also embed any images or attachment files if you want: http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] delete a function
On Sat, 2004-02-21 at 06:02, Sztankó Demeter wrote: Hello! Is there any way to delete (unset) a function? No, why would you really want to delete a function? I want to write some function with one constantyl defined name, then call a function_manager function, that will gice this function an unique name, than delete the original function, so I can start the process from the beginning. I will call this function through a wrapper, which will find the function I need. I'm not completely sure what your intended use of the process you described is, but it sounds to me like you are trying to implement the factory pattern[1]. I would recommend looking into using classes in PHP and giving it a shot. http://www.phppatterns.com/index.php/article/articleview/49/1/1/ -- Adam Bregenzer [EMAIL PROTECTED] http://adam.bregenzer.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: tow dimenshional arrays
As far as I know, there is no such a function. Maybe you should use a different approach. Manu. Joe-At [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hallo, 1) I want to work with the rows und columns of a tow dimensional array[i][j]. With array[i] I get the i'th row. But how can I get the j'th column? 2) Is there any command to transpose a two dimensional array? Thanks for help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HELP!!!
Hello All, I am trying to do a modify script. The problem is I can get only one thig to work, it is either the tables modified or the photos uploaded not both here is my code: HTML FORM: pbImage File Name:/bbr input type=text name=female_image value=?echo $female_image;? size=30 maxlenght=200/p pbImage Thumbnail File Name:/bbr input type=text name=female_image_thumb value=?echo $female_image_thumb;? size=30 maxlenght=200/p pbImage File:/bbr input type=file name=application size=20 maxlenght=200/p pstrongImage Thumbnail File Name:/strongbr input type=file name=application1 size=20 maxlenght=200/p pinput type=submit name=submit value=Modify This Female Reptile/p NOTE: This is only the last part of the form. AND THE PHP SCRIPT: ? $sql = UPDATE $table_name9 SET female_latin = '$_POST[female_latin]', female_born_date = '$_POST[female_born_date]', female_date = '$_POST[female_date]', female_where_purchased = '$_POST[female_where_purchased]', female_cost = '$_POST[female_cost]', female_size = '$_POST[female_size]', female_weight = '$_POST[female_weight]', female_humidity_level = '$_POST[female_humidity_level]', female_notes = '$_POST[female_notes]', female_image = '$_POST[female_image]', female_image_thumb = '$_POST[female_image_thumb]' WHERE female_id = '$_POST[female_id]'; $result = @mysql_query($sql,$conn) or die(mysql_error()); if ($_FILES[application] != ) { header (Location: main.php); exit; } else { @copy($_FILES[application][tmp_name], $path .$_FILES[application][name]) or die( Sorry Could not copy file!! ); @copy($_FILES[application1][tmp_name], $path1 .$_FILES[application1][name]) or die( Could not copy file!! ); header(Location: main.php); exit; } ? NOTE This is the whole script minus the setup file. Thanks in advance, ~WILL~ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Error
May be the cause is, that you've specified some include file with include('somefile'); but the file doesn't exist in /usr/share/php dir, which is the default path for include (.inc) files to be saved. OK, I see your point. The problem is I don't know what file/ directory it's looking for, so I don't know where to look for it. Like I said this a generic install, I didn't make any changes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] set global working??
Not quite a mystery, but I wondered if anyone could throw a couple of suggestions my way. My client's websites were moved last year from an old php server to a newer one. At that time, I had to upgrade all her scripts because set_globals were off on the new server, and so I went to using $_SESSION variables. All seemed to be doing fine until sometime last week when the scripts on a new website I am working on, being hosted on her server, started flaking out. Variables were becoming persistent, retaining previous values and refusing to change. I checked the php settings and found that the version running on the sever is 4.1.2 with globals on. That surprised me. I don't have admin access and would be cautious about trying to change this and possibly messing up someone else's site. Anyway, to test my theory, I created a simple script that turns session_start on and off. If session_start is off, variables work fine. With session_start on, variable will change once, and then refuse to change. I've attached the script. Does this indeed mean that I have to go through all my scripts and comment out session_start and convert my $_SESSION defines back?? Yeachh!! Terry ? if($pers) session_start(); // check for persistance if(!$ag) $ag=8; // set as default switch($ag){ case 8: $office=Modesto; break; case 7: $office=Livermore;break; case 9: $office=Fremont; break; case 10: $office=San Lorenzo; break; case 28: $office=Berkeley; break; case 25: $office=Mountain View; break; } if($switch) $pers=(!$pers); // switch persistence on/off ? div align=centerfont size=5 color=#00015d face=Verdanab?=$office?/b/font/div/td br / a href=check.php?ag=?=$ag?pers=?=$pers?switch=1Switch Persistence ?=$pers?/a br / a href=check.php?ag=7pers=?=$pers?Livermore/a a href=check.php?ag=8pers=?=$pers?Modesto/a a href=check.php?ag=9pers=?=$pers?Fremont/a a href=check.php?ag=10pers=?=$pers?San Lorenzo/a a href=check.php?ag=28pers=?=$pers?Berkeley/a br / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] set global working??
you can turn register globals off using htaccess, i dont have an example for you but that should fix it. -Original Message- From: Terry Romine [mailto:[EMAIL PROTECTED] Sent: Sunday, February 22, 2004 10:37 AM To: [EMAIL PROTECTED] Subject: [PHP] set global working?? Not quite a mystery, but I wondered if anyone could throw a couple of suggestions my way. My client's websites were moved last year from an old php server to a newer one. At that time, I had to upgrade all her scripts because set_globals were off on the new server, and so I went to using $_SESSION variables. All seemed to be doing fine until sometime last week when the scripts on a new website I am working on, being hosted on her server, started flaking out. Variables were becoming persistent, retaining previous values and refusing to change. I checked the php settings and found that the version running on the sever is 4.1.2 with globals on. That surprised me. I don't have admin access and would be cautious about trying to change this and possibly messing up someone else's site. Anyway, to test my theory, I created a simple script that turns session_start on and off. If session_start is off, variables work fine. With session_start on, variable will change once, and then refuse to change. I've attached the script. Does this indeed mean that I have to go through all my scripts and comment out session_start and convert my $_SESSION defines back?? Yeachh!! Terry ? if($pers) session_start(); // check for persistance if(!$ag) $ag=8; // set as default switch($ag){ case 8: $office=Modesto; break; case 7: $office=Livermore;break; case 9: $office=Fremont; break; case 10: $office=San Lorenzo; break; case 28: $office=Berkeley; break; case 25: $office=Mountain View; break; } if($switch) $pers=(!$pers); // switch persistence on/off ? div align=centerfont size=5 color=#00015d face=Verdanab?=$office?/b/font/div/td br / a href=check.php?ag=?=$ag?pers=?=$pers?switch=1Switch Persistence ?=$pers?/a br / a href=check.php?ag=7pers=?=$pers?Livermore/a a href=check.php?ag=8pers=?=$pers?Modesto/a a href=check.php?ag=9pers=?=$pers?Fremont/a a href=check.php?ag=10pers=?=$pers?San Lorenzo/a a href=check.php?ag=28pers=?=$pers?Berkeley/a 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
[PHP] using xp home
is it better to use apache 1.3.29 or apache 2.0.48? i am having the worst trouble ever trying to get this thing to work -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: tow dimenshional arrays
Hello Manuel, Sunday, February 22, 2004, 5:47:02 AM, you wrote: MVA As far as I know, there is no such a function. Maybe you should use a MVA different approach. MVA Manu. MVA Joe-At [EMAIL PROTECTED] wrote in message MVA news:[EMAIL PROTECTED] Hallo, 1) I want to work with the rows und columns of a tow dimensional array[i][j]. With array[i] I get the i'th row. But how can I get the j'th column? 2) Is there any command to transpose a two dimensional array? Thanks for help 1. $array_j = $array[$i] ; count($array_j) ; 2. foreach($array as $sub_array){ foreach($subarray as $key=$value) echo $key.'=='.$value ; } cmiiw -- Best regards, adwinwijayamailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Safe Mode
Lucas Gonze wrote: On Saturday, Feb 21, 2004, at 09:18 America/New_York, [EMAIL PROTECTED] wrote: Is it possible to set Apache in such a way that everyting is run under safe-mode, except for a directory and everything underneath in a virtual domain? Very likely yes, if your admin permits it. The place to look for an answer is in documentation for httpd.conf. Good luck. - Lucas Can safe mode be turned off in the .htaccess file? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Safe Mode
On Saturday, Feb 21, 2004, at 20:17 America/New_York, [EMAIL PROTECTED] wrote: Lucas Gonze wrote: On Saturday, Feb 21, 2004, at 09:18 America/New_York, [EMAIL PROTECTED] wrote: Is it possible to set Apache in such a way that everyting is run under safe-mode, except for a directory and everything underneath in a virtual domain? Very likely yes, if your admin permits it. The place to look for an answer is in documentation for httpd.conf. Good luck. - Lucas Can safe mode be turned off in the .htaccess file? My guess is no. That is a decision which should belong to the server admin. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: tow dimenshional arrays
Namaste Adwinwijaya: I meant there's no PHP function neither to get a column nor to transpose the matrix. The first answer you gave us, retrieves the amount of items in the column, not the column itself as an array. And the second one, just prints the matrix, but does not transpose it. Joe-At: I suggest you to tell us your exact problem, maybe there's a way to solve it avoiding matrices, maybe there's a more suitable representation to the problem's parameters. Manu. PS: This function retrives the j column, assuming that the matrix has no non-numerical indeces: function getColumn($arr, $j) { if (isset($arr[$j]) count($arr[$j])0) { $result = array(); foreach($arr[$j] as $which) $result[] = $which;// You could make reference instead } } function getTranspose($arr) { if (count($arr)0) { $result = array(); for($i=0; $icount($arr); $i++) for($j=0; $jcount($arr[$i]); $j++) { if (!isset($result[$j])) $result[$j] = array(); $result[$j][$i] = $arr[$i][$j]; } } } Keep in mind this are inefficient functions. Manu. Adwinwijaya [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello Manuel, Sunday, February 22, 2004, 5:47:02 AM, you wrote: MVA As far as I know, there is no such a function. Maybe you should use a MVA different approach. MVA Manu. MVA Joe-At [EMAIL PROTECTED] wrote in message MVA news:[EMAIL PROTECTED] Hallo, 1) I want to work with the rows und columns of a tow dimensional array[i][j]. With array[i] I get the i'th row. But how can I get the j'th column? 2) Is there any command to transpose a two dimensional array? Thanks for help 1. $array_j = $array[$i] ; count($array_j) ; 2. foreach($array as $sub_array){ foreach($subarray as $key=$value) echo $key.'=='.$value ; } cmiiw -- Best regards, adwinwijayamailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] using xp home
Cant say for XP home, but on XP Pro, I've run both without any problems. Just follow the instructions at the php manual... On Saturday 21 February 2004 07:11 pm, danny cobbinah wrote: is it better to use apache 1.3.29 or apache 2.0.48? i am having the worst trouble ever trying to get this thing to work -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Safe Mode
Lucas Gonze wrote: On Saturday, Feb 21, 2004, at 20:17 America/New_York, [EMAIL PROTECTED] wrote: Lucas Gonze wrote: On Saturday, Feb 21, 2004, at 09:18 America/New_York, [EMAIL PROTECTED] wrote: Is it possible to set Apache in such a way that everyting is run under safe-mode, except for a directory and everything underneath in a virtual domain? Very likely yes, if your admin permits it. The place to look for an answer is in documentation for httpd.conf. Good luck. - Lucas Can safe mode be turned off in the .htaccess file? My guess is no. That is a decision which should belong to the server admin. Definately no. It would not be safe mode if anyone can turn it off. I don't know the gallery script but setting safe_mode_include_dir should help. Ask the admin to set it to your directory for your virtual host. Another option would be to use ftp functions to upload the images to your directory, but you would have to rewrite the script. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How can I use a value from a Html's Form
You can use the $myvalue = $_REQUEST['htmlvariable']; to grab the variable you want. -johnr [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hi,all! if anyone can tell me how can i use a value from Html Form! I know, it is use like as %=Request.Form(item_name)% in a ASP's script. What i can do in a PHP script for a same function? Thanks! Mr.Zhaori -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 22 Feb 2004 02:47:25 -0000 Issue 2604
php-general Digest 22 Feb 2004 02:47:25 - Issue 2604 Topics (messages 178442 through 178467): Help with SQLite and ADOdb 178442 by: user.domain.invalid How can I use a value from a Html's Form 178443 by: qm.fuwanjia.com.cn 178446 by: John Nichel 178447 by: qm.fuwanjia.com.cn 178467 by: John Romero Safe Mode 178444 by: php4.nv.jakaranda.co.za 178451 by: Lucas Gonze 178462 by: user.domain.invalid 178463 by: Lucas Gonze 178466 by: Marek Kilimajer Re: PHP class for XSL transformations? 178445 by: memoimyself.yahoo.com.br Re: Slight cleaning of code needed in str_replace command. 178448 by: Dave G 178449 by: Jason Wong Re: Simple example of expiring download pages? 178450 by: Jason Wong tow dimenshional arrays 178452 by: joe-at 178455 by: Manuel Vázquez Acosta 178461 by: adwinwijaya 178464 by: Manuel Vázquez Acosta Re: HTML email problem: IMAP 178453 by: Ryan A Re: delete a function 178454 by: Adam Bregenzer HELP!!! 178456 by: Will PHP Error 178457 by: Tim Trimble set global working?? 178458 by: Terry Romine 178459 by: electroteque using xp home 178460 by: danny cobbinah 178465 by: Gerard Samuel Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- I'm working on a website whose hosting package doesn't include any db (except maybe gdbm). I've install sqlite in the home directory. The question is what adjustment do I have to make to my PHP script and ADOdb in order for it to exicute SQLite in from the account home direcory? TIA, Davd ---End Message--- ---BeginMessage--- hi,all! if anyone can tell me how can i use a value from Html Form! I know, it is use like as %=Request.Form(item_name)% in a ASP's script. What i can do in a PHP script for a same function? Thanks! Mr.Zhaori---End Message--- ---BeginMessage--- [EMAIL PROTECTED] wrote: hi,all! if anyone can tell me how can i use a value from Html Form! I know, it is use like as %=Request.Form(item_name)% in a ASP's script. What i can do in a PHP script for a same function? Thanks! Mr.Zhaori The manual is your friend... http://www.php.net/manual/en/language.variables.external.php -- By-Tor.com It's all about the Rush http://www.by-tor.com ---End Message--- ---BeginMessage--- The manual is your friend... http://www.php.net/manual/en/language.variables.external.php -- By-Tor.com It's all about the Rush http://www.by-tor.com = It is work now. Thank you very much! Mr.Zhaori ---End Message--- ---BeginMessage--- You can use the $myvalue = $_REQUEST['htmlvariable']; to grab the variable you want. -johnr [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hi,all! if anyone can tell me how can i use a value from Html Form! I know, it is use like as %=Request.Form(item_name)% in a ASP's script. What i can do in a PHP script for a same function? Thanks! Mr.Zhaori ---End Message--- ---BeginMessage--- Hi, I'm running PHP4.3 with Apache 1.3.26 on Linux with a number of vittual domains. Safe_mode is set by default for obvious reasons. I wan't to install gallery http://gallery.menalto.com/modules.php?op=modloadname=Newsfile=index It requires to be run without safe_mode. Is it possible to set Apache in such a way that everyting is run under safe-mode, except for a directory and everything underneath in a virtual domain? Thanks Nico ---End Message--- ---BeginMessage--- On Saturday, Feb 21, 2004, at 09:18 America/New_York, [EMAIL PROTECTED] wrote: Is it possible to set Apache in such a way that everyting is run under safe-mode, except for a directory and everything underneath in a virtual domain? Very likely yes, if your admin permits it. The place to look for an answer is in documentation for httpd.conf. Good luck. - Lucas ---End Message--- ---BeginMessage--- Lucas Gonze wrote: On Saturday, Feb 21, 2004, at 09:18 America/New_York, [EMAIL PROTECTED] wrote: Is it possible to set Apache in such a way that everyting is run under safe-mode, except for a directory and everything underneath in a virtual domain? Very likely yes, if your admin permits it. The place to look for an answer is in documentation for httpd.conf. Good luck. - Lucas Can safe mode be turned off in the .htaccess file? ---End Message--- ---BeginMessage--- On Saturday, Feb 21, 2004, at 20:17 America/New_York, [EMAIL PROTECTED] wrote: Lucas Gonze wrote: On Saturday, Feb 21, 2004, at 09:18 America/New_York, [EMAIL PROTECTED] wrote: Is it possible to set Apache in such a way that everyting is run under safe-mode, except for a directory and everything underneath in a virtual domain?
[PHP] Objects and Arrays - need help?
Here is my code. Two files: 1) myclass.php 2)test.php to instantiate the objects. I have two classes. One is a parts class with some basic properties in an array. And the other class is the repair class which needs to hold MANY parts. In the repair class, I have a $partsarray so that I can just add them to the array and then process them later. The problem is that when I need to get the parts out of the repair class - they are not there. I made a method called getPartsCount and it always returns 0. Can someone take a look at this code and help me? Thanks in advance. ?php //THIS IS MYCLASS.PHP //make a record class class part { //properties var $_data = array(); //methods function getData($attributeName) { return $this-_data[$attributeName]; } function setData($attributeName, $value) { $this-_data[$attributeName] = $value; } } //make a REPAIR class class repair { //properties var $_data = array(); var $_partsarray = array(); //methods function getData($attributeName) { return $this-_data[$attributeName]; } function setData($attributeName, $value) { $this-_data[$attributeName] = $value; } function getPart($pos) { return $this-_partsarray[$pos]; } function addPart($partsclass, $pos) { //pos will actually be a string value $this-_partsarray['$pos'] = $partsclass; } function deletePart($pos) { unset($this-_partsarray['$pos']); } function countParts() { return count($_partsarray); } function getParts() { return $_partsarray; } } ? ?php // THIS IS THE CODE TO TEST THE CLASSES - TEST.PHP require_once('myclass.php'); //make the parts $partsclass = new part; $partsclass-setData('1', 'val1'); $partsclass-setData('2', 'val2'); $partsclass-setData('3', 'val3'); $partsclass2 = new part; $partsclass2-setData('1', 'val1'); $partsclass2-setData('2', 'val2'); $partsclass2-setData('3', 'val3'); $repairclass = new repair; $repairclass-setData('test1', 'value1'); $repairclass-addPart($partsclass1, '1'); $repairclass-addPart($partsclass2, '2'); echo 'the test value is' . $repairclass-getData('test1'); echo 'brand the part counter is: ' . $repairclass-countParts(); $partsclasstemp = new part; $partsclasstemp = $repairclass-getPart('1'); echo 'bPparts data is: ' . $partsclasstemp-getData('2'); echo 'br'; $temparray = array(); $temparray = $repairclass-getParts(); echo count($temparray); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Error
Can anyone tell me what linux and php is asking for here, this dir. and file is at this location, and chmoded to 755. Failed opening required './libraries/grab_globals.lib.php' (include_path='.:/php/includes:/usr/share/php') I guess what I'm asking is, it says the path is .:/php/includes I can't find that on the machine anywere and /usr/share/php that I did find, and I put the libraries dir. at that location, it still says it's not there What am I doing wrong Thanks...Tim
[PHP] running php through cron
Hi folks. I've got a quick question about security when running a php script through a cron job. I've got a cron job set up that executes every minute and looks for idle users and pending content within a cms. I know that if I wanted to execute the script with an exec() call from within another php script I would need to chmod +x it. I don't seem to need to do this with a cron job, as I use the following command in the cron job, php /home/pablo/cmsutil/CMS_monitor.php and the permissions on CMS_monitor.php are as follows: -rw-rw-r--1 pablopablo3636 Feb 21 00:48 CMS_monitor.php My question is under these permissions could someone else with an account on this server execute this file? I'm pretty sure they couldn't but my knowledge of Linux isn't yet as extensive as I would like it to be so I can't say for sure. Can someone verify or correct me on this? Cheers and TIA. Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Error
Tim Trimble wrote: Can anyone tell me what linux and php is asking for here, this dir. and file is at this location, and chmoded to 755. Failed opening required './libraries/grab_globals.lib.php' (include_path='.:/php/includes:/usr/share/php') I guess what I'm asking is, it says the path is .:/php/includes I can't find that on the machine anywere and /usr/share/php that I did find, and I put the libraries dir. at that location, it still says it's not there What am I doing wrong Thanks...Tim With the dot slash (./), it's looking for the file in a directory under the same directory that the script is running in - somefile.php - libraries | - grab_globals.lib.php -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] running php through cron
On Sunday 22 February 2004 11:12, Pablo Gosse wrote: I know that if I wanted to execute the script with an exec() call from within another php script I would need to chmod +x it. I don't seem to need to do this with a cron job, as I use the following command in the cron job, php /home/pablo/cmsutil/CMS_monitor.php That's because you're executing the php binary (php) and telling it to run the script (CMS_monitor.php). and the permissions on CMS_monitor.php are as follows: -rw-rw-r--1 pablopablo3636 Feb 21 00:48 CMS_monitor.php My question is under these permissions could someone else with an account on this server execute this file? It depends. If they can read the file 'CMS_monitor.php' and they can execute the php binary then yes. But because users are not usually allowed to access other users' home directory they will not be able to run your scripts. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Why are there flotation devices under plane seats instead of parachutes? -- Why Why Why n22 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] running php through cron
On Sat, 2004-02-21 at 22:12, Pablo Gosse wrote: php /home/pablo/cmsutil/CMS_monitor.php and the permissions on CMS_monitor.php are as follows: -rw-rw-r--1 pablopablo3636 Feb 21 00:48 CMS_monitor.php My question is under these permissions could someone else with an account on this server execute this file? I'm pretty sure they couldn't but my knowledge of Linux isn't yet as extensive as I would like it to be so I can't say for sure. If the script can be read (the r permission) it can be run through the php cli like you are doing in cron. If the cron command you have is running under your username, and the script does not need to be viewable by the web server, you can set the permissions to 600, which would be -rw---. This will allow you as the user to read (as well as execute through php) and write to the file and not let anyone else (besides root of course) to do anything with it. Technically, if an executable can be read it can be executed. If it's a binary it can be copied by a user and the copy can be run, if it's a script it can be passed to an interpreter and run. Good Luck, Adam -- Adam Bregenzer [EMAIL PROTECTED] http://adam.bregenzer.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] running php through cron
snip php /home/pablo/cmsutil/CMS_monitor.php and the permissions on CMS_monitor.php are as follows: -rw-rw-r--1 pablopablo3636 Feb 21 00:48 CMS_monitor.php My question is under these permissions could someone else with an account on this server execute this file? I'm pretty sure they couldn't but my knowledge of Linux isn't yet as extensive as I would like it to be so I can't say for sure. If the script can be read (the r permission) it can be run through the php cli like you are doing in cron. If the cron command you have is running under your username, and the script does not need to be viewable by the web server, you can set the permissions to 600, which would be -rw---. This will allow you as the user to read (as well as execute through php) and write to the file and not let anyone else (besides root of course) to do anything with it. Technically, if an executable can be read it can be executed. If it's a binary it can be copied by a user and the copy can be run, if it's a script it can be passed to an interpreter and run. /snip Thanks for the replies. Very helpful. The crontab running is my own so if I change the permission on the file as Adam mentions above I'll be fine (please let me know if this is not the case!). Thanks again. Pablo. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sql expression
Hi all, I am trying to provide a star sign search so that the user can search for any given star sign eg Gemini and retrieve all the users who belong to that sign. I have a table with all the star signs, in the table are the fields 'Name','From','To'. Both the 'From' and 'To' are an integer of the relevant dates eg in the 'Gemini' row I have: Gemini, 521, 621 (521 means May 21st, 621 means June 21st). I hope I'm explaining my self ok. Now in the users table I have date of birth stored in the Date format eg; 1979-06-20. Here is my current stab at this. SELECT * FROM users WHERE MONTH(user_data.User_DOB) = 5 AND DAYOFMONTH(user_data.User_DOB) = 21 AND MONTH(user_data.User_DOB) = 6 AND DAYOFMONTH(user_data.User_DOB) = 21 Obviously this wont work because anyone born, lets say on the 20th will not fit that criteria. I've tried other methods but I cant seem to figure out the correct syntax. I thought using CONCAT may work eg: SELECT * FROM users WHERE CONCAT(MONTH(user_data.User_DOB),DAYOFMONTH(user_data.User_DOB)) BETWEEN 521 AND 621 but that doesn't seem to work either. Can someone help please? Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Email - format
Hello: Can any body provide me with a regular expression (as per the latest standards) to check the validity of an email address. I am using some of the below formats. But these formats are not handling all the email addresses. Format I: ereg(^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$, $email) Will not accept hyphen (-) in the email addresses. Format II: eregi(^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$,$email) Will not accept domains like y.net.ye Please suggest a regular expression which will reject only email addresses which are 100% invalid. Sheni R Meledath [EMAIL PROTECTED]
[PHP] Re: sql expression
Ok I spoke too soon, I did this: SELECT * FROM users WHERE ((MONTH(user_data.User_DOB) * 100) + DAYOFMONTH(user_data.User_DOB)) BETWEEN 521 AND 621 as in I multiplied MONTH with 100 and added the DAYOFMONTH Marc. Marc Greenstock [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, I am trying to provide a star sign search so that the user can search for any given star sign eg Gemini and retrieve all the users who belong to that sign. I have a table with all the star signs, in the table are the fields 'Name','From','To'. Both the 'From' and 'To' are an integer of the relevant dates eg in the 'Gemini' row I have: Gemini, 521, 621 (521 means May 21st, 621 means June 21st). I hope I'm explaining my self ok. Now in the users table I have date of birth stored in the Date format eg; 1979-06-20. Here is my current stab at this. SELECT * FROM users WHERE MONTH(user_data.User_DOB) = 5 AND DAYOFMONTH(user_data.User_DOB) = 21 AND MONTH(user_data.User_DOB) = 6 AND DAYOFMONTH(user_data.User_DOB) = 21 Obviously this wont work because anyone born, lets say on the 20th will not fit that criteria. I've tried other methods but I cant seem to figure out the correct syntax. I thought using CONCAT may work eg: SELECT * FROM users WHERE CONCAT(MONTH(user_data.User_DOB),DAYOFMONTH(user_data.User_DOB)) BETWEEN 521 AND 621 but that doesn't seem to work either. Can someone help please? Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sql expression
Marc Greenstock wrote: I have a table with all the star signs, in the table are the fields 'Name','From','To'. Both the 'From' and 'To' are an integer of the relevant dates eg in the 'Gemini' row I have: Gemini, 521, 621 (521 means May 21st, 621 means June 21st). I hope I'm explaining my self ok. You should use a regular date column for your from and to dates. Now in the users table I have date of birth stored in the Date format eg; 1979-06-20. Here is my current stab at this. SELECT * FROM users WHERE MONTH(user_data.User_DOB) = 5 AND DAYOFMONTH(user_data.User_DOB) = 21 AND MONTH(user_data.User_DOB) = 6 AND DAYOFMONTH(user_data.User_DOB) = 21 and then you can do something like this: WHERE DAYOFYEAR(user_data.User_DOB) BETWEEN DAYOFYEAR(startable.from) AND DAYOFYEAR(startable.to) -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The 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] Email - format
Sheni R. Meledath wrote: Can any body provide me with a regular expression (as per the latest standards) to check the validity of an email address. This is covered over and over and over, 100s of times (literally) in the manual. Look through the comments in either of the regular expression chapters. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Email - format
Hello, On 02/22/2004 02:47 AM, Sheni R. Meledath wrote: Please suggest a regular expression which will reject only email addresses which are 100% invalid. You may want to take a look at this class that not only does regular expression e-mail address validation rejecting only addresses that have 100% certainly invalid characters, but also can check if the domain exists and if the respective SMTP server would accept messages to that address: http://www.phpclasses.org/emailvalidation -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php