[PHP] Re: unset() something that doesn't exist

2009-08-24 Thread Shawn McKenzie
.. >> is it the case that unset() does not trigger an error or throw an > exception >> if it's argument was never set? >> >> > > What!?!? No, It does not cause an error, not even a notice. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] preg_replace anything that isn't WORD

2009-08-24 Thread Shawn McKenzie
om http://ancientstones.com http://earthstones.com >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > Certain posts of mine seem to get sucked into a black hole and I never see theme. Maybe because I use this list as a newsgroup? Anyway, what I posted before: Match everything but only replace the backreference for the words: $s = "cats i saw a cat and a dog"; $r = preg_replace('#.*?(cat|dog).*?#', '\1', $s); -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: How to output a NULL field?

2009-08-25 Thread Shawn McKenzie
ds() method actually returns. You should do a var_dump($rs->Fields(22)) to see. If it returns a string (especially "NULL"), then this or some variation should work: $q4 = $rs->Fields(22); if($q4 == "NULL"){ $q4 = ""; } If it returns an empty string or false then you may have nothing to do. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: How to output a NULL field?

2009-08-25 Thread Shawn McKenzie
Shawn McKenzie wrote: > First off, if the value is NULL in the database then in PHP it will be > the string "NULL" and not a null value as far as I remember. Second, > you cant use a function/method in empty(). Thirdly, the string "NULL" > is not empty. I'

[PHP] Re: php 5.2.x - Fatal error: Cannot re-assign $this in ...

2009-08-25 Thread Shawn McKenzie
extget'); > if(isset($_SESSION['postvars'])) { > //load the POST variables from the session > > // Error on this line below! > $this = unserialize($_SESSION['postvars']); > session_unregister('postvars'); //delete the session

[PHP] Re: php 5.2.x - Fatal error: Cannot re-assign $this in ...

2009-08-25 Thread Shawn McKenzie
Shawn McKenzie wrote: > John Stoffel wrote: >> Hi, >> >> I'm looking for some help with PHP5.2.x hacking on a web site to >> cleanup how the user submitted search form is handled. Basically I >> want to make it simple for the end user to a) refine their que

[PHP] Re: PHP5+APACHE 2.2 + Windows 2003 production server

2009-08-26 Thread Shawn McKenzie
s because most libraries on that platform tend to be threadsafe. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Sockets (reading)

2009-08-26 Thread Shawn McKenzie
der to fit the MTU of a different network, then the IP stack on the receiving end will reassemble the fragments based upon information that the router injects into the fragments. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] phpmailer send() always return true even the emailaddress is invalid

2009-08-27 Thread Shawn McKenzie
ilure messages. If that's not bad enough, consider if the from address is a legitimate domain but nonexistent user, then the server that receives the failure messages sent to the nonexistent user may issue its own failure messages back to the other nonexistent users, and maybe back and forth

[PHP] Re: user permissions

2009-08-27 Thread Shawn McKenzie
ble with a row for each user/permission combination > > > > Thanks! > > > > John > I'm not sure about "best", but I kind of like the way CakePHP does it: http://book.cakephp.org/view/465/Understanding-How-ACL-Works -- Thanks! -Shawn http://w

[PHP] Re: page works on public web site, but not on my computer

2009-08-27 Thread Shawn McKenzie
mike bode wrote: > I have posted the question in another thread a bit down, but only buried > within the thread, so please excuse me when I ask again. > > I want to use some PHP code from a web site > (http://www.dynamicdrive.com/dynamicindex4/php-photoalbum.htm), and I am > following their instru

[PHP] Re: Best way to test for form submission?

2009-08-28 Thread Shawn McKenzie
oping someone here will point me in the right direction. Just to throw it into the mix: if(!empty($_POST)) for a general test of whether any form was posted. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Install PHPMyAdmin with urpmi

2009-08-31 Thread Shawn McKenzie
it related to > "session" and what I should define in '/etc/php.ini'? > > Please tell me my mistake. > > Thank you very much in advance. Have you installed and enabled the php-mysql extension? -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: LoginShare | How to authenticate once, and login to different websites

2009-09-01 Thread Shawn McKenzie
ore the password in the session. If it's not too verbose you can post the login code for each. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Date +30 comparison

2009-09-01 Thread Shawn McKenzie
y help appreciated. Look at the date/time functions, they are very feature rich: $today = time(); $nexteval = strtotime('+30 days', $today); if ($today > $nexteval) { echo 'Message'; } -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Install PHPMyAdmin with urpmi

2009-09-01 Thread Shawn McKenzie
connect('localhost:3306', 'mysql_user', 'mysql_password')){ >> echo "Ok"; >> }else{ >> echo "Failed"; >> } >> ?> > In php.ini there must be a extension=mysql.so line. If there is, make sure that it isn

[PHP] Re: PHP-->on MyMarket can not get username variable value from session.

2009-09-01 Thread Shawn McKenzie
;]["username"]; > $password = md5($password); > $qid = db_query("SELECT 1 FROM users WHERE username = '$username' AND > password = '$password'"); > /* Here my investigator */ > echo db_num_rows($qid)."-->"."S

[PHP] Re: accessing variable from inside a class

2009-09-04 Thread Shawn McKenzie
ss it as a global by either declaring it global in the method (global $template_dir;) or by the superglobal $GLOBALS['template_dir']. However this is probably not the preferred way to do it. I would either define it as a constant define('TEMPLATE_DIR', 'templates/')

[PHP] Re: Class variable value lost

2009-09-09 Thread Shawn McKenzie
orward the user to members page. When I check the the value on > other page it is set to the default value of the class. Please help. > > > Regard, >Sumit > You needs to pass the object to the next page. Look into sessions. -- Thanks! -Shawn http://www.spidean.com -- PHP Gene

[PHP] Re: preg_match()

2009-09-09 Thread Shawn McKenzie
do this multiple times in a large string you would need: preg_match_all('@a([0-9]+)b@' ,"a2345678b" , $matches); foreach($matches[1] as $match) { print_r(str_split($match)); } -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: Fwd: [PHP] Re: Class variable value lost

2009-09-09 Thread Shawn McKenzie
SESSION variables. > This is roughly how it works: If you want to keep the first $user object and persist it across pages, then you can many different things, but you need to put it in the session. One example (you could also write a session class to take care of all of your session stu

[PHP] Re: htaccess question

2009-09-11 Thread Shawn McKenzie
orization script, but I don't want to alter 100 scripts to do it. > > Opinions and suggestions welcomed. > > Thanks, > > tedd .htaccess php_value auto_prepend_file "/path/to/auth.php" -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Shawn McKenzie
>> I think the problem is that he didn't check that the key he used >> actually existed before using the value it pointed to. So he got an >> empty string for $row['Number']; because the key should have been >> 'Part_Number'. I don't know that even E_STRICT would catch that one. >> >> Bob McConnell

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Shawn McKenzie
problem is that he didn't check that the key he used > actually existed before using the value it pointed to. So he got an > empty string for $row['Number']; because the key should have been > 'Part_Number'. I don't know that even E_STRICT would catch that one. > > Bob McConnell What? With E_ALL or E_STRICT: Notice: Undefined index: Number in file.php on line X -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Stricter Error Checking?

2009-09-23 Thread Shawn McKenzie
a warning that > there might be a problem with the statement. All I saw is that nothing was > being returned via the echo command. > > There really must be a stricter error checking that is turned on somewhere, > isn't there? > > > Thanks for your help. >

Re: [PHP] stdout as input

2009-09-24 Thread Shawn McKenzie
e end, but as long as I check for that in the loop (which I should > usually be doing anyway), it's no problem. > > Ben Exactly. And if you just want redirected data you can try: $data = file_get_contents("php://stdin"); --or-- For an array of lines: $lines = file("php://stdin"); -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Output buffering

2009-10-07 Thread Shawn McKenzie
ecute an ob_start() to start buffering, the ini setting will still be off. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Newb question about getting keys/values from a single array element

2009-10-09 Thread Shawn McKenzie
scenario. > > The rub is that I don't know the "id", so I can't use $item[0], and I also > don't have something like $item['name'] to use either. > > There's got to be an easy way to extract those. > > list($id, $name) = $opera

Re: [PHP] Fatal error on functions valid for PHP 4, 5

2009-10-09 Thread Shawn McKenzie
the Paschal full moon (a number between -6 and 28) */ $G = $Year % 19; $C = (int)($Year / 100); $H = (int)($C - (int)($C / 4) - (int)((8*$C+13) / 25) + 19*$G + 15) % 30; $I = (int)$H - (int)

Re: [PHP] Get rid of warning massage

2009-10-20 Thread Shawn McKenzie
rror. >> >> -- >> Thodoris > > > Matters a hell of a lot! If the url is not even partially validated at > all ($url="poo") then it could potentially be open to all manner of > attacks. > > Thanks, > Ash > http://www.ashleysheridan.co.uk &

Re: [PHP] Sanitizing potential MySQL strings with no database connection

2009-10-20 Thread Shawn McKenzie
($value) { if (is_int($value)) { return $value; } elseif (is_float($value)) { return sprintf('%F', $value); } return "'" . addcslashes($value, "\000\n\r\\'\"\032") . "'"; } -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Text File Busy

2009-10-21 Thread Shawn McKenzie
kely. Try: lsof | grep filename.php -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: how call a variable in a text

2009-10-21 Thread Shawn McKenzie
> > when I run send.php, I get the mail. But I can't call variable called > variable. it comes as string. > How can I correct this? http://us2.php.net/manual/en/language.types.string.php $message= " There is a text $variable trial. "; -- Thanks! -Shawn http://w

Re: [PHP] how call a variable in a text

2009-10-21 Thread Shawn McKenzie
Emax - masterminds.dk >> > > Try this though: > > > $var = array(array('great','alright'), 'boring'); > > print "This is $var[0][0]."; > > ?> > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > And since we are trying to cover all possible ways (works with double quotes also): $message = ' There is a text ' . $variable . ' trial. '; -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] php mail() function

2009-10-22 Thread Shawn McKenzie
il, compromised servers, servers known for spam, ip ranges known to be held by spammers and *ranges that ISPs designate as dynamic or used for subscribers (DSL, cable, dial-up customers, etc. because they shouldn't be relaying email). -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Array

2009-10-24 Thread Shawn McKenzie
27;][$key]['quantity'] . "\r\n"; > } > > } else { > #no products selected > > echo "\r\n"; > echo "Your shopping cart is empty\r\n"; > echo "\r\n"; > > } > Or use unset, but unset the entire order: unset($_SESSION['order']) -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: PHP+Apache suddenly not working

2009-10-27 Thread Shawn McKenzie
ognize that this isn't an apache support > list. This message is being cc'd there too. Are you sure you selected the Apache mod in make config? 1. go to /usr/ports/lang/php5 2. make deinstall 3. make config 4. select APACHE MODULES 5. select ok 6. make clean install -- Th

[PHP] Re: Converting tables into forms

2009-10-28 Thread Shawn McKenzie
rting tables into forms? Use the CakePHP framework. Run a script, type in your database info and it will scan all your tables and generate the forms and the list, update, delete code for each table. It should be fully functional then and you can tweak to your needs to add table relations etc.

Re: [PHP] Re: Create a screenshot of a website

2009-10-28 Thread Shawn McKenzie
; > http://www.phpclasses.org/blog/post/104-Submit-your-site-redesign-proposal-for-the-contest.html > Yeah Rob, put up or shut up! ;-) -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: UrlRewrite htaccess confusion

2009-10-29 Thread Shawn McKenzie
h without testing): http://benchwarmersports.com/packages/basketball/2010/nba-all-star-game/somefile.php --or-- http://benchwarmersports.com/packages/basketball/2010/somefile.php This is because it is interpreting the slashes as path separators. You probably need to generate absolute URLs in your links. --

[PHP] Re: UrlRewrite htaccess confusion

2009-10-29 Thread Shawn McKenzie
7;Something'; -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: What PHP version are you using?

2009-10-29 Thread Shawn McKenzie
useful in helping me > determine which PHP version numbers to do my regression tests against. > > Thanks. > Home/Dev: 5.2.15 Web: 5.1.6 (probably should update) -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: UrlRewrite htaccess confusion

2009-10-29 Thread Shawn McKenzie
Shawn McKenzie wrote: > Rob Gould wrote: >> You are indeed correct! Absolute URLs for everything, images, css, >> javascript, and links fixed the issue. Took me forever to change every >> link in the whole site, but it's happy now. Seems like there ought to >> be

[PHP] Re: What PHP version are you using?

2009-10-29 Thread Shawn McKenzie
Shawn McKenzie wrote: >> > Home/Dev: 5.2.15 > Web: 5.1.6 (probably should update) > O.K. so 5.2.15 doesn't exist :-( That is the Zend debugger version I have. I actually have Home/Dev: 5.2.4. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (htt

Re: [PHP] Custom function for inserting values into MySQL

2009-11-03 Thread Shawn McKenzie
ersonally, if I am passing more than three parameters (sometimes even three) I rethink my function. I'm not sure what you envision using this function for, but the approach I use for forms and databases is always arrays. I get an array from my forms, I insert that array into the database, and of course I fetch arrays out of the database. These are all indexed the same with the index as the field name of the table so it's easy. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Using remote include config file and class in a local file

2009-11-03 Thread Shawn McKenzie
es file) on > my local running php script ? As others have said, you are receiving the output of the config.php after it has been parsed by PHP on the remote server. You could try naming it config.cfg, config.conf, config.ini, config.inc, etc... -- Thanks! -Shawn http://www.spidean.com --

Re: [PHP] Custom function for inserting values into MySQL

2009-11-04 Thread Shawn McKenzie
In your example, I would name my form inputs similar to name ="data[user_id]". Then you just pass the $_POST['data'] array to your function. -Shawn Allen McCabe wrote: > You raise some good points. I always name my input fields after the > entity names ( eg. input ty

Re: [PHP] Creating a Dynamic PHP/CSS Page (newbie design question)

2009-11-05 Thread Shawn McKenzie
" from demo > How do I get it to show up? > > == > > > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > http://www.w3.org/1999/xhtml";> > > > Untitled Document > > > > > > test

[PHP] Re: Suppress Right-Click and Hide hover URL

2009-11-09 Thread Shawn McKenzie
n confirm('Are you sure you want to REMOVE the > assoication of this Area with this Inlet?')\"\">Remove > > Please let me know if this can be tweaked to work... > > Thanks! > You are missing PHP tags -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Suppress Right-Click and Hide hover URL

2009-11-09 Thread Shawn McKenzie
I see... I guess I fail at being a smart ass! Don Wieland wrote: > Nope this was just a snippet of my code - they are between the PHP tags. > > On Nov 9, 2009, at 11:38 AM, Shawn McKenzie wrote: > >> You are missing PHP tags > > Don Wieland > D W

Re: [PHP] Noob question: Making search results clickable.

2009-11-18 Thread Shawn McKenzie
uot;SELECT id, title FROM videos WHERE topic1= '$topic'"); For the second piece, in video_display.php, you'd do something like this: $id = (int)$_GET['id']; $result = mysql_query("SELECT * FROM videos WHERE id=$id LIMIT 1"); if($result) { $row = mysql_fetch_array($result); echo $row['title'].""; echo $row['description'].""; echo $row['title'].""; // etc... } else { die("Invalid id"); } -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Noob question: Making search results clickable.

2009-11-18 Thread Shawn McKenzie
Make sure to reply all... Paul Jinks wrote: > Thanks to everyone for replying, it's much appreciated. Thanks > especially for the final piece of the puzzle, Shawn, I don't think I > was going to find it on my own - the display I have in mind is a > little different, but I

[PHP] Re: dynamic meta tag and title app?

2009-11-18 Thread Shawn McKenzie
words"; break; } include('header.php'); include('whatever_file.php'); If you have separate pages like home.php, then something like this: // home.php $title = 'Home'; $description = 'Some description'; $keywords = "some, key, wor

[PHP] Re: need a find/replace command to fix my require_once

2009-11-20 Thread Shawn McKenzie
y) in the future. > > sure the time could better be invested fixing a bug, writing a test or > documenting something. > > s'all your call though :) I agree. That's a PEAR coding standard, so unless you're coding a PEAR package it doesn't matter. It's the PE

[PHP] Re: Thread Safe?

2009-11-20 Thread Shawn McKenzie
l C. 9 and 6 are the versions. http://en.wikipedia.org/wiki/Thread_safety Thread Safe PHP on Linux isn't recommended because some extensions may not be thread safe but I think on Windows it's ok if you need it. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.n

[PHP] Re: processing html forms and keeping the values

2009-11-24 Thread Shawn McKenzie
ing all characters? > > Thank you for any hint, > > Merlin No need to POST and then redirect, just POST the form to itself. If validation fails redisplay the form using the $_POST array. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscr

Re: [PHP] string concatenation with fgets

2009-11-30 Thread Shawn McKenzie
file.txt", "r"); > while (! feof($file)) > { $tmp = trim(fgets($file)); if ($tmp != '') > { $names = $tmp; > } > print $names."sometext\n"; > } > fclose($file); > > -- Thanks! -Shawn ht

Re: [PHP] Powerpoint from PHP?

2009-12-02 Thread Shawn McKenzie
ML or XML and inspect the tags you can see what you need to do to build one. Or PP will open the HTML or XML and it will behave as a PP presentation if you give it a PP extension instead of htm/html. Also, a PP saved in HTML looks great in IE and has some PP functionality. -- Thanks! -Shawn http://

Re: [PHP] Compatiabilty issues

2009-12-02 Thread Shawn McKenzie
t;> http://www.ashleysheridan.co.uk >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> Are you sure the PHP ones are running under Apache? Just to check, see >>> what you get in the $_SERVER array. Also, have y

[PHP] Re: session overwriting global

2009-12-05 Thread Shawn McKenzie
e which is not verified so the browser shows the usual > warning/accept certificate message. > register_globals = On in php.ini? -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Force-Saving an Audio File

2009-12-09 Thread Shawn McKenzie
t; $directory = "http://mysite.com/test1/";; > > so when I took out that elseif then readfile("$path"); did work > > SO: Is there a php function that can work like file_exists( $path ) > and tell if the file exists but work from a URL like: > $thisfile = &q

[PHP] Re: SimpleXML or DOMDocument help

2009-12-09 Thread Shawn McKenzie
-5569 > Cell: 571-332-9210 > * > > What's the entire XML document? You need a xmlns declaration as Query is a namespace. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: SimpleXML or DOMDocument help

2009-12-09 Thread Shawn McKenzie
t me access $xml->Query->{Query:Where}. for example > > >> -- >> Thanks! >> -Shawn >> http://www.spidean.com >> >> >> > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: SimpleXML or DOMDocument help

2009-12-09 Thread Shawn McKenzie
Shawn McKenzie wrote: > Please keep this on list. > > The URI for the namespace is important. Something like (not tested): > > | ||// use URI for Query namespace| > | foreach ($xml->children('http://www.example.com/something') as $Query) { > echo $Quer

[PHP] Re: SimpleXML or DOMDocument help

2009-12-09 Thread Shawn McKenzie
Shawn McKenzie wrote: > Shawn McKenzie wrote: >> Please keep this on list. >> >> The URI for the namespace is important. Something like (not tested): >> >> | ||// use URI for Query namespace| >> | foreach ($xml->children('http://www.example.co

Re: [PHP] Parsing JSON; back-slash problem

2009-12-15 Thread Shawn McKenzie
data from a >> file, JSON.parse can't parse it because of the back-slashes. I'm >> pretty sure my problem is on the PHP side (since it's fine coming out >> of JS); what do I need to do to fix this? is a preg_replace enough? >> > > > Turn off magic quo

Re: [PHP] Class not functioning

2009-12-15 Thread Shawn McKenzie
eral ways to do it. One would be to make the Meetgreet a singleton if it really is, and then use its static getInstance. I would probably use a registry pattern though. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Class not functioning

2009-12-15 Thread Shawn McKenzie
Sorry, and then I didn't keep it on list :-( Shawn McKenzie wrote: > Please reply to the list. Just google for "php registry pattern". Here is a > very basic example. There are better OOP people here than I. > > class Registry { > protected $_objects = array(

[PHP] Merry Christmas!

2009-12-25 Thread Shawn McKenzie
Merry Christmas from Texas, USA! -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Noob stuff - Zend/Opcode/Cache/Optimizer

2009-12-27 Thread Shawn McKenzie
dding another engine on my machine? Yes, it is a install of PHP with alot of other stuff bundled in. So it depends upon what you need and if you want to install/configure PHP yourself with all of these additions, or if you just want to install the Zend server. -- Thanks! -Shawn http://www.s

[PHP] Re: Noob stuff - Zend/Opcode/Cache/Optimizer

2009-12-27 Thread Shawn McKenzie
Thanks, > dK > ` I'm really not sure what the + designation is for, they may have changed the way things work since I last used the optimizer. The Zend Optimizer used to be a byte code optimizer/cacher that also allowed you to run Zend Guard encrypted apps that you were authorized to us

[PHP] Re: splitting a string

2010-01-05 Thread Shawn McKenzie
College. Tyne Metropolitan College will not be liable for > any losses as a result of any viruses being passed on. > list($filename) = explode('.', $props['name']); Or if you may need the extension: list($filename, $extension) = explode('.', $props['name']); -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: splitting a string

2010-01-05 Thread Shawn McKenzie
Ashley Sheridan wrote: > On Tue, 2010-01-05 at 08:45 -0600, Shawn McKenzie wrote: > >> Ingleby, Les wrote: >>> Hi all, first time I have posted here so please be nice. >>> >>> I am using PEAR HTTP_Upload to handle multiple file uploads. What I need to &

Re: [PHP] Re: splitting a string

2010-01-05 Thread Shawn McKenzie
Andrew Ballard wrote: > On Tue, Jan 5, 2010 at 10:20 AM, Ashley Sheridan > wrote: >> On Tue, 2010-01-05 at 16:18 +0100, Daniel Egeberg wrote: >> >>> On Tue, Jan 5, 2010 at 16:09, Shawn McKenzie wrote: >>>> Of course this doesn't work for so

Re: [PHP] Read directory; store filenames found in mySQL table?

2010-01-13 Thread Shawn McKenzie
Kenneth Sande wrote: > I use the glob function in my little homemade "web cam" page, which can > really swell up in memory when used against a large amount of files (in > my case around 30k files). +1 for glob() -- Thanks! -Shawn http://www.spidean.com -- PHP General

Re: [PHP] header("Location:...") fails

2010-01-13 Thread Shawn McKenzie
ooo much simpler :) > > Cheers, > Rob. Definitely! Technically, header() with Location: should have an absolute URL, though it works without one most of the time. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] mysql_real_escape_string(0xffffffff) yields -1

2010-01-16 Thread Shawn McKenzie
tring('0x'); > > In case you haven't noticed, SQL statements are stored in strings. And mysql_real_escape_string() expects a string as an argument. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Casting objects.

2010-01-18 Thread Shawn McKenzie
or another class may work (not tested). You might even fetch an array and send it to this method. I think either should work: class structuresRemovalReason { static public function cast(structuresRemovalReason $object) { return $object; } } $row = structuresRemovalRe

[PHP] Re: Casting objects.

2010-01-18 Thread Shawn McKenzie
Shawn McKenzie wrote: > Richard Quadling wrote: >> Hello. >> >> I've got an object via odbc_fetch_object (which is of stdClass). >> >> I have an class structuresRemovalReason. >> >> I want to cast the response of odbc_fetch_object to structuresRe

[PHP] Re: Casting objects.

2010-01-18 Thread Shawn McKenzie
Shawn McKenzie wrote: >> > Never mind, that was stupid. I saw that somewhere before, but obviously > it doesn't work. > I found some code, maybe I redeem myself? static public function cast(&$object, $class=__CLASS__){ if(class_exists($class)) {

Re: [PHP] Close MySQL Result

2010-01-21 Thread Shawn McKenzie
t; > > I've never heard this to be the case. > I have proof to the contrary :-) 65,588 Bytes used before query 6940 rows returned 67,264 Bytes used after query 6,376,612 Bytes used after array creation 6,376,756 Bytes used after mysql_free_result -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] 大客户营销策略与区域市场开发

2010-01-23 Thread Shawn McKenzie
PGRADED "; Name :___ participants :_ Number of people Contact Person :___ Phone :__ Fax :____ Participants fee: RMB ¥ :__ Email :_ Participants were :___ Payment: □ 1, the cash □ 2, transfer □ 3, Wire Transfer Book Item: □ Yes, □ No accommodation (please choose to play "√") Note: Please return the registration receipt Division I, in order to ensure that your registration is correct, please call again to confirm! -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] MySQL ID -- what happens when you run out of range?

2010-01-25 Thread Shawn McKenzie
gt; 3. MySQL will then try and insert the new row with the updated id. > 4. MySQL will find that the id already exists, and will return a > duplicate ID error. 5. A tear is rendered in the space time continuum! -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http:

Re: [PHP] Creating an Entire .html page with PHP

2010-01-25 Thread Shawn McKenzie
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > http://www.w3.org/1999/xhtml";> > > > Untitled Document > > > > > this is a test'.$addthis.''.$row_get['FirstName'].' > '.$row_get['LastName'].'

[PHP] Re: Good source for sample data?

2010-01-28 Thread Shawn McKenzie
uldn't matter if testing is your purpose. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: how do I use php://memory?

2010-01-29 Thread Shawn McKenzie
ents('php://memory'); And it returned nothing. The docs suck on this and it apparently doesn't work. I see others use it with fopen(), but there is no mention of which file functions it works with and which it doesn't. -- Thanks! -Shawn http://www.spidean.com -- PHP

Re: [PHP] Re: how do I use php://memory?

2010-01-29 Thread Shawn McKenzie
Eric Lee wrote: > On Sat, Jan 30, 2010 at 9:00 AM, Shawn McKenzie wrote: > >> Mari Masuda wrote: >> >>> Has anyone ever successfully used php://memory before? If so, what >>> can I do to use it in my code? Thank you. >> No, but I was intrigued to try

Re: [PHP] Re: how do I use php://memory?

2010-01-30 Thread Shawn McKenzie
Daniel P. Brown wrote: > (Typing from the DROID, so forgive the top-posting.) > > Shawn, would you take a few moments to submit this as a bug at > http://bugs.php.net/? I know you well enough that, if you say the docs suck, > they probably do. > > On Jan 29, 2010 10:4

Re: [PHP] simplexml - can it do what I need?

2010-02-06 Thread Shawn McKenzie
ying idtype="11" and lang="fr". > Can I use Simplexml to do this and, if so, how? If not, what should I use? > Many thanks for any help. > Terry Look at the options: $xml = simplexml_load_file('file.xml', 'SimpleXMLElement', LIBXML_NOCDATA); --

[PHP] Re: Warning?

2010-02-07 Thread Shawn McKenzie
hp 5.2.10 and register_global is OFF. This will reproduce the error: session_start(); $_SESSION['test'] = null; $test = 1; It has something to do with using a global var that is the same name as a session var, but the session var has to be null it seems. -- Thanks! -Shawn http://ww

[PHP] Re: SOAP connect error

2010-02-09 Thread Shawn McKenzie
r to Starbucks can you get to http://XX.XX.XX.XXX:8080 ? If not, then the external server can't either. It could be a network firewall/proxy sever in your office, or any number of things. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP Manual problems

2010-02-10 Thread Shawn McKenzie
ype for Win2K is over in 5 months. Better upgrade. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] optional object arguments to a function

2010-02-14 Thread Shawn McKenzie
n check for the key and if the key is set, grab > the object associated with it. Maybe I mis-read your post, but what's wrong with Jochem's method. That's what I was going to propose. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] optional object arguments to a function

2010-02-14 Thread Shawn McKenzie
Nathan Rixham wrote: > Shawn McKenzie wrote: >> Michael A. Peters wrote: >>> Rene Veerman wrote: >>>> On Sat, Feb 13, 2010 at 9:05 AM, Michael A. Peters >>>> wrote: >>>>> How do I specify a default null object, or otherwise make the arg

Re: [PHP] Re: UK Project Opportunity

2010-02-16 Thread Shawn McKenzie
have downloaded several in the past that performed functions that I wasn't very familiar with and used them as a learning guide and inspiration for my own code. I don't have a problem with the profits. People submit their code because they want to, and well, ads are part of most sites now days, sf included. The only slightly negative thing that I can say is that I have never seen a post by Manuel on this list actually contributing a solution, recommendation or any type of help other than a link to phpclasses. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: UK Project Opportunity

2010-02-16 Thread Shawn McKenzie
Manuel Lemos wrote: > Hello, > > on 02/17/2010 02:13 AM Shawn McKenzie said the following: >> PHP framework to speak of. Manuel has authored most of them and many > > I suppose you meant that I authored many of the classes. I only > submitted about 30 out of more tha

[PHP] Re: storing a mysql query in mysql

2010-02-17 Thread Shawn McKenzie
into the database but when I view it with sqlyog its f'ed up > beyond belief. Is there another/better way to store this information? > > Thanks, > Matt > What's f'ed up? I mean, I know what it means, but what does it look like when you view it? -- Thanks! -S

[PHP] Re: Magnetic Stripe Reader or Barcode to PHP

2010-02-19 Thread Shawn McKenzie
o you have a PHP web app on your LAMP box that the other netbooks point to. When they swipe the card it inputs into the text field and uses an onchange() to submit the form and redisplay the form, or have other fields that need to be populated (guests, etc.). I haven't done it, but seems simple

Re: [PHP] Linux ERD software

2010-02-24 Thread Shawn McKenzie
;m going to take a look at > MySQL Workbench when I get some time, but this project is already in > danger of falling behind schedule :( > Hey Ash. When you have a spare several minutes or so, just download MySQL Workbench. You can just suck in your existing DB and voila! Or

[PHP] Re: PHP "GET" Error?

2010-02-25 Thread Shawn McKenzie
> _ > Hotmail: Free, trusted and rich email service. > http://clk.atdmt.com/GBL/go/201469228/direct/01/ There are characters in the URL that have a meaning within a URL itself (such as #). Use urlencode() before put

<    2   3   4   5   6   7   8   9   10   11   >