Re: [PHP] I have an idea

2009-07-15 Thread VamVan
On Wed, Jul 15, 2009 at 12:40 PM, Daniel Brown  wrote:

> On Wed, Jul 15, 2009 at 15:30, Ashley Sheridan
> wrote:
> > Done! In order to never lose, don't play ;)
>
> That's what I had expected.  ;-P
>
>About eleven years ago, a co-worker and I each wanted the same day
> off.  I had seniority, but decided to play fair with him and give him
> a shot.  I told him that I could guarantee I could tell him the score
> of a football game that night before the game started.  If I was
> wrong, he could have the day off AND I would give him my pay for the
> day (we were medics for the state, so it wasn't a horrible chunk of
> change).  If I was right, I got the day off --- but to make sure it
> was fair, we had to watch the game together that night, and he had to
> pay for pizza.
>
>When I got to his house, he ordered the pizza and asked if I was
> ready to lose.  I told him quite the contrary: before the game starts,
> the score is a tie at zero-zero.
>
>Being a good sport and admitting defeat, he let me have the day
> off.  Being as graceful as he was, I instead let him have the day
> off and paid for the pizza.
>
>A very "cheesy" story (yeah, that's right), but relevant.  Seems
> that now, in some places, trying to pull the same gag - even on a
> friend - could get you two to the chest, single to the head.  People
> just don't have a sense of humor anymore
>
> --
> 
> daniel.br...@parasane.net || danbr...@php.net
> http://www.parasane.net/ || http://www.pilotpig.net/
> Check out our great hosting and dedicated server deals at
> http://twitter.com/pilotpig
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> : nice one


Re: [PHP] Pattern Matching[Resolved]

2009-07-15 Thread VamVan
On Wed, Jul 15, 2009 at 4:21 AM, Lenin  wrote:

> On Wed, Jul 15, 2009 at 3:24 AM, VamVan wrote:
>
> > contact/me - Contact US
> >
> > perfect match would be easy because I can exactly look for what I want.
> >
> > It becomes tricky when I introduce wild cards like contact/* for example.
> It
> > could also be contact/me/*
> >
> > How would I match patterns for this kind of relative matches.? Any ideas
> > anyone?
>
>
> Use preg_match function to do that.


Ok here is how I solved it. When I have a url like www.xx.ccom/a/b/c for
example, what I do is
get an array of abc, ab, a

Then I run a union query for all three combinations. So basically select *
from {lookup_table} WHERE path = 'abc' UNION select 

Then I just retrieve the first row  mysql_fetch_object. That is what I need.

Thanks Anyways
V


[PHP] Pattern Matching

2009-07-14 Thread VamVan
Hello Guys,

I have a question related to pattern matching and wildcards. This is the
scenario.

I have friendly urls on my website. So retrive their path as arguments for
every page.

so for example if I have www.xx.com/contact/me my args array will be

args(
   0 => contact,
   1 => me
)

My requirement is to change the page title on the fly with specific
patterns, so what I do is define a look up table with these columns.

path, pageTitle

contact/me - Contact US

perfect match would be easy because I can exactly look for what I want.

It becomes tricky when I introduce wild cards like contact/* for example. It
could also be contact/me/*

How would I match patterns for this kind of relative matches.? Any ideas
anyone?

Thanks,
V


Re: [PHP] CMS

2009-07-08 Thread VamVan
On Wed, Jul 8, 2009 at 2:31 PM, madunix  wrote:

> Dear ALL,
>
> What  are the experiences you have with various open source CMS
> products (Comparison of PHP-based CMS) such as  (Drupal, Joomla,
> OpenCMS, Typo3, eZ publish ..etc.)
>
> Security, Bugs, Performance, Support, Developer Community, learning
> curve, appearance..etc
>
> Thanks
> -mu
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
I work a lot with Drupal. Overall I would say it is a good CMS but I don't
think it can cater to all needs of enterprise level applications.

As a serious Developer , let me give you some of the advantages and
disadvantages of Drupal, But please keep in mind these are just my
experiences:

Advantages:

1) Lot of CRUD applications already available.
2) Session and User Management is already built in.
3) Very good Contrib Modules.
4) very good community support for all the code base which is popular.
5) For a Quick website this is the best tool.

Disadvantages:

1) After working almost 1 and 1/2 year on Drupal. Initially I wanted to make
Drupal work for my application and it did nice. But now I am kind of making
my application work for Drupal which is bad.
2) Some set of standards like revision management for example does not suit
enterprise architecture.
3) If ure entering some uncertain waters, u have to swim urself. because you
will not get the support from community.
4) Learning Curve is steep for beginners.
5) Actual OOPS is not very well practised even though code helps you define
some hooks. But most of the cases , the hooks available do not serve your
purpose.

But anyways your choice of CMS depends on your project size. If its a big
enterprise level application, I would research more.

Thanks,
V


[PHP] SOAP and Exception Handling

2009-05-01 Thread VamVan
Hello Guys,

I use SOAP calls to make web service requests.I have a class that does
webservice calls to various wsdls. So my question is about try catch blocks.

so my method looks like this:

private function method($cookie){
  //Define Client
  try{
  // Check if WSDL exists
  if(!...@file_get_contents($this->WSDL)) {
throw new SoapFault('Server', 'No WSDL found at ' .
$this->WSDL);
  }
  $client = new SoapClient($this->WSDL, array(
  'exceptions' => 1,
  'encoding' => "UTF-8",
  'connection_timeout' => 60
  ));
  }catch(SoapFault $fault){
  // Error if the WSDL is not available or new client cannot be made
  //log errror
  }
  //Define Input Array
$input = array();
$input['cookie'] = $cookie;

//Make the call
  try{
  $result = $client->function($input);// Make the Call
  return $result;
  }catch(SoapFault $fault){
//log error
  }
   }

How is it possible for me to *remove *these 2 try and catch blocks from this
method and just throw exceptions, but do a try and catch in the business
logic.

So basically I might have different functions in  business logic area that
might call the same method and I do error logging there itself instead
directly in the method?

Thanks,
V


Re: [PHP] Increase your monthly income!

2009-04-09 Thread VamVan
I believe there is some kind of filter for SPAM emails and emails not
related to PHP. Question is: How come some emails still make it to this
list? Anyone to shed some light on this topic?

Thanks,
V


Re: [PHP] need help with code

2009-03-22 Thread VamVan
Code without proper indentation and is very hard to comprehend. You have
unnecessary spacing and line breaks that makes it difficult to debug.

I suggest you few things as a good practice:

1) Until you learn perfectly to code use some nice GUI editors that have
syntax highlighting (aptana, eclipse, zend etc).
2) Don't try to mix up markup (html) and api calls(PHP Code). Believe it
become a horrible mess to maintain after some point.

Anyways Here is your code with parse error removed:

getRequestToken();
$reqToken = $tok['oauth_token'];
$reqTokenSecret = $tok['oauth_token_secret'];
$request_link = $to->getAuthorizeURL($toc);
$content = 'Click on the link to go to twitter to authorize your
account.';
$content .= ''.$request_link.'';
setCookie('reqToken',$reqToken,time()+(24*30*60*60),'/');
setCookie('reqTokenSecret',$reqTokenSecret,time()+(24*30*60*60),'/');

?>
authorize


getAccessToken();
  /* Save the access tokens. Normally these would be saved in a database
for future use.*/

setCookie('accessToken',$tok['oauth_token'],time()*24*60*60*30+3600,'/');

setCookie('accessTokenSecret',$tok['oauth_token_secret'],time()*24*60*60*30,'/');
  header("location http://www.chriswestbrook.com/twitter/twitter.php";);

}
  }
}
?>

Thanks,
V


Re: [PHP] whoami explanation

2009-03-04 Thread VamVan
On Wed, Mar 4, 2009 at 7:50 PM, Daniel Brown  wrote:

> On Wed, Mar 4, 2009 at 22:46, VamVan  wrote:
> >
> > Hey Guys I have  Question. I just noticed that once the whoami thread
> > reached 100 posts it automatically created another thread. Is this
> intended?
> >
> > Can a discussion be only 100 post's long??
> >
> > Just out of curiosity :)
>
> In Gmail, yes.  That can also happen with someone's mail client
> being improperly configured, but over the years on the different
> mailing lists --- this one especially --- Gmail seems to cap each
> thread to 100 for me as well.  Could be coincidence, but that's
> probably considered a "feature."


Ohh interesting. Thanks for clarifying. I was kind of mystified for few
seconds.

:)

V

>
>
> --
> 
> daniel.br...@parasane.net || danbr...@php.net
> http://www.parasane.net/ || http://www.pilotpig.net/
> 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1
>


Re: [PHP] whoami explanation

2009-03-04 Thread VamVan
On Wed, Mar 4, 2009 at 7:35 PM, Daniel Brown  wrote:

> On Wed, Mar 4, 2009 at 20:28, Shawn McKenzie  wrote:
> >
> > Well, the ground beef is actually tartar and it goes without saying that
> > it would be topped with foie gras and grape chutney with caviar on the
> side.
>
>  with gold-plated platinum flakes and diamond-dust salt.
>

Hey Guys I have  Question. I just noticed that once the whoami thread
reached 100 posts it automatically created another thread. Is this intended?

Can a discussion be only 100 post's long??

Just out of curiosity :)

V


[PHP] 500 Internal Server Error

2009-03-01 Thread VamVan
Hello All,

What is the situation when we get internal server error 500 on PHP pages?

>From Internet I got some info like, you get it when :

1) If friendly urls are not supported by apache.(mod_rewrite)
2) If max_execution_time max's out.
and some more related to apache.

I got a weird situation where I do PHP eval() and if the parsed string is
wrong, I get internal server error 500.

So question is I was under the impression that PHP code errors  will never
result in a http response errors. Am I completely wrong here? Can anyone
tell me from their experience what are the specific scenarios we get this
error?

Thanks,
V


Re: [PHP] Re: More questions about SESSION use

2009-02-05 Thread VamVan
On Thu, Feb 5, 2009 at 9:16 AM, Terion Miller wrote:

> On Mon, Feb 2, 2009 at 4:18 PM, Chris  wrote:
>
> > Edmund Hertle wrote:
> >
> >> 2009/2/1 Terion Miller 
> >>
> >>  This is how it was originally written:
> > if (empty($_SESSION['AdminLogin']) || $_SESSION['AdminLogin'] !=
> >
>   true){
> >>>
> header ("Location: LogOut.php");
> >$_SESSION['user']=$UserName;
> >$_SESSION['AdminID']=$AdminID; <--*I added this one originally the
> > script only used 'user' and 'AdminLogin'* but passed them in urls
> > }
> >
> 
> >> Those two lines after header() will not be executed.
> >>
> >
> > Yes they will because there is no 'exit'.
> >
> > Header is just a function call, if you want to stop processing you have
> to
> > do it yourself.
> >
> > --
> > Postgresql & php tutorials
> > http://www.designmagick.com/
> >
>
> Is it better to use the session_register() could that be my issue ,although
> my sessions are passing from page to page so they are registered? right...
> is this part of that loose format that php coders just love and I
> hate..because it to me makes learning it hard...
> t.


FYI session_register is deprecated in PHP 5.3.0 and completely going away in
PHP 6.0. Please don't use it.

Thanks,
V


Re: [PHP] Is it possible to send POST vars through a header redirect?

2009-02-03 Thread VamVan
On Tue, Feb 3, 2009 at 2:54 PM, Jim Lucas  wrote:

> TS wrote:
> > I'm trying to send vars via POST somehow. Is this possible?
> >
> > Currently I'm doing
> >
> > header("Location: http://domain/index.php?var=3";);
> >
> > but, want to send POST or some other method that doesn't stick with the
> session.
> >
> > Thanks, T
> >
> >
>
> No, it is not possible.  You will need to look into cURL or something else.
>
> But it cannot be done via the header() function.
>

I second that you need to use curl:

$header = array(
"MIME-Version"=>"1.0",
"Content-type"=>"text/html; charset=utf-8"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->elqPosturl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, $this->curlOptTimeOut);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_PROXY, $this->proxyServer);
curl_setopt($ch, CURLOPT_PROXYPORT, $this->proxyPort);
curl_setopt($ch, CURLOPT_POSTFIELDS, $inputArray);
curl_setopt($ch, CURLOPT_USERAGENT, 'MSIE');
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_HEADER, 1);

$data = curl_exec($ch);

Thanks,
V


Re: [PHP] PHP Enclosing Tags? Do You Close Your PHP Declarations?

2009-01-30 Thread VamVan
On Fri, Jan 30, 2009 at 10:45 AM, Nitsan Bin-Nun wrote:

> I was just wondering whether people enclosing their PHP tags declarations,
> I don't close these  needs them,
> and for the second reason - if a space/tab/new line/etc will beneath them
> it
> will cause
> problems with output buffering and session handling.
>
> Do you close your PHP 
> (at least I closed them here :P look down)
>

My suggestion don't close it.  Headers already sent is a big problem because
most of the time you see nothing but "PHP Blank Of Death". If you don't have
access to tail ur log then its like a nightmare. I never understood this
error when I was a beginner.

Thanks,
V


Re: [PHP] Re: Opinions / Votes Needed

2009-01-19 Thread VamVan
On Mon, Jan 19, 2009 at 11:50 AM, Daniel Brown  wrote:

> On Mon, Jan 19, 2009 at 14:37, VamVan  wrote:
> > Why are you guys Burning your egos here? Its not the right place.
>
> It's a PHP-related general discussion, Vam.  Perhaps not entirely
> in good manners, but it's 100% relevant.  Indeed, this is the right
> place.
>

I aplogize about top posting.

I believe in Community building. My only concern was the kind of language
used is very intimidating , that's all.

Anyways cheers to all. I enjoy reading responses and asking questions here.
This is the best group I have ever been involved with as long as I have
started learning PHP.

Thanks Again


Re: [PHP] Re: Opinions / Votes Needed

2009-01-19 Thread VamVan
Why are you guys Burning your egos here? Its not the right place.



On Mon, Jan 19, 2009 at 11:03 AM, Kyle Terry  wrote:

> On Mon, Jan 19, 2009 at 10:59 AM, Robert Cummings  >wrote:
>
> > On Mon, 2009-01-19 at 10:50 -0800, Kyle Terry wrote:
> > > On Mon, Jan 19, 2009 at 10:35 AM, Daniel Brown 
> wrote:
> > >
> > > > On Mon, Jan 19, 2009 at 13:22, Kyle Terry 
> wrote:
> > > > >>
> > > > > Aside from a few perl scripts, I have rewritten all my bash scripts
> > in
> > > > PHP.
> > > > > It's just easier to manage for me.
> > > >
> > > > /me nods.
> > > >
> > > >In 2001, I started rewriting a library of Perl scripts I'd been
> > > > building since 1995 (5.0.0.1), which meant rewriting about 300
> > > > scripts.  There's a single script left out of that library that I
> > > > didn't convert, and only because it was the first usable Perl I'd
> ever
> > > > written.  Sentimental reasons, I suppose (and the fact that I rarely
> > > > have a need for it).  It just ran a recursive loop through
> directories
> > > > to convert all file extensions from UPPER or Variable to lower case.
> > > >
> > > > --
> > > > 
> > > > daniel.br...@parasane.net || danbr...@php.net
> > > > http://www.parasane.net/ || http://www.pilotpig.net/
> > > > Unadvertised dedicated server deals, too low to print - email me to
> > find
> > > > out!
> > > >
> > >
> > > Nice! I lied though, I use 1 python script that takes the ID3 tags from
> > mp3s
> > > and oggs and makes the filename pretty. It does this recursively once a
> > week
> > > through my music directory.
> >
> > I have a PHP script that does something similar :)
> >
> > Cheers,
> > Rob.
> > --
> > http://www.interjinn.com
> > Application and Templating Framework for PHP
> >
> >
> Maybe I'm due for a rewrite :)
>
> --
> Kyle Terry | www.kyleterry.com
>


Re: [PHP] Mirroring/caching PHP webpages.

2009-01-15 Thread VamVan
On Thu, Jan 15, 2009 at 4:57 PM, Clancy  wrote:

> For some time I have had feedback pages on several of my websites based on
> the example
> given by David Powers in chapter 6 of "PHP for Dreamweaver 8". These worked
> fine for some
> years, but some months ago someone started stuffing pornographic
> advertisements into them.
>
> A few weeks ago I got fed up with these messages, and devised a very simple
> filter to
> reject them  (I won't explain how this works, because if I did the
> perpetrators could
> immediately change their technique to defeat it).   If the content was
> acceptable I
> handled the message in the normal way, but otherwise I deleted the
> contents, and forwarded
> the message to a different address with the title "rubbish from XXX
> website".  This worked
> well, but then I decided I didn't need to know anything about this stuff at
> all, so I
> modified the logic so that if the message is unacceptable it is simply
> dumped, but the
> sender is still shown the normal "Thank you for your feedback" message.
> This way the
> sender cannot tell whether or not his message has actually been sent, and
> so he cannot
> experiment to try to break the filter.
>
> Now if I try to send myself bad messages they simply disappear without
> trace, as expected,
> but  I am still getting one or two messages a day sent with the version 1
> (censored)
> logic.  I have changed the messages in my new version, and verified that
> the old messages
> do not appear anywhere on my hard disk, and that there is only the new
> version of the
> feedback procedure on my server.
>
> The only explanation I can see is that someone has somehow managed to cache
> or mirror the
> version 1 logic, and is still dutifully stuffing pornography into it. As it
> is my
> understanding that the PHP code which handles the processing is
> inaccessible to the user,
> I cannot understand how this could have been done.  Does anyone have any
> suggestions?


I don't think that can happen either. Mirroring  Server level Caching
happens on ur server not on theirs...
My explanation would be your filter is not working as expected. you may not
filter everything ..
Its depends on ur script logic.

Thanks,
V


Re: [PHP] Re: iconv is messing up a spreadsheet generated by the Spreadsheet Excel Writer

2009-01-15 Thread VamVan
Thanks man that did it :-) .
What exactly was the problem you've noticed (I am seeing a diff between the
two files bu t I am not sure I fully understand)?

-- 
Thodoris


Yes I have previously worked on loads of Greek sites. Some how strange
enough I had problems whenever I used UTF-8 to store content and even
display on the web page.

So I had to use default latin swedish ci in the db and also use Charset 1253
in the html meta tag to get everything displayed properly.



Thanks,
V


Re: [PHP] Security question

2009-01-14 Thread VamVan
On Wed, Jan 14, 2009 at 2:22 PM, Frank Stanovcak
wrote:

> This is mostly to make sure I understand how sessions are handled
> correctly.
> As far as sessions are concerned the variable data is stored on the server
> (be it in memory or temp files), and never transmitted accross the net
> unless output to the page?  So this means I should be able to store the
> username and password for a program in session vars for quick validations,
> and if I force rentry of the password for sensitive areas (every time) even
> if someone mannages to spoof the sesid all they will have access to is non
> sensitive areas?  This also assumes I, at least, quick validate at the
> start
> of every page immideately after starting the session.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Password should never be stored anywhere in clear text. You can store md5
version in session or database. As long as password is encrypted ure fine
and safe.

Thanks,
V


Re: [PHP] PHP, Smarty, and Text

2009-01-14 Thread VamVan
On Tue, Jan 13, 2009 at 6:49 PM, Daniel Kolbo  wrote:

> Hello,
>
> I've been using PHP and Smarty for several years now and I am happy with
> this "division" of data from presentation.  With this philosophy in mind, i
> am a bit perplexed as to how to handle the text on my sites.  That is, the
> text is data, so i am motivated to store the text in a database, files, or
> the like, but then text is loaded with little markup nuances (random
> italics/weight/colors, etc...) that make template design rather ugly.  This
> motivates me to put markup (maybe even my own brand of markup) around the
> text, and to store this markup-text combination in a database.  But I don't
> like this either, because a lot of the people writing the content/text know
> word/writer not markup.  So i am motivated to have them save their text as
> .html, and I parse this file and modify accordingly.  However, i don't like
> this either as not all word/writer styles are 1-to-1 with CSS.  Without any
> options I am back to thinking "hard code" the text with markup in included
> templates, but it hurts just thinking of updating/modifying.
>
> I have looked (briefly) at Web Content Management Systems, but this seems
> like overkill really, maybe i'm ignorant.
>
> What would the community suggest?  The text can take on many forms,
> introduction text, about text, product information, articles, blurbs, (some
> changes daily, some doesn't) etc...where does all this text live in
> 'properly' designed site.
>
> Thanks in advance,
> dK



For specific requirements like this. I think it is very OK to set some
rules  when the user inputs the text. You can make the simple text area and
make some custom tags for ur application only. For example  in ur
application means  in html.

This way you can str_replace all that user enters in to watever class or
text u want to to make it look pretty. Its an easier way and reliable way
because you have the authority to validate user input if it does not match
certian criteria that you may need.

I don't know you can never blame user for what he enters. Not every user is
computer literate and our code should always cater the needs of this kind of
user and I feel its perfectly ok to tell the user to enter proper data if it
doesnot meet ur standards.

Thanks,
V


Re: [PHP] PHP unlink Permission Error

2009-01-13 Thread VamVan
Alice,

I see that you are using windows. For windows only the write permission for
the folder and file isn't enough. You need to change the owner ship of the
file as well so that u have privilege to delete.

Do this , this might work:
//Change the owner ship of the file to a non existent user in the system
chown($directory."/".$file,666);
unlink($directory."/".$file);

Thanks,
V


Re: [PHP] Data trasfer between PHP pages

2009-01-12 Thread VamVan
If the 2 forms exist on the same server. Use Sessions. thats would solve lot
of problems managing hidden fields and everything.

Thanks,
V


Re: [PHP] Php and CSS where to put it

2009-01-12 Thread VamVan
-- 

 should be
placed in between 

Thanks,
V


Re: [PHP] Editing in a text area field

2009-01-09 Thread VamVan
Rule #1.
Never, ever, ever, alter the user's input, EXCEPT for sanitizing/filtering.
Specifically, do NOT add  tags in place of newlines.
Store the newlines.


100% I agree. Thats called the act of defensive programming. We have no
right over altering user input but yes we have right to display what we want
user see on the site.


Thanks,
V


Re: [PHP] Couple of beginner questions

2009-01-09 Thread VamVan
Hey Gary,

I've done a number of sites in html and am now venturing into php.

Can I create a page in html and insert php code that will work? (for
example, take an existing page and insert a date command)

--- Of course you can do that. But it is not advised. Becoming better in PHP
in few months you will understand that its almost necessary to separate
business logic from presentation logic. But as a beginner you can do that.
So basically have  tags around the php code that you write. better
to rename your files to .php extension.

Can I create a page with the php extension that contains only contains html
and no php?  If so are there advantages/disadvantages?

-- Yes you can do that but if you have  it better to wrap your html
in quotes and also escape them and print it on the screen using echo command
or print command. echo is better though. or else if you dont want to open
 tags then you can have plain html without any hassle.

-- Remember as you re still a beginner try to avoid using ?> at the end of
complete PHP code page. or else if you have empty lines at the end of the
file "then you wont see blank page of death in PHP".

Can I mix and match file formats (php/html) in a single site?

-- Every wesbite in this world not only in PHP or anywhere is a combination
of html (presenation layer) and PHP (Logic). So the asnwer is yes.

Thanks,
V


Re: [PHP] Re: redoing website after 7 years

2009-01-08 Thread VamVan
Yeah right. Don't use this solution no matter what if you have database
connections , sessions or anything !!!

Anyways I meant intelligent replace. :)

Thanks,
V

On Thu, Jan 8, 2009 at 8:17 PM, Chris  wrote:

>
>  I know many people will grin at me for this solution but may be faster way
>> to overcome this problem to do a find for $ and replace with $_REQUEST.
>> even
>> this will help you if you dealt with $_POST, $_GET, $_COOKIE.
>>
>
> Please don't.
>
> $connection = mysql_connect(...)
>
> becomes
>
> $_REQUEST[$connection] (or something)
>
>
>  Anyways avoid this solution if you can completely. Its mandatory to script
>> your code with reg globals off.
>>
>
> It is now, 7 yrs ago was php4.2 (or so) when it was only just changed to
> being off by default.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
>


Re: [PHP] Re: redoing website after 7 years

2009-01-08 Thread VamVan
On Thu, Jan 8, 2009 at 9:50 AM, Al  wrote:

>
>
> Lamp Lists wrote:
>
>> hi guys,
>> I did php/mysql based website for one my client 7 years ago, in time when
>> register_globals was on by default.
>> hosting company upgraded server to php5/mysql5 and turned globals off. the
>> site is doesn't work any more.
>> I can define globals on again in .htaccess but rather not because it could
>> be a big risk.
>> to work again I have to spend a lot of hours to modify the code. boring
>> job. but, I'm more concern does client has to pay the changes/upgrade or
>> it's still "my obligation"?
>> anybody had similar experience?
>>
>> thanks for any help.
>>
>> ll
>>
>>
>>
>>
>>
>>
>
> What's the magnitude of the problem?  Are there a handful of files that
> need fixing or hundreds?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


I know many people will grin at me for this solution but may be faster way
to overcome this problem to do a find for $ and replace with $_REQUEST. even
this will help you if you dealt with $_POST, $_GET, $_COOKIE.

Anyways avoid this solution if you can completely. Its mandatory to script
your code with reg globals off.

Thanks,
V


Re: [PHP] Re: Cannot Install mysql extension

2009-01-08 Thread VamVan
Sorry I apologize that I didn't follow the thread after I replied. Anyways I
am glad it works for you.

Thanks,
V

On Thu, Jan 8, 2009 at 1:12 PM, Gary  wrote:

> Ok... I dont know if Im officially in love, but Im close...the Xampp worked
> first time, all my hair still in place and on head...thanks to everyone for
> all the help!
>
> Gary
> "Nathan Rixham"  wrote in message
> news:49666231.9050...@gmail.com...
> > Gary wrote:
> >> I like it...thanks for the suggestion It gives me 3 choices, the
> >> installer, the zip and the exe.  The zip is 82 megs, the largest, is
> that
> >> the better choice?
> >>
> >> Thanks again for your help.
> >>
> >> Gary
> >>
> >
> > keep it simple for yourself and go with the installer
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Re: Cannot Install mysql extension

2009-01-08 Thread VamVan
On Thu, Jan 8, 2009 at 11:56 AM, Gary  wrote:

> Nathan
>
> Thanks for all your help, but it is not working.  The files were/are named
> php_mysql.dllso I replace them.
>
> I did the advanced install, choosing only those extensions I wanted,
> including mywsql and mysqli
>
> I have already reinstalled the php5.2.8
>
> Again, thanks, but Im getting frustrated at spending all day on this...
> "Nathan Rixham"  wrote in message
> news:49665748.3070...@gmail.com...
> > Gary wrote:
> >> Thanks much, but I do not have a line that says extension=php_mysql.dll
> >> What I do have is a line that says extension=mysql.dll
> >> Should I add the php_?
> >>
> >> Thanks again
> >>
> >> Gary
> >>
> > check in the php/ext/ directory, if you have a dll called mysql.dll then
> > you're fine, if it's php_mysql.dll then change the file accordingly
> >
> > TBH I'd recommend removing you're install, getting the MSI installer and
> > then doing an advanced install; you'll then have the option of choosing
> > which extensions you want installed/enabled and which you do not.
> >
> > regards
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


Install XAMPP for Windows so that you can forget about custom configurations
and any pain associated with it.

With that you will get Apache, PHP and Mysql (some more apps as well)

http://www.apachefriends.org/en/xampp-windows.html#641

Thanks
V


Re: [PHP] Since I speak with some of you more than people I see in person....

2008-12-30 Thread VamVan
On Tue, Dec 30, 2008 at 2:22 PM, tedd  wrote:

> At 4:32 PM -0500 12/30/08, Daniel Brown wrote:
>
>>To hell with being on-topic, since this list is generally never
>> on-topic for an entire thread anyway.
>>
>>This has been a roller-coaster year for some of us --- certainly
>> myself included --- but the year has come to a close.  I want to take
>> a moment to wish each and every one of you a safe and wonderful new
>> year.  May 2009 be ten times healthier, happier, and more prosperous
>> to you and yours than the three best years of your life so far, and
>> may each year beyond that be better even than the one before.
>>
>>And as a side note (some of you already know): for my wife and I
>> closing out the year, we heard the heartbeat of our first child for
>> the first time today in the ultrasound.  Nothing else will ever again
>> matter as much to me as what I am about to embark upon.  I don't think
>> any song or sound I've ever heard in my entire life was as beautiful
>> as those few seconds.  My heart literally feels so full that it could
>> burst at any moment.
>>
>>To all of you, thank you for being a part of the PHP project, and
>> many of you professional and personal parts of my life.  Of all of the
>> communities I've been involved in the last sixteen years or so, this
>> has always been my favorite.  And it's because of you folks.
>>
>>From the bottom of my (bursting!) heart, thank you, and I look
>> forward to working alongside all of you in 2009.
>>
>>All the best
>>
>> --
>> 
>>
>
> Ahhh, you made me all teary-eyed.
>
> Best wishes to you and yours -- I am sure the best is yet to come.
>
> Cheers,
>
> tedd
>
> --
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Wish you a very happy new year guys !!! Have fun and lets do more PHPing :)

Thanks,
V


Re: [PHP] Phpmyadmin password

2008-12-18 Thread VamVan
Yeah true thanks for pointing out. Thats what I meant !!! :)

Blowfish (http://en.wikipedia.org/wiki/Blowfish_(cipher))

On Thu, Dec 18, 2008 at 6:11 AM, Jochem Maas  wrote:

> VamVan schreef:
> ..
>
> May be u can do a bowl
> > fish encryption
>
> ...
>
> > Thanks,
> > V
>
> LOL. 'bowl fish' ... 'fish bowl' ... I guess you meant to write 'blow' :-)
>


Re: [PHP] Phpmyadmin password

2008-12-17 Thread VamVan
Yeah I felt the same. It should be config.inc.php. Well I dont think its in
clear text though (alteast in the latest version). May be u can do a bowl
fish encryption of your new custom password and reset it in the file.

Thanks,
V

On Wed, Dec 17, 2008 at 9:01 AM, Jim Lucas  wrote:

> Micah Gersten wrote:
> > It flance wrote:
> >> Hi,
> >>
> >> I lost phpmyadmin password. Is there anyway to recover it?
> >>
> >> Thank you
> >>
> >>
> >
> > PHPMyAdmin uses MySQL's internal authentication.  Log into your MySQL
> > server and reset your password.
> >
> > http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
> >
> > Thank you,
> > Micah Gersten
> > onShore Networks
> > Internal Developer
> > http://www.onshore.com
> >
> >
> >
>
> That is the case, but only if the op is using http auth
>
> if they are using config or cookie based, then it might/should be stored in
> the config.inc.php file.
>
> --
> Jim Lucas
>
>   "Some men are born to greatness, some achieve greatness,
>   and some have greatness thrust upon them."
>
> Twelfth Night, Act II, Scene V
>by William Shakespeare
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Re: header modify errors

2008-12-15 Thread VamVan
Hey,

Few things:

1) Check to see if you have any trailing spaces after the end of the file.
2) Check to see if your session_start() is not the first line of the code.


Thanks,
V

On Mon, Dec 15, 2008 at 9:36 AM, Terion Miller wrote:

> On Mon, Dec 15, 2008 at 11:29 AM, Jay Moore  wrote:
>
> > Terion Miller wrote:
> >
> >> I am working from home today and getting this error with my copy of my
> >> project:
> >> *Warning*: Cannot modify header information - headers already sent by
> >> (output started at
> >> C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\Welcome.php:31)
> >> in *C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\inc\dbconn_openTest.php*
> on
> >> line *3*
> >>
> >> *Warning*: Cannot modify header information - headers already sent by
> >> (output started at
> >> C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\Welcome.php:31)
> >> in *C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\inc\dbconn_openTest.php*
> on
> >> line *4*
> >> Could not connect to the database.
> >>
> >> I have set my php.ini file output_buffering to ON it was off (read in a
> >> past
> >> post that will fix this error--but it did not)
> >> I also set session.cache_limiter =  to nothing it was set to nocache
> >>
> >> Any other things I'm missing?
> >> Thanks
> >> Terion
> >>
> >>
> > What's on/around line 31 in Welcome.php?
> >
> > J
>
> Line 32-36 are:
> If (!empty($msg)){
>echo "". $msg ."";
>}
> ?>
>
>
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>


[PHP] Dates and Mysql

2008-12-10 Thread VamVan
Hello Gang,

I have a Mysql table which has timestamp for the date the record was
created.

I was wondering how is it possible for me to query the table to retrieve all
the records that are one week less than the time stamp?

Thanks,
V


Re: [PHP] Parsing Strings

2008-12-06 Thread VamVan
u can use split() or explode ().

Thanks

On Sat, Dec 6, 2008 at 9:27 AM, tedd <[EMAIL PROTECTED]> wrote:

> At 4:18 PM -0800 12/5/08, Jason Todd Slack-Moehrle wrote:
>
>> How might I also parse and address like: SCOTTSDALE, AZ 85254
>>
>> It has a comma and a space
>>
>> -Jason
>>
>> On Dec 5, 2008, at 4:02 PM, Jason Todd Slack-Moehrle wrote:
>>
>>  OK, making good learning progress today.
>>>
>>> I have a string that is: Jason Slack
>>>
>>> and I want it broken at the space so i get Jason and then Slack
>>>
>>> I am looking at parse_str, but I dont get how to do it with a space. The
>>> example is using []=.
>>>
>>> Then I want to assign like:
>>>
>>> $fname = "Jason";
>>> $lname = "Slack";
>>>
>>> Any ideas?
>>>
>>> -Jason
>>>
>>
> -Jason:
>
> This is pretty basic stuff -- read the manuals about strings:
>
> http://www.php.net/manual/en/book.strings.php
>
> If you have shown that you've spent time reading and then have a problem,
> please post your question. But don't expect us to do your homework for you.
>
> Cheers,
>
> tedd
>
> --
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Job opportunity in Denver, CO - Jr. PHP developer needed

2008-12-05 Thread VamVan
telecommute??

On Fri, Dec 5, 2008 at 9:43 PM, Kevin Waterson <[EMAIL PROTECTED]> wrote:

> This one time, at band camp, Nick Gasparro <[EMAIL PROTECTED]> wrote:
>
> > The perfect candidate will possess the following skills:
> > * Serious OO design background
> > * PHP5 (this will be your primary language, though you can learn it
> on the job )
> > * Strong database design skills (MySql experience preferred)
> > * Love of open source development and standards-based development
> > * Expert understanding of JavaScript, XHTML, and the DOM
> > * Strong communication skills and able to multi-task and project
> manage well --
>
> Hmm, all of this, I thought you wanted a Junior developer...
>
> Kevin
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


[PHP] Objects and Arrays Conversion

2008-12-02 Thread VamVan
Hello All,

I was stuck with this issue. So just felt the need to reach out to other
strugglers.
May be people might enjoy this:

Here is the code for object to array and array to object conversion:

function object_2_array($data)
{
if(is_array($data) || is_object($data))
{
$result = array();
foreach ($data as $key => $value)
{
$result[$key] = object_2_array($value);
}
return $result;
}
return $data;
}

function array_2_object($array) {
 $object = new stdClass();
 if (is_array($array) && count($array) > 0) {
foreach ($array as $name=>$value) {
   $name = strtolower(trim($name));
   if (!empty($name)) {
  $object->$name = $value;
   }
}
 }
 return $object;
}

have fun !

Thanks


[PHP] category and sub category traversal

2008-12-01 Thread VamVan
Hello,

I need some help in figuring out this logic.

I have two tables one for category and other for category_hierarchy.
category_hirerarchy has a column to determine the parent.

So the query I have to retrieve tree of one specific category is:

SELECT t.tid, t.*, parent FROM term_data t INNER JOIN term_hierarchy h ON
t.tid = h.tid WHERE t.vid = 16 ORDER BY weight, name;

The ones with parent = 0 is the top category

Now I need to prepare an associative array with parent child relation.

So bascially I need to retrieve [parentID] => array('childID', 'chidName')

Can anyone shed some light on the logic involved in preparation of this
array with out using multiple sql queries?

Thanks


Re: [PHP] Regex validation

2008-10-28 Thread VamVan
SSO process:

$_POST the Email Address and password

Get Authenticated, Get the COOKIE ( Through Oracle IDM suite SOAP call)

Decrypt the COOKIE ( Through Oracle Enterprise business suite SOAP call)

and get the profile Info

Thats what happens now.

But there is a glitch in the decryption algorithm we currently have. And
when we decrypt + or some thing else comes with funny characters and does
not authenticate.

So I need to restrict them for now. When the algorithm gets corrected then I
will use standard RFC.




On Tue, Oct 28, 2008 at 5:41 PM, Micah Gersten <[EMAIL PROTECTED]> wrote:

> What are you talking about with a cookie and an E-Mail address?
>
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
>
>
>
> VamVan wrote:
> > Yeah, I understand that its allowed in RFC. But unfortunately I use
> > SSO layer which decrypts the Cookie to get email address.
> >
> > This is where it messes up. So I have decided not to allow people to
> > use that as well.
> >
> > Thanks
> >
> >
>


Re: [PHP] Regex validation

2008-10-28 Thread VamVan
Yeah, I understand that its allowed in RFC. But unfortunately I use SSO
layer which decrypts the Cookie to get email address.

This is where it messes up. So I have decided not to allow people to use
that as well.

Thanks

On Tue, Oct 28, 2008 at 5:10 PM, Ashley Sheridan
<[EMAIL PROTECTED]>wrote:

> On Tue, 2008-10-28 at 18:07 -0500, Micah Gersten wrote:
> > Keep in mind that ereg will disappear with PHP 6.  You might want to use
> > the preg functions:
> > http://www.making-the-web.com/2007/09/21/becoming-php-6-compatible/
> >
> > Thank you,
> > Micah Gersten
> > onShore Networks
> > Internal Developer
> > http://www.onshore.com
> >
> >
> >
> > VamVan wrote:
> > > Thank Guys,
> > >
> > > I at least got part of it working , not the double words but almost
> > > everything else than that:
> > >
> > > function _email_validate($mail_address){
> > >   $invalid_charset_pattern = "[(*+?)|~<>:;{}/ ]";
> > >   if(ereg($invalid_charset_pattern, $mail_address)){
> > > return false;
> > >   }else{
> > > return true;
> > >   }
> > > }
> > >
> > > Thanks for the inputs
> > >
> > > On Tue, Oct 28, 2008 at 3:31 PM, Nitsan Bin-Nun <[EMAIL PROTECTED]
> > > <mailto:[EMAIL PROTECTED]>> wrote:
> > >
> > > Good to know filter_var() exists in PHP5
> > >
> > > Unless you have PHP5 you better validate the string in the way of
> > > checking
> > > if it is fit's to your allowed characters and not checking if it
> > > contains
> > > the NOT allowed charaters.
> > >
> > > You better use: [a-z0-9A-Z\_\.]+ instead of
> > > [^\)\(\*\&[EMAIL PROTECTED] and I
> > > haven't started yet with the weirdy ones
> > >
> > > HTH,
> > > Nitsan
> > >
> > > On Wed, Oct 29, 2008 at 12:10 AM, Yeti <[EMAIL PROTECTED]
> > > <mailto:[EMAIL PROTECTED]>> wrote:
> > >
> > > > > If your trying to filter E-Mail addresses, then filter_var is
> > > what you
> > > > > should use:
> > > > >
> > > > > http://php.net/filter_var
> > > >
> > > > If the OP (original poster) got PHP5+
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> > >
> > >
> >
> Also, according to the official spec, +, < and > are all valid email
> address characters.
>
>
> Ash
> www.ashleysheridan.co.uk
>
>


Re: [PHP] Regex validation

2008-10-28 Thread VamVan
Thank Guys,

I at least got part of it working , not the double words but almost
everything else than that:

function _email_validate($mail_address){
  $invalid_charset_pattern = "[(*+?)|~<>:;{}/ ]";
  if(ereg($invalid_charset_pattern, $mail_address)){
return false;
  }else{
return true;
  }
}

Thanks for the inputs

On Tue, Oct 28, 2008 at 3:31 PM, Nitsan Bin-Nun <[EMAIL PROTECTED]> wrote:

> Good to know filter_var() exists in PHP5
>
> Unless you have PHP5 you better validate the string in the way of checking
> if it is fit's to your allowed characters and not checking if it contains
> the NOT allowed charaters.
>
> You better use: [a-z0-9A-Z\_\.]+ instead of [^\)\(\*\&[EMAIL PROTECTED] and
> I
> haven't started yet with the weirdy ones
>
> HTH,
> Nitsan
>
> On Wed, Oct 29, 2008 at 12:10 AM, Yeti <[EMAIL PROTECTED]> wrote:
>
> > > If your trying to filter E-Mail addresses, then filter_var is what you
> > > should use:
> > >
> > > http://php.net/filter_var
> >
> > If the OP (original poster) got PHP5+
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>


[PHP] Regex validation

2008-10-28 Thread VamVan
Hello Team of Nerds,

I need help in writing a regular expression for this:

invalid character set is:

INVALID_STRING={"/","*","+","(",")","'\'","<",">",",",":",";","~","..",".@","@."};

I want to a pregmatch for these characters on my whole email address and if
match is found I need to return false.

Thank you


Re: [PHP] PHP Dev Facts

2008-10-17 Thread VamVan
On Thu, Oct 16, 2008 at 4:14 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote:

> Evening All,
>
> I'd be /really/ interested to know who uses what!
>
> *Procedural or OOP?*

OOP

>
>
> *Dev OS*

Centos , some time XAMPP n

>
>
> *Dev PHP Version*

5.2.6

>
>
> *Live Server OS*

Centos

>
>
> *Live Server PHP Version*

5.2.6

>
>
> *Which HTTP Server Software (+version)?*

Apache 2.0.2

>
>
> *IDE / Dev Environment*

Zend Studio

>
>
> *Preferred Framework(s)?*

Cake

>
>
> *Do you Unit Test?*

Yes most my apps. I use simpletest

>
>
> *Most Used Internal PHP Class*

Simplexml

>
>
> *Preferred OS CMS*

Drupal

>
>
> *Anything else you use frequently in you're PHP'ing that's worth
> mentioning:*
>
> ps: I'm not asking for any kind of research project, just interested and
> interested to know what's most common + might learn something/find some new
> tools/toys!
>
> pps: will reply myself as well but if I do here it'll make your intertwined
> replies messy!
>
> Many Regards
>
> Nathan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Wanted PHP Developers LogicManse

2008-09-30 Thread VamVan
Job Description is awesome though. My first instinct was to jump in to it
right away. But there are some red flags as their website looks too
immature. Hard to believe !!!

On Tue, Sep 30, 2008 at 9:47 AM, Jason Pruim <[EMAIL PROTECTED]> wrote:

>
> On Sep 30, 2008, at 12:31 PM, Jim Lucas wrote:
>
>  Wolf wrote:
>>
>>>  Nathan Rixham <[EMAIL PROTECTED]> wrote:
>>>
 Jim Lucas wrote:

> Nathan Rixham wrote:
>
>> Jim Lucas wrote:
>>
>>> Nathan Rixham wrote:
>>>
 Richard Heyes wrote:

> Thanks for quoting the whole message then!  :P
>>
> Maybe he just wanted to make sure you got it...
>
 
>>>
>>> I just wish you guys would stop giving them ideas!  And then copying it
>>> back on the list and explaining...  Sheesh!  :-P
>>>
>>> Is it 5 yet?
>>>
>>>
>> Good thing is, afaik, they haven't got that developer yet that can do it..
>> :)
>>
>
> *Lightbulb*... I could make money grabbing everyones email addy's and
> selling/spamming them... ;)
>
>
>
> --
>
> Jason Pruim
> Raoset Inc.
> Technology Manager
> MQC Specialist
> 11287 James St
> Holland, MI 49424
> www.raoset.com
> [EMAIL PROTECTED]
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Wierd Variable Initialization

2008-09-25 Thread VamVan
Interesting. Thank you

On Thu, Sep 25, 2008 at 2:01 AM, Ford, Mike <[EMAIL PROTECTED]> wrote:

> On 25 September 2008 03:45, VamVan advised:
>
> > So guys,
> >
> > I found some thing strange that happened to me yesterday. Its small
> but
> > kinda freaked me out.
> >
> > So I have a tokenmap.php that I include include in different
> configuration
> > files. Some are classes and some are simple php files.
> >
> > So in my tokenmap.php I have declared an array as global.
> >
> > SO $GLOBAL['tokenmap'] = array()
> >
> > As a good programming practice what I did was:
> >
> > require_once('tokenmap.php');
> > $tokenmap = array();
> > $tokenmap = $GLOBAL['tokenmap'];
> > print_r($tokenmap);
> >
> > The above displays empty array
> >
> > But when I do this , it works
> >
> > require_once('tokenmap.php');
> > $tokenmap = $GLOBAL['tokenmap'];
> > print_r($tokenmap);
> >
> > Its kind of wierd for me. I am trying to understand. Can some one shed
> > some light on it for me.
>
> Well, $GLOBALS['tokenmap'] is *exactly* *the* *same* *thing* as
> $tokenmap when you're in the global scope (which I assume you are for
> what you describe here to make sense).  So the assignment:
>
>   $tokenmap = array();
>
> is the same as:
>
>   $GLOBALS['tokenmap'] = array();
>
> And the assignment:
>
>   $tokenmap = $GLOBALS['tokenmap'];
>
> is essentially useless as it's the same as:
>
>   $tokenmap = $tokenmap;
>
> ... or:
>
>   $GLOBALS['tokenmap'] = $tokenmap;
>
> ... or even:
>
>   $GLOBALS['tokenmap'] = $GLOBALS['tokenmap'];
>
> Cheers!
>
> Mike
>
>  --
> Mike Ford,  Electronic Information Developer,
> C507, Leeds Metropolitan University, Civic Quarter Campus,
> Woodhouse Lane, LEEDS,  LS1 3HE,  United Kingdom
> Email: [EMAIL PROTECTED]
> Tel: +44 113 812 4730
>
>
>
>
> To view the terms under which this email is distributed, please go to
> http://disclaimer.leedsmet.ac.uk/email.htm
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


[PHP] Wierd Variable Initialization

2008-09-24 Thread VamVan
So guys,

I found some thing strange that happened to me yesterday. Its small but
kinda freaked me out.

So I have a tokenmap.php that I include include in different configuration
files. Some are classes and some are simple php files.

So in my tokenmap.php I have declared an array as global.

SO $GLOBAL['tokenmap'] = array()

As a good programming practice what I did was:

require_once('tokenmap.php');
$tokenmap = array();
$tokenmap = $GLOBAL['tokenmap'];
print_r($tokenmap);

The above displays empty array

But when I do this , it works

require_once('tokenmap.php');
$tokenmap = $GLOBAL['tokenmap'];
print_r($tokenmap);

Its kind of wierd for me. I am trying to understand. Can some one shed some
light on it for me.

Thanks


[PHP] Scope of the variables around PHP class

2008-09-22 Thread VamVan
Hello Guys,

I have a problem here. I hope you can help me resolving it.

Please see the code below

array.php has $array1 = ('hello'=>'heelo',)

require_once('array.php');

class Classa {

}

How can I access the array values in my class? I want to understand the
scope.

Thanks


[PHP] Regex for email validation

2008-08-27 Thread VamVan
Hello Guys,

Does any have a regex for email validation? I need to allow only period and
underscore in the local part , we would need a @ and .com or watever for
domain.

thank you


Re: [PHP] PHP IDE needed

2008-08-27 Thread VamVan
use Aptana its awesome and free as well.

thanks



On Tue, Aug 26, 2008 at 8:29 PM, Micah Gersten <[EMAIL PROTECTED]> wrote:

> How much RAM do you have?  Eclipse is a great IDE.  Have you upgraded to
> 3.4?
>
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
>
>
>
> Sascha Braun wrote:
> > Hi people,
> >
> > I have a webproject which is round about 3 GB in size. I was usually
> > using eclipse to work with the software but over time eclipse became
> > very instable regarding that project.
> >
> > As soon as I open classes with 2000 or more lines of code in it, an out
> > of memory error occours.
> >
> > So I need a new IDE for linux.
> >
> > Please tell me which IDE might be a true alternative for projects at
> > that size.
> >
> > Thank you friends,
> >
> > kind regards,
> >
> > Sascha
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


[PHP] render html

2008-08-25 Thread VamVan
hello,

i have html tags in the bod of text like:

$body = "helloierhellohello";

print $body;

Some how it does not render html properly in a html page , what might be
going wrong?   still get displayed as  instead of line breaks.

How can I render my HTML properly. Please note that it happens in  my cms.

Thanks


Re: [PHP] SESSION problem

2008-08-15 Thread VamVan
Tedd,

I think according to PHP manual. Session_start() must be the first line in
the code. Dont worry it will remember your session until you close the
browser and also it wont duplicate it.

Thanks

On Fri, Aug 15, 2008 at 4:39 PM, tedd <[EMAIL PROTECTED]> wrote:

> At 1:47 PM -0500 8/15/08, Boyd, Todd M. wrote:
>
>> Have you tried:
>>
>>echo SID;
>>
>> ...? I'm wondering if you're going to get different values on the two
>> pages. What that means beyond two different sessions is beyond me, but
>> it's a start.
>>
>>
>> Todd Boyd
>> Web Programmer
>>
>
> Todd:
>
> I added code to show the SID and it's the same, but still nothing happens.
>
> http://www.webbytedd.com/b2/session-test/index.php
>
> I know what the problem is, but don't know how to fix it.
>
> If you will look at the code, I am using a variable within the SESSION
> declaration:
>
> $_SESSION[$i] = $i;
>
> If I comment that out, the $_SESSION['test'] will be passed.
>
> Thanks,
>
> tedd
>
> --
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] If Column Exists

2008-08-13 Thread VamVan
Interesting. Thanks guys!!

On Wed, Aug 13, 2008 at 1:32 AM, Robin Vickery <[EMAIL PROTECTED]> wrote:

> 2008/8/12 VamVan <[EMAIL PROTECTED]>:
> > Hello,
> >
> > I am working on data migration for one mysql db to another using PHP. How
> do
> > I check if a particular table has a particular column. If not alter...
> >
> > Thanks
> >
>
> Use the information_schema:
>
> SELECT COUNT(*) AS column_exists FROM information_schema.COLUMNS WHERE
> TABLE_SCHEMA='db_name' AND TABLE_NAME='table_name' AND
> COLUMN_NAME='column_name';
>
> -robin
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


[PHP] If Column Exists

2008-08-12 Thread VamVan
Hello,

I am working on data migration for one mysql db to another using PHP. How do
I check if a particular table has a particular column. If not alter...

Thanks


Re: [PHP] Why PHP4?

2008-07-29 Thread VamVan
I agree but not everyone think in the sameway. I have seen several big
websites that got hit because they haven't used super globals in the code
and their hosting provided would just change the PHP.ini setting and nothing
would work.

GET, POST , SESSION, REQUEST everything was all dealt as just variable.

On Tue, Jul 29, 2008 at 7:36 PM, mike <[EMAIL PROTECTED]> wrote:

> I started using superglobals since 4.x; not even thinking about it from a
> security angle per se, but because it just makes sense to know the source of
> where your input data is coming from. I guess technically security is a
> byproduct of that thinking too.
>
>
>
>
> On Jul 29, 2008, at 7:31 PM, VamVan <[EMAIL PROTECTED]> wrote:
>
>  Its because PHP got really famous with version 4.0 and many people
>> actually converted their CGI or other websites in to PHP 4 websites because
>> it was easy and cheap. But 5.0 brought too many changes like serious OOPS
>> and register global concepts for security, which is useful but made
>> transition difficult. I feel thats why PHP 4 is still supported.
>>
>> Its not only the language that has changed, but also people had to upgrade
>> their skill set and there was some learning curve involved.
>>
>> Unfortunately everyone fell in the trap of register globals which was not
>> dealt until php 4.3.1 as a security concept. Pear and Pecl were there but
>> everyone was pretty much writing all the code (reinventing the wheel) from
>> scratch. This brings in huge code base to change.
>>
>> I liked PHP because intitially it was a procedural langauge and it
>> resembled C. But now with OOPS you can build powerful websites which is
>> good.
>>
>> There are many other  cases but I feel strongly this is what makes them
>> still support PHP 4.
>>
>> Thanks
>>
>


Re: [PHP] Why PHP4?

2008-07-29 Thread VamVan
Its because PHP got really famous with version 4.0 and many people actually
converted their CGI or other websites in to PHP 4 websites because it was
easy and cheap. But 5.0 brought too many changes like serious OOPS and
register global concepts for security, which is useful but made transition
difficult. I feel thats why PHP 4 is still supported.

Its not only the language that has changed, but also people had to upgrade
their skill set and there was some learning curve involved.

Unfortunately everyone fell in the trap of register globals which was not
dealt until php 4.3.1 as a security concept. Pear and Pecl were there but
everyone was pretty much writing all the code (reinventing the wheel) from
scratch. This brings in huge code base to change.

I liked PHP because intitially it was a procedural langauge and it resembled
C. But now with OOPS you can build powerful websites which is good.

There are many other  cases but I feel strongly this is what makes them
still support PHP 4.

Thanks


Re: [PHP] Programming With Revision History

2008-07-29 Thread VamVan
Hello,

Think in this way:

You would be needing two tables:

first one:

content table:

contentID, contentType, revisionID --- contentID is the PK ( you can
make the UI for adding and deleting these fields)

content_revisions table

revisionID, contentID, -- revisionID is the PK

Great things start from simple thinking. You can use this model to implement
revisions. In some PHP CMS we currently have they also use serialized data
fields for each revision.

--- Thanks


Re: [PHP] After INSERT form submit - Data doesn't refresh!

2008-07-23 Thread VamVan
Hello,

I understand what you are trying to do. But as a web developer it is never a
good practice to have a insert query and page to display the record in the
same page. This way you will never add the redundant data whenever the page
is refreshed.

So from my experience I would suggest you do this:

form.php

if(isset($_GET['displayrecords']) && $_GET['displayrecords'] == "true") {
show records
}else{

HTML FORM
submit
}

qry_form.php

{INSERT QUERY}

//redirect
header('location:form.php?displayrecords=true')

this intermediate step qry_form.php will insert the record and redirect to
the same page with a get variable.

This is a good practice to avoid inserting everytime you refresh the page.

Thanks




On Tue, Jul 22, 2008 at 8:12 AM, Daniel Brown <[EMAIL PROTECTED]> wrote:

> On Tue, Jul 22, 2008 at 10:51 AM, Rahul S. Johari
> <[EMAIL PROTECTED]> wrote:
> >
> > I just checked a couple of other browsers (IE, Safari, Opera) and it
> seems
> > to be working fine in all the browsers except Firefox 3. I think this
> issue
> > is now out of bounds for PHP - I don't think there is anything wrong in
> the
> > script or the way I'm doing this - I think the problem is lying somewhere
> in
> > either Firefox 3 or my settings of Firefox 3. Let me look into this.
>
> If you believe that to be the case, Rahul, please report your
> findings at [EMAIL PROTECTED]  We (I'm a Mozilla
> developer as well) may then ask you to post portions of your
> 'about:config' to better troubleshoot the issues.
>
> --
> 
> Better prices on dedicated servers:
> Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
> Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
> Dedicated servers, VPS, and hosting from $2.50/mo.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Questions about finding ranges

2008-07-23 Thread VamVan
Hey,

For ranges you can also use "Between" in the mysql queries.

SELECT * FROM table WHERE Type= "Attainable" AND Min LIKE $var can be
written as

Select * from table where between min and max

Just remember that "between" acts a bit wierd with dates or else Jim's
solution would be perfect for you.

Thanks



On Wed, Jul 23, 2008 at 7:58 AM, Jim Lucas <[EMAIL PROTECTED]> wrote:

> Aslan wrote:
>
>> Hey there,
>>
>> I have a range of records that represent different faults and different
>> symptoms that I want to pull out of the database, and to find the records
>> that are the closest within each range.
>>
>> I am currently doing it with a barrage of if statements, but I am sure
>> that this could be done faster and far more elegantly by using SQL
>>
>> I have a range of conditions eg
>> Attainable rates:
>> 0-500 KB/sec is very poor
>> 500 - 1000 is marginal
>> 1000- 3000 KB/sec is good
>>
>> So the database may look like:
>> Type|Min|Max|Value
>> Attainable|0|500|" This rate is very poor"
>>
>> and then SQL could go something like
>>
>> SELECT * FROM table WHERE Type= "Attainable" AND Min LIKE $var
>>
>>
> You're close, try this
>
> SELECT   *
> FROM table
> WHEREType = "Attainable"
>  ANDMin <= $var
>  ANDMax >= $var
>
>
> as long as your min and max do not overlap from row to row, you should only
> get one result.  Make sure in your data that you have no overlap.
>
> Row 1 =0 -  499
> Row 2 =  500 -  999
> Row 3 = 1000 - 1499
>
>
>> But that wouldn't work quite right I don't think.
>>
>> But where it can get a bit more hairy is that I want to have a whole range
>> of variables that are input from an entry table, and then it just finds the
>> the vars that are the closest to what is searching for all the vars. The
>> closest code I have seen doing something similar is where there it is
>> finding if an IP is in a certain range.
>>
>> Does that make sense? feel free to email me if you need more explanation.
>>
>> It is kind of like a multi variable search engine, that is finding the
>> root cause of the symptoms that are the very best fit given the
>> multi-variables...
>>
>> Thanks heaps for any assistance,
>> Aslan.
>>
>>
>>
>
> --
> Jim Lucas
>
>   "Some men are born to greatness, some achieve greatness,
>   and some have greatness thrust upon them."
>
> Twelfth Night, Act II, Scene V
>by William Shakespeare
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Soap Call Error

2008-07-17 Thread VamVan
I tried that this is what i get


Response:HTTP/1.1 200 OK
Date: Thu, 17 Jul 2008 18:27:23 GMT
Server: Apache/2.2.6 (Unix)
Set-Cookie: JSESSIONID=DF4D15B8D0A0610B4832C3A708874672; Path=/
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: multipart/related; type="application/xop+xml"; start="<
[EMAIL PROTECTED]>"; start-info="text/xml";
boundary="=_Part_281_1620393832.1216319243198"

--=_Part_281_1620393832.1216319243198
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: 8bit
Content-ID: <[EMAIL PROTECTED]>

<--=_Part_281_1620393832.1216319243198--
Request:POST /rpc/soap/ForumService HTTP/1.1
Host: 
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.2.0
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 850soap:Envelope xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="
http://www.w3.org/2001/XMLSchema"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance";>http://jivesoftware.com/webservices";>http://jivesoftware.com/webservices";>http://webservices.community.jivesoftware.com";>xxhttp://webservices.community.jivesoftware.com";>xhttp://webservices.community.jivesoftware.com";>-07-17T11:27:23.078-07:00http://webservices.community.jivesoftware.com";>xhttp://webservices.community.jivesoftware.com";>1http://webservices.community.jivesoftware.com";>1http://webservices.community.jivesoftware.com";>2008-07-17T11:27:23.078-07:00http://webservices.community.jivesoftware.com";>new appliance
108http://webservices.community.jivesoftware.com";>0http://webservices.community.jivesoftware.com";>989430false0hello235215382008-07-17T11:27:23.078-07:00155479012008-07-17T11:27:23.078-07:000new
appliance
108hellonew
appliance
1081355582006-05-10T11:55:27.114-07:00asdadasdfalse2006-05-10T11:55:27.114-07:00
true




http://schemas.xmlsoap.org/soap/envelope/";
xmlns:ns1="http://jivesoftware.com/webservices"; xmlns:ns2="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
">
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
">
 
xxx
x
     
    
new
appliance
108hellox


I dont know what can I infer from this. I still get the same error.



On Wed, Jul 16, 2008 at 11:26 PM, Jason Norwood-Young <
[EMAIL PROTECTED]> wrote:

>
> On Wed, 2008-07-16 at 17:44 -0700, VamVan wrote:
> > Hello Guys,
> >
> > I have been getting a wierd soap exception lately
> >
> >
> > [faultstring] => looks like we got no XML document
> > [faultcode] => Client
> > [faultcodens] => http://schemas.xmlsoap.org/soap/envelope/
> >
> > What does that mean? The call gets properly called and it does what it
> needs
> > to do, but the response xml is always a $fault? Did anyone have this
> > problem? I am using php 5.2.6 for the info.
>
> This is usually a malformed XML document - I had the problem recently
> when fetching an XML document that wasn't complete (no ). Check
> what you're *actually* getting with something like:
>
> } catch(SoapFault $exception) {
>$request_xml = $client->__getLastRequestHeaders() .
> $client->__getLastRequest();
>$response_xml = $client->__getLastResponseHeaders() .
> $client->__getLastResponse();
>print "Response:".$response_xml;
>print "Request:".$request_xml;
>print $exception;
>}
>
>


[PHP] Soap Call Error

2008-07-16 Thread VamVan
Hello Guys,

I have been getting a wierd soap exception lately


[faultstring] => looks like we got no XML document
[faultcode] => Client
[faultcodens] => http://schemas.xmlsoap.org/soap/envelope/

What does that mean? The call gets properly called and it does what it needs
to do, but the response xml is always a $fault? Did anyone have this
problem? I am using php 5.2.6 for the info.

and below is my method...

private function createThread($userID, $applianceTitle,
$applianceDetails_link){
  // Define Client
  try {
 $client = new SoapClient($this->createThreadWSDL, array("trace" =>
1
 ));
  } catch(SoapFault $fault) {
  return "";
  }

 // Define Input array
 $params = array(
   'subject'=> $applianceTitle,
   'body' => $applianceDetails_link,
   'communityID' => $this->parentCommunityID,
   'userID' => $userID
 );

 //Make the Call
 try {
   $result = $client->__soapCall('createThread',
array('parameters'=>$params), NULL, $this->header);
   return $result;
 } catch (SoapFault $fault){
   return $fault;
 }
   }

Thanks


Re: [PHP] Question before I end up writing alot of extra code...

2008-07-08 Thread VamVan
sorry it needs to be a array for checkbox for the example below. So you
could use is_empty() instead. something like that.







On Tue, Jul 8, 2008 at 7:37 PM, VamVan <[EMAIL PROTECTED]> wrote:

> Hey,
>
> Dude you could use it this way
>
> 
> 
> 
>
> Once u submit it,
>
> do a small server side validation
>
> if(isset($_POST['something'] || $_POST['something']) != ""){
> insert...
> }
>
> This way you could avoid replacing the values with nulls.
>
> Thanks,
> Vam
>
>
> On Mon, Jul 7, 2008 at 12:25 PM, Jason Pruim <[EMAIL PROTECTED]> wrote:
>
>> Hi everyone!
>>
>> So it's been a nice long weekend, I come in to work and try and mess with
>> a project that I'm working on to get some new features added. All was going
>> well until I realized that now my application is breaking...
>>
>> Here's the details...
>>
>> PHP 5.2
>> MySQL 5.2
>>
>> I store the info in the database which is submitted from a HTML form..
>> Some of it text boxes, some check boxes, some radio buttons... I $_POST the
>> info from the form into the processing script.
>>
>> The problem I'm running into though, is when a value has not changed it
>> doesn't get $_POSTed back and my update script erases the info in the
>> database... I'm trying to avoid using $_GET since it can be quite a few
>> variables.
>>
>> Is there anyway I can do it without comparing the original field to what I
>> am displaying?
>>
>>
>> --
>>
>> Jason Pruim
>> Raoset Inc.
>> Technology Manager
>> MQC Specialist
>> 11287 James St
>> Holland, MI 49424
>> www.raoset.com
>> [EMAIL PROTECTED]
>>
>>
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>


Re: [PHP] Question before I end up writing alot of extra code...

2008-07-08 Thread VamVan
Hey,

Dude you could use it this way





Once u submit it,

do a small server side validation

if(isset($_POST['something'] || $_POST['something']) != ""){
insert...
}

This way you could avoid replacing the values with nulls.

Thanks,
Vam

On Mon, Jul 7, 2008 at 12:25 PM, Jason Pruim <[EMAIL PROTECTED]> wrote:

> Hi everyone!
>
> So it's been a nice long weekend, I come in to work and try and mess with a
> project that I'm working on to get some new features added. All was going
> well until I realized that now my application is breaking...
>
> Here's the details...
>
> PHP 5.2
> MySQL 5.2
>
> I store the info in the database which is submitted from a HTML form.. Some
> of it text boxes, some check boxes, some radio buttons... I $_POST the info
> from the form into the processing script.
>
> The problem I'm running into though, is when a value has not changed it
> doesn't get $_POSTed back and my update script erases the info in the
> database... I'm trying to avoid using $_GET since it can be quite a few
> variables.
>
> Is there anyway I can do it without comparing the original field to what I
> am displaying?
>
>
> --
>
> Jason Pruim
> Raoset Inc.
> Technology Manager
> MQC Specialist
> 11287 James St
> Holland, MI 49424
> www.raoset.com
> [EMAIL PROTECTED]
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


[PHP] Associative Arrays

2008-06-19 Thread VamVan
Hi,

How to create an associative array of this kind in PHP?

 return array(
12345 => array(
  'mail' => '[EMAIL PROTECTED]',
  'companyName' => 'Asdf Inc.',
),
54321 => array(
  'mail' => '[EMAIL PROTECTED]',
  'companyName' => 'Asdfu Corp.',
),
  );

Thanks


[PHP] Build and Deployment Process

2008-06-10 Thread VamVan
Hello All,

What is the best method to build and deploy php scripts along the different
environments? You can talk about rpm's and stuff

My specific scenario is

Step1:

Developer checks code in to perforce (repo)

Step 2:

Then I need to upgrade my integration instance.

Step 3:

Upgrade QA instance

Step 4:

Upgrade staging Server

Step 5:

Upgrade production machines

What would be the specific build mechanism that I can use for such kind of
environments? I also have db scripts that might alter schema.

Please provide me samples of any scripts that you might have written to
achieve this kid of structure. Any suggestions or scripts will be highly
appreciated.


[PHP] Caching and Optimization

2008-06-05 Thread VamVan
Hello All,

Today my question is about the all important topic "Web Optimization"

What kind of caching mechanisms can I use for Mysql Queries? I was wondering
if you have some methods would you share some code?

What kind of caching and optimization mechanisms can I use for frequent Web
Service calls?

Any kind of code explaining the process would be highly appreciated...

Thanks


[PHP] Objects and Traversing

2008-06-04 Thread VamVan
Hello Guys,

Here is the object. How can I get access to the [Name] = access. People who
help me with this can you please tell me what is the logic behind traversing
the objects and how do you gather the values. Thanks. I am looking for an
answer like this $queryResult->f->dsfsdf

QueryResult Object
(
[queryLocator] =>
[done] => 1
[records] => Array
(
[0] => SObject Object
(
[type] => Contact
[fields] =>
[sobjects] => Array
(
[0] => SObject Object
(
[type] => Account
[fields] => SimpleXMLElement Object
(
[Name] => Access
)

)

)

)

)

[size] => 1
)


[PHP] Regex in PHP

2008-06-03 Thread VamVan
Hello All,

For example I have these email addressess -

[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]

What would be my PHP function[Regular expression[ to that can give me some
thing like

yahoo.com
hotmail.com
gmail.com

Thanks


[PHP] PHP and Web Services [JIVE]

2008-05-30 Thread VamVan
Hello All,


I am trying to make a web service call using SOAP and PHP to create a new
community. I keep on receiving unauthorized exception. Please let me know
what I forgot in my code here.
How is it possible to send authentication headers in a SOAP call?

I would appreciate if some one could post some code here to make things
clear.


Thanks

CODE



$sso_wsdl_url_getemail = "
http://:8080/rpc/soap/CommunityService?wsdl";;
$client = new SoapClient($sso_wsdl_url_getemail, array(
'login' => "XX",
'password'=> "X",
'proxy_host' => "XXX",
'proxy_port' => 3128,
'exceptions' => 0,
'encoding' => "UTF-8",
'connection_timeout' => 60
));

$input = array();

$input['name'] = "Just A Small Test";
$input['disp'] = "Just Check it";
$input['desc'] = "Check it";

$result = $client->createCommunity($input);

print_r($result);


[PHP] Query in Query problems

2008-04-16 Thread VamVan
Hello All,

We many times encounter the situations of having Queries inside loop of
another query. Many times we can solve the issue by query joins but there
will be some situations where we cannot do it.

For Example:

function Change($id){

$qry_reg = "SELECT registrationID FROM registration  WHERE event_id
= '$id'";
$res_reg =& $this->mdb2->query($qry_reg);

while ($row_reg = $res_reg->fetchRow()) {
$userid = $row_reg['registrationid'];
$sql_insert = "INSERT
   INTO
   run
   (command, event_id, created, user_id, runtime)
   VALUES
   ('topic_change', '".$id."', NOW(), '".$userid."', NOW())";
$res_insert =&  $this->mdb2->query($sql_insert);

}
}

How can we deal with this kind of stuff? My concern is to just use the query
once instead on burdening the Mysql Server with so many queries This is
just one case. How do we actually deal with these kind of situations?

Thanks


[PHP] Dates Again

2008-03-31 Thread VamVan
Hello All,

I have a date in 2008-03-29 12:15:00  format.

   - How can I reduce one day from it?
   - How can I reduce one hour from it?
   - How can I add 1 hour to today's date?

Thanks


Re: [PHP] Array and Object

2008-03-24 Thread VamVan
Well anyways please let me handle the problems with decoding. I just
want to know if there is a way that I could traverse through all the
elements of the simplexmlobject and still keep the same structure of
the array. What I mean is

 [Advanced Virtualization Technologies in Workstation 6-20080320 1604]
=> SimpleXMLElement Object
   (
   [recordingID] => 932467
   [hostWebExID] => marketingprograms
   [name] => Title
   [createTime] => 03/20/2008 09:04:42
   [timeZoneID] => 4
   [size] => 49.441048
[recordingType] => 0
   [duration] => 3218
   )

Go through all the elements of the object and do some encoding and get
back the same array structure.

In raw terms I need to know the procedure that does this and still
keep the same structure of the array.

[Advanced Virtualization Technologies in Workstation 6-20080320 1604]
=> SimpleXMLElement Object
   (
   [recordingID] => utf8_decode(932467)
   [hostWebExID] => utf8_decode(marketingprograms)
   [name] => utf8_decode(Title)
   [createTime] => utf8_decode(03/20/2008 09:04:42)
   [timeZoneID] => utf8_decode(4)
   [size] => utf8_decode(49.441048)
[recordingType] => utf8_decode(0)
   [duration] => utf8_decode(3218)
   )






On Mon, Mar 24, 2008 at 10:10 AM, tedd <[EMAIL PROTECTED]> wrote:
> At 10:00 AM -0700 3/24/08, VamVan wrote:
>  >I cannot do that. because Simple xml element retrieves everything in
>  >UTF8. I need to decode it to latin1 for comparison with another array.
>
>  Unless there is something here that I don't understand, there is no
>  decoding UTF-8 to Latin1
>
>  Latin1 is a subset of UTF-8 -- what you find (characters) in Latin 1
>  is the same as in UTF-8.
>
>  If you have a code point (character) that lies outside of the range
>  of Latin 1, then there is no solution.
>
>  Cheers,
>
>  tedd
>
>
>  --
>  ---
>  http://sperling.com  http://ancientstones.com  http://earthstones.com
>
>  --
>
>
> PHP General Mailing List (http://www.php.net/)
>  To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Array and Object

2008-03-24 Thread VamVan
I cannot do that. because Simple xml element retrieves everything in
UTF8. I need to decode it to latin1 for comparison with another array.

My query still remains the same.

On Mon, Mar 24, 2008 at 9:56 AM, Eric Butera <[EMAIL PROTECTED]> wrote:
>
> On Mon, Mar 24, 2008 at 12:50 PM, VamVan <[EMAIL PROTECTED]> wrote:
>  > Hello All,
>  >
>  >  I am having an array structure as displayed below, The title is the
>  >  key and value is the simplexmlelementobject.
>  >
>  >   [Advanced Virtualization Technologies in Workstation 6-20080320 1604]
>  >  => SimpleXMLElement Object
>  > (
>  > [recordingID] => 932467
>  > [hostWebExID] => marketingprograms
>  > [name] => Title
>  > [createTime] => 03/20/2008 09:04:42
>  > [timeZoneID] => 4
>  > [size] => 49.441048
>  >  [recordingType] => 0
>  > [duration] => 3218
>  > )
>  >
>  >
>  >  I access the array  $this->result["$event->eventName"] = $event;
>  >
>  >  But I want to decode all the elements of the object using utf8_decode
>  >  but still keep the same structure of the array.
>  >   what i mean can I do this ?
>  >
>  >  $this->result["$event->eventName"] = utf_iso($event);
>  >
>  >  I appreciate if anyone can help me with this.
>  >
>  >  Thanks
>  >
>  >  --
>  >  PHP General Mailing List (http://www.php.net/)
>  >  To unsubscribe, visit: http://www.php.net/unsub.php
>  >
>  >
>
>  Can you jump upstream and decode it before you parse the xml?
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Array and Object

2008-03-24 Thread VamVan
Hello All,

I am having an array structure as displayed below, The title is the
key and value is the simplexmlelementobject.

 [Advanced Virtualization Technologies in Workstation 6-20080320 1604]
=> SimpleXMLElement Object
(
[recordingID] => 932467
[hostWebExID] => marketingprograms
[name] => Title
[createTime] => 03/20/2008 09:04:42
[timeZoneID] => 4
[size] => 49.441048
 [recordingType] => 0
[duration] => 3218
)


I access the array  $this->result["$event->eventName"] = $event;

But I want to decode all the elements of the object using utf8_decode
but still keep the same structure of the array.
 what i mean can I do this ?

$this->result["$event->eventName"] = utf_iso($event);

I appreciate if anyone can help me with this.

Thanks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Last Friday of every month

2008-03-13 Thread VamVan
Can you tell me how to do this ?

suppose I have a date variable = '02/23/2008'

i need to know if this is the last friday of february

let me know.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] class for generating ics or vcs file

2008-03-13 Thread VamVan
Hello All,

Can anyone share with me a simple class or code that can generate vcs
or ics calendar file in php, that can be imported in to outlook.

Thanks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Sessions

2008-02-28 Thread VamVan
Hello People,

I wanted to have your assistance in deciding few things here,
basically I want to auto populate a registration form for people
visiting second time or so on.

I have already started a session,I know that session is a cookie so is
it better to rely upon the session cookie for auto populating or
create another cookie on client side.

If i am not mistaken ini_set('session.gc_maxlifetime', 3600);
increases the time session cookie expiration time to 1 hr  right.

Please give me ur suggestions on this. if some one has a working code
can you please share?

Thanks,
V

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Date Function ][Resolved]

2008-02-22 Thread VamVan
Thanks ALL who have replied

On Fri, Feb 22, 2008 at 11:55 AM, Thiago Pojda
<[EMAIL PROTECTED]> wrote:
>
>  $start_date =  date("Y-m-d H:i:s", strtotime($date_format)); echo
>  $start_date; ?>
>
>  capital H should do it
>
>
>  -Mensagem original-
>  De: VamVan [mailto:[EMAIL PROTECTED]
>  Enviada em: sexta-feira, 22 de fevereiro de 2008 16:48
>  Para: php-general@lists.php.net
>  Assunto: [PHP] Date Function
>
>
>
>  Hi All,
>
>  Greetings!!
>
>  A small PHP Script for help
>
>$date_format = '02/22/2008 14:00:00';
>
>  $start_date =  date("Y-m-d h:i:s", strtotime($date_format)); echo
>  $start_date; ?>
>
>  output is 2008-02-22 02:00:00
>
>  but not 2008-02-22 14:00:00
>
>  How can i get my output as 2008-02-22 14:00:00.
>
>  Thanks
>  V
>
>  --
>
>
> 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] Date Function

2008-02-22 Thread VamVan
Hi All,

Greetings!!

A small PHP Script for help



output is 2008-02-22 02:00:00

but not 2008-02-22 14:00:00

How can i get my output as 2008-02-22 14:00:00.

Thanks
V

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to parse this kind of XML

2008-02-07 Thread VamVan
I cannot manipulate the response. this is the response I get from the
web services. is there any other way to do it?

On Feb 7, 2008 3:41 PM, Nathan Nobbe <[EMAIL PROTECTED]> wrote:
>
> On Feb 7, 2008 6:17 PM, VamVan <[EMAIL PROTECTED]> wrote:
>
>
> > Hi,
> >
> > How can I parse this kind of XML data?
> >
> >  
> >
> >
> >  < event:sessionType>9
> >
> >  marketingprograms
> >
> >  05/22/2008 09:00:00
> >
> >  05/22/2008 10:00:00
> >
> >  4
> >
> >  60
> > 
> >
> > I am using SimpleXMLElement function but some cannot retrieve the
> > nodes like timeZoneID for example
>
> you will have to define a namespace in the root node of the xml document;
>  then use the SimpleXMLElement::children() method to fetch the nodes in
> that namespace:
>
> $xmlData =
> <<  http://fake.com";>
>
>   9
>  marketingprograms
>  05/22/2008 09:00:00
>  05/22/2008 10:00:00
>   4
>  60
> 
> XMLDATA;
>
> $xml = new SimpleXMLElement($xmlData);
> foreach($xml->children('http://fake.com') as $key => $val) {
>  echo "$key => $val" . PHP_EOL;
> }
>
> -nathan
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] How to parse this kind of XML

2008-02-07 Thread VamVan
Hi,

How can I parse this kind of XML data?

  


  < event:sessionType>9

  marketingprograms

  05/22/2008 09:00:00

  05/22/2008 10:00:00

  4

  60


I am using SimpleXMLElement function but some cannot retrieve the
nodes like timeZoneID for example

Thanks

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sending SMS via PHP

2007-12-23 Thread VamVan
Hi Bastien,

I have actually implemented sending SMS using PHP by installing NOW SMS
gateway. You can find all the information regarding it on www.nowsms.com.
They have a software that you can buy and configure on your server.

I wrote scripts that can help sending single SMS, BULK SMS, User Defined SMS
etc. I also configured using PHP in a way to receive  SMS  to the web server
and store it in the database. Its really exciting when you start working on
this because you will be basically using SOAP and SMPP protocol to achieve
this.

Once you install trial Version mail me back so that I can help you with PHP
Scripts that can actually allow you to SEND SMS. 160 characters are allowed
per SMS and you also need connection to the SMS gateway in your country.

Thanks,
Vamsee




On Dec 23, 2007 6:59 AM, Bastien Koert <[EMAIL PROTECTED]> wrote:

>
> Sending proper SMS messges requires that you use an SMS gateway or buy a
> cellular modem. SMS is essentially XML will the message body limited to 160
> characters.
>
> do some googling to get more information
>
> bastien
> 
> > Date: Sun, 23 Dec 2007 08:30:29 +0330
> > From: [EMAIL PROTECTED]
> > To: php-general@lists.php.net
> > Subject: [PHP] Sending SMS via PHP
> >
> > Hi,
> >
> > How can i send SMS messages via PHP? How can i set SMS-headers (UDH)?
> > Does anyone know some article/class/package about this issue?
> >
> > Thank you in advance,
> > -b
>
> _
> Discover new ways to stay in touch with Windows Live! Visit the City @
> Live today!
> http://getyourliveid.ca/?icid=LIVEIDENCA006
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


[PHP] XML Parse Error

2007-12-21 Thread VamVan
Hi All,

Happy Christmas!!!

Please see the code below:


$xml = "";
$xml  = '';
$xml .= '';
$xml .= ''.
$this->xmlValueEncoding($post['Email']) .'';
$xml .= '' .
$this->xmlValueEncoding($post['FirstName']) . '';
$xml .= '' .
$this->xmlValueEncoding($post['LastName']) . '';
if (isset($post['Company']) && ($post['Company'] != ""))
$xml .= '' .
$this->xmlValueEncoding($post['Company']) .'';
if (isset($post['Title']) && ($post['Title'] != ""))
$xml .= '' .
$this->xmlValueEncoding($post['Title']) .'';
$xml .= '' .
$this->xmlValueEncoding($post['Password']) . '';
if (isset($post['Address1']) && ($post['Address1'] != ""))
$xml .= '' .
$this->xmlValueEncoding($post['Address1']) .'';
if (isset($post['City']) && ($post['City'] != ""))
$xml .= '' . $this->xmlValueEncoding($post['City'])
.'';
if (isset($post['State']) && ($post['State'] != ""))
$xml .= '' . $this->xmlValueEncoding($post['State'])
.'';
if (isset($post['ZipCode']) && ($post['ZipCode'] != ""))
$xml .= '' . $this->xmlValueEncoding($post['ZipCode'])
.'';
if (isset($post['Country']) && ($post['Country'] != ""))
$xml .= '' .
$this->xmlValueEncoding($post['Country']) . '';
if (isset($post['Phone']) && ($post['Phone'] != ""))
$xml .= '' . $this->xmlValueEncoding($post['Phone'])
. '';
$xml .= '';

function xmlValueEncoding($str) {

return htmlspecialchars(trim($str), ENT_QUOTES, "UTF-8");

}

I receive a XML parser errow when encoding the NON US Value like accent `
etc.

Can you please suggest me a solution?

I am using SOAP to send these values to a webservice.

Thanks,
Vamsee Vanaparthy


[PHP] Select Box CSS

2007-12-18 Thread VamVan
Hi All,

Please apologize for sending this question to PHP forums.

But I would appreciate it very much if some could please help me styling
 in HTMl with CSS?

I have .selectmulti { border: 1px solid #c9c9c9 } this code but it only
works in firefox How can I make this work in IE?

And also I want to change the selected color.

Thanks,

Vamsee


[PHP] XML Extraction

2007-12-17 Thread VamVan
Hello,

I receive an output  as an  XML File. Please  provide some scripts that I
can use for extraction of the values.

For Example:
hello

hello2

hello3

are 3 different records in the XML File. How can I retrieve the result set
in a loop and also sort it like DESC and ASC for example.

While()
{
 xml['title'] // Value
}
Thanks,
Vamsee