Re: [PHP] Re: SEO Experts?

2010-10-07 Thread Zareef Ahmed
A good thread and really good answers/posts are coming but in my humble
opinion this topic does not suit php-general list or atleast we should focus
on the points where php can play a role :)

On M, buton, Sep 27, 2010 at 12:54 PM,  wrote:

>
> > On 9/26/2010 8:09 AM, David Mehler wrote:
> >> Hello,
> >> Do we have any SEO experts on this list? I'm not one, learning only,
> >> reading a book and a few articles/tutorials from webmasters, and I'm
> >> wanting to optimize an existing site to get the best search rank
> >> possible. Some techniques, dos and don'ts would be appreciated.
> >> Thanks.
> >> Dave.
>
> Sure, it's what I do.
>
> Well first you need to work out which keyphrases to optimise for, and
> that's not obvious. Search Google for "keyword tool external" to find a
> Google tool that tells you something about the demand for a phrase and the
> competition for it.
>
> What you are trying to find are phrases that a) are very very relevant to
> your client, b) have lots of demand traffic, and c) don't have too much
> competition.
>
> The other thing to check is whether anyone else is making money at your
> selected phrases, so search for them in Google and see if people are
> advertising.
>
> Then group your phrases: so "wet dog" becomes a keyphrase group that
> includes phrases like "getting rid of wet dog smell", "avoiding wet dog
> shake" and so on.
>
> You are building a site to satisfy the keyphrase groups you've identified,
> so then one way or another you want a "wet dog" page that's optimised for
> that phrase, which means you mention "wet dog" a few times especially in
> the headline and page title and don't mention lots of other things.
>
> Then you want some links from other people's pages, Twitter, Delicious,
> YouTube and so on to your wet dog page, preferably text links that include
> the phrase "wet dog".
>
> Then you watch your Analytics data to check that people who arrive on your
> site are satisfied and covert into sales (or signups or whatever you are
> doing). If not, you run a Google Website Optimizer test to improve things
> like your headline, photos and so on.
>
> If you like, run through http://www.flowmarketing.co.uk and fill in the
> form where you get stuck. It's obviously a work in progress :-) and I'll
> complete the page that you end up at.
>
> By all means email me the website and I can be more specific.
>
> Good luck :-)
>
> Cheers
> J
> http://www.johnallsopp.co.uk
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Zareef Ahmed
http://www.zareef.net


Re: [PHP] Dual PHP installation and session sharing

2009-07-19 Thread Zareef Ahmed
On Sat, Jul 18, 2009 at 1:34 AM, Bruno Fajardo  wrote:

> Hi all,
>
> I'm using Apache/2.2.3 (Linux/SUSE), running PHP 4.4.7 in CGI mode, in a
> dual installation with PHP 5.1.2 running as an Apache module.
> Scripts with .php5 extension are executed by PHP 5, and those with .php are
> executed by PHP 4, and everything runs as expected.
> My question is: is it possible to share session data between .php and .php5
> scripts in this environment? All my tests failed.


have you tried using database as session storage and setting session id
manually in your application.

>
>
> Thanks in advance!
>



-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


Re: [PHP] PHP/mysql equivalent of PEAR's tableInfo()??

2009-07-12 Thread Zareef Ahmed
On Mon, Jul 13, 2009 at 3:19 AM, Govinda wrote:

> On Sat, Jul 11, 2009 at 19:57, Govinda
>> wrote:
>>
>>> I have been using PEAR's tableInfo() to remind myself about the columns
>>> in
>>> the table..  but now I want to see as much data as possible about the
>>> table
>>> and its contents *without* using PEAR.   (I.e. just using built in stuff
>>> for
>>> mysqli.)
>>>
>>
>>   This is not mysqli_#() directly, but just mocked up here in this
>> email.  Not guaranteed to work, but should give you the right idea at
>> least.  ;-P
>>
>> > include('inc/config.php'); // Your configuration
>> include('inc/db.php'); // Your database connection info
>>
>> $sql = "SHOW TABLES";
>>
>> $result = mysql_query($sql);
>>
>> foreach(mysql_fetch_assoc($result) as $k => $v) {
>>   $ssql = "DESCRIBE ".mysql_real_escape_string($v);
>>   $rresult = mysql_query($ssql);
>>   echo "".$k.":\n";
>>   echo "\n";
>>   print_r(mysql_fetch_assoc($rresult));
>>   echo "\n";
>>   echo "\n";
>> }
>> ?>
>>
>
>
> Dan I get roughly the idea, but alas I am stumped so easily in this new
> ocean..  it frustrates me.
>
> I have this code:
>
>$db_billing=mysqli_connect(localhost,metheuser,mypass,billing);
>if (mysqli_connect_error()) { die("Can't connect: " .
> mysqli_connect_error()); }



mysqli


>
>//$dbname = 'billing';
>$sql = "SHOW TABLES";
>
>$result = mysql_query($sql); // line 53
>

Now mysql, What are you doing?


>
>foreach(mysql_fetch_assoc($result) as $k => $v) {  // line 55
>$ssql = "DESCRIBE ".mysql_real_escape_string($v);
>$rresult = mysql_query($ssql);
>echo "".$k.":\n";
>echo "\n";
>print_r(mysql_fetch_assoc($rresult));
>echo "\n";
>echo "\n";
>}
>
> Which is just giving these errors:
>
> Warning: mysql_query() [function.mysql-query]: Access denied for user
> 'meee'@'localhost' (using password: NO) in
> /home/meee/public_html/somedir/test.php on line 53
>
> Warning: mysql_query() [function.mysql-query]: A link to the server could
> not be established in /home/meee/public_html/somedir/test.php on line 53
>
> Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result
> resource in /home/meee/public_html/somedir/test.php  on line 55
>
> Warning: Invalid argument supplied for foreach() in
> /home/meee/public_html/somedir/test.php  on line 55
>
> --
> I am looking forward to when I have enough of my bearings that I can just
> cruise around all the various docs and figure out my own answers.   Now
> there are just so many unknowns, I often can't tell which way to even look
> to solve the issues.
> -G
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


Re: [PHP] HTTP headers and include()

2009-07-12 Thread Zareef Ahmed
On Sun, Jul 12, 2009 at 11:27 PM, James Colannino wrote:

> Zareef Ahmed wrote:
>
> > You should get a "headers already sent output started at " kind of
> error
> > if you have enabled error reporting with display_errors ON.
>
> Actually, I did.  I just didn't think to mention it in my first post.
> The thing was that it said it was coming from one of my includes, even
> though I wasn't yet printing anything to the browser.  That's why I was
> so confused.


Its not only print or echo command which may output.
 As Michael was pointing even a space can cause this problem.
Your error message will tell you about exact location of the problem spot
with line number.

(If you are only getting this problem after uploading your code to server
then your FTP client may be culprit)


>
>
> I've been following what tedd said in an earlier post (to make
> session_start() your first line of code) and haven't had a problem since.
>

Yes, its a good practice for almost all applications and you should do it
always unless you have a reason to do otherwise.
If its really hard to maintain (like working with older codebase with lots
of references to session_start in the middle of application process) then
just putting ob_start at very start of application can also solve the
problem.


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


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


Re: [PHP] HTTP headers and include()

2009-07-12 Thread Zareef Ahmed
On Fri, Jul 10, 2009 at 12:54 PM, James Colannino wrote:

> Eddie Drapkin wrote:
>
> > HTTP headers are sent and finalized after the first bit of output.   I
> > had the same problem before and it turned out to be because I had a
> > close tag "?>" at the end of a file followed by some whitespace.  The
> > solution was to remove the ?> from the end of all the files and I
> > haven't closed an entire file since.  Perhaps that might be it?
>
> Hmm...  In fact, I did close all my include files with the ?> tag, and
> per Michael's observation in another response, there is a line of
> whitespace after the closing tag in my include files.
>
> I tried getting rid of the trailing whitespace, and removed the closing
> tags.  Unfortunately, even after that, when I place my include files
> before session_start, I get the same problem.  There's no leading
> whitespace before the starting 
> It's not too big of a deal though; I simply placed my include files
> after the call to session_start().  That seems to solve the problem.
>

That's a good practice, (Although not optimal is some application setups )
but I am wondering why you are not getting information about exact place
where output is being started.
You should get a "headers already sent output started at " kind of error
if you have enabled error reporting with display_errors ON.


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


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


Re: [PHP] MySql Injection advice

2009-07-12 Thread Zareef Ahmed
On Sun, Jul 12, 2009 at 8:42 PM, tedd  wrote:

> At 8:24 PM +0530 7/12/09, Zareef Ahmed wrote:
>
>> On Sun, Jul 12, 2009 at 6:32 PM, tedd <<mailto:tedd.sperl...@gmail.com>
>> tedd.sperl...@gmail.com> wrote:
>>
>> Hi gang:
>>
>> I am top posting only to show that the following post makes no sense as to
>> who said what.
>>
>> At what point here Zareef, did you think you were helping anyone? Or is
>> this more of your "I'm going to do whatever I want" attitude?
>>
>>
>> As far as I understand the main problem was the original poster was "NOT
>> SEEING" slashes in the output from database after successful insertion (
>> with only single use of mysql_real_escape_string), so I put my 50 cent on
>> the magic quotes runtime..
>> (My understanding of the actual problem may be wrong thus the suggestion
>> in context)
>> I am sorry if I offended anyone 
>>
>
> Zareef:
>
> You are missing the point. It's not an issue of offending anyone but rather
> if someone is going to contribute, it makes sense to be clear as to what you
> are contributing -- else -- it just becomes noise.
>

100% Agree


>
> When you are reviewing a long post and then inject your comments within it,
> while it may make sense to you, it may not make sense to others.


Yes injecting comments within a long post can lead to many misunderstanding
about the purpose of suggestion.


> As with all communication, it's better to be clear than obtuse.
>

Agree, but I believe "obtuse" word  meaning is contextual and depends :)

This is my last post in this thread.


>
> Cheers,
>
> tedd
>
> --
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com
>



-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


Re: [PHP] MySql Injection advice

2009-07-12 Thread Zareef Ahmed
On Sun, Jul 12, 2009 at 6:32 PM, tedd  wrote:

> Hi gang:
>
> I am top posting only to show that the following post makes no sense as to
> who said what.
>
> At what point here Zareef, did you think you were helping anyone? Or is
> this more of your "I'm going to do whatever I want" attitude?
>


As far as I understand the main problem was the original poster was "NOT
SEEING" slashes in the output from database after successful insertion (
with only single use of mysql_real_escape_string), so I put my 50 cent on
the magic quotes runtime..
(My understanding of the actual problem may be wrong thus the suggestion in
context)
I am sorry if I offended anyone 


>
> I would hate to review code with such lack of forethought and consideration
> for others to read.
>
> tedd
>
> -- totally useless post follows:
>
>
> At 5:51 AM +0530 7/12/09, Zareef Ahmed wrote:
>
>> On Sun, Jul 12, 2009 at 4:09 AM, Haig Dedeyan <> hdede...@videotron.ca>hdede...@videotron.ca> wrote:
>>
>> On July 11, 2009 10:57:14 am Haig Dedeyan wrote:
>>
>>>  At 10:12 PM -0400 7/10/09, Haig Dedeyan wrote:
>>>
>>>  [1]
>>>
>>>  >$fname = mysql_real_escape_string($fname);
>>>  >$lname = mysql_real_escape_string($lname);
>>>  >
>>>  >$sql = "UPDATE phonedir SET fname = '$fname',lname = '$lname' WHERE
>>>  > id=$id"; $result = mysql_query($sql);
>>>  >echo mysql_error() . "\n";
>>>  >
>>>  >This will result in the addition of the slashes.
>>>
>>>  [2]
>>>
>>>  >If I do the following, there are no slashes. Just wondering if I'm on
>>> the
>>>  >right path with the 1st code set..
>>>  >
>>>  >$sql = "UPDATE phonedir SET fname =
>>>  >'".mysql_real_escape_string($fname)."',lname =
>>>  >'".mysql_real_escape_string($lname)."'  WHERE id=$id";
>>>  >$result = mysql_query($sql);
>>>  >echo mysql_error() . "\n";
>>>
>>>  Haig:
>>>
>>>  Interesting, I did not know that -- that sounds like a bug to me --
>>>  both should be the same.
>>>
>>>  However, I commonly do [1] and when I have to display the data to a
>>>  browser, then I use htmlentities() and stripslashes() before
>>>  displaying the data. That way names like O'Brian appear correctly --
>>>  else they appear 0\'Brian.
>>>
>>>  Now maybe I'm doing something wrong, but this way works for me. If
>>>  there is a better way, I would like to here it.
>>>
>>>  Cheers,
>>>
>>>  tedd
>>>
>>
>> Thanks Tedd.
>>
>> I did more testing and here's what I have found.
>>
>> @PHPSter - magic quotes are off
>>
>>
>> Just entering simple data where an apostrophe is part of the data.
>>
>> The following code is entering the slash but that's becuase I am escaping
>> it
>>
>>
>>
>>
>> twice since mysql_num_rows is throwing an error if an apostrophe is in its
>> search:
>>
>> 1 -
>> $new_fname = mysql_real_escape_string($new_fname);
>> $new_lname = mysql_real_escape_string($new_lname);
>>
>> $result = mysql_query("SELECT * FROM phonedir WHERE fname = '$new_fname'
>> &&
>> lname = '$new_lname'");
>> $num_rows = mysql_num_rows($result);
>>
>>
>> The error message may be saying the mysql_num_rows is throwing an error
>> but actual error is on mysql_query function level (Not a correct query)
>>
>>
>> if($num_rows > 0)
>>
>> {
>>   echo $fname." ".$lname." already exists";
>> }
>>
>> else
>>   {
>>
>> mysql_query("INSERT INTO phonedir
>> (fname, lname)
>>
>> VALUES('".mysql_real_escape_string($new_fname)."','".mysql_real_escape_string($new_lname)."')")
>> or die(mysql_error());
>>
>>
>> BTW twice escaping is  not good
>>
>>
>>
>>
>> 2 - If I do the same code above without the mysql_num_rows and no
>> escaping,
>> the data doesn't get entered.
>>
>> I think this is normal behaviour.
>>
>> Welcome to hell of quotes :(
>>
>>
>>
>>
>>
>>
>> 3 - If I do any of the 2 following sets of code where there is 1 instance
>&

Re: [PHP] A prepared statements question

2009-07-12 Thread Zareef Ahmed
On Sun, Jul 12, 2009 at 10:01 AM, Jason Carson  wrote:

> Hello everyone,
>
> I am having a problem getting my prepared statements working. Here is my
> setup...
>
>index.php -> authenticate.php -> admin.php
>
> 1)index.php has a login form on it so when someone enters their username
> the form redirects to another page I call authenticate.php.
>
> 2)In the authenticate.php file I want to use prepared statements to
> interact with the MySQL database. I want to compare the username submitted
> from the form with the username in the database.
>
> 3)If the login username was legitimate then you are forwarded to admin.php
>
> Its step 2 I am having problems with. Here is what I have but I don't
> think it makes any sense and it doesn't work.
>
>
> $link = mysqli_connect($hostname, $dbusername, $password, $database);
> $stmt = mysqli_prepare($link, "SELECT * FROM administrators WHERE
> adminusers=?");

No Password ? I hope you are only using the statement for determining the
role of already logged in user.

> mysqli_stmt_bind_param($stmt, 's', $username);
> $result = mysqli_stmt_execute($stmt);
>
> $count=mysqli_num_rows($result);
>
> if($count==1){
> header("location:admin.php");
> } else {
> echo "Failure";
> }
>
> Any help is appreciated.
>

You forgot to mention the about the problem you are facing :), "I am having
problem" statement is not good enough.


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


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


Re: [PHP] MySql Injection advice

2009-07-11 Thread Zareef Ahmed
php.net/manual/en/info.configuration.php#ini.magic-quotes-runtim
> >e
> >
> > If it is enables it will automatically removed the slashes from any
> > external source including databases...
> > It was there to make the life of developer somewhat easier ()...
> > magic quotes things are deprecated and completely will be removed in PHP
> 6
> >
> > > $new_fname = mysql_real_escape_string($new_fname);
> > > $new_lname = mysql_real_escape_string($new_lname);
> > >
> > >
> > > $result = mysql_query("SELECT * FROM phonedir WHERE fname =
> '$new_fname'
> > > && lname = '$new_lname'");
> > > $num_rows = mysql_num_rows($result);
> > >
> > > if($num_rows > 0)
> > >
> > > {
> > > echo $fname." ".$lname." already exists";
> > > }
> > >
> > > else
> > > {
> > >
> > > mysql_query("INSERT INTO phonedir
> > > (fname, lname) VALUES('$new_fname','$new_lname')")
> > > or die(mysql_error());
> > >
> > >
> > >
> > > or
> > >
> > >
> > > mysql_query("INSERT INTO phonedir
> > > (fname, lname)
> > >
> > >
> VALUES('".mysql_real_escape_string($new_fname)."','".mysql_real_escape_st
> > >ring($new_lname)."')") or die(mysql_error());
>
>
>
> Thansk Zareef.
>
>
> Magic quotes are off. This is what my php ini says:
>
>
> ; Magic quotes for incoming GET/POST/Cookie data.
> magic_quotes_gpc = Off
>
>
> ; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(),
> etc.
> magic_quotes_runtime = Off
>
>
> ; Use Sybase-style magic quotes (escape ' with '' instead of \').
> magic_quotes_sybase = Off
>
>
This is fine, But just for final confirmation of actual values at the
runtime can you try to get the value of function get_magic_quotes_runtime
function in your script.

var_dump(get_magic_quotes_runtime);

possibility of using a different php.ini  or modifying values of variables
at runtime is also there :)



>
>
>
> I won;t be using 2x escapes but I just need to know if I should be seeing
> the backslash in the dbase.
>
>
>
>
> @Tedd - I will be looking into prepared statements eventually but I still
> want to understand escaping.
>
>
> Cheers
>
>
> Haig
>



-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


Re: [PHP] MySql Injection advice

2009-07-11 Thread Zareef Ahmed
On Sun, Jul 12, 2009 at 4:09 AM, Haig Dedeyan  wrote:

> On July 11, 2009 10:57:14 am Haig Dedeyan wrote:
> > At 10:12 PM -0400 7/10/09, Haig Dedeyan wrote:
> >
> > [1]
> >
> > >$fname = mysql_real_escape_string($fname);
> > >$lname = mysql_real_escape_string($lname);
> > >
> > >$sql = "UPDATE phonedir SET fname = '$fname',lname = '$lname' WHERE
> > > id=$id"; $result = mysql_query($sql);
> > >echo mysql_error() . "\n";
> > >
> > >This will result in the addition of the slashes.
> >
> > [2]
> >
> > >If I do the following, there are no slashes. Just wondering if I'm on
> the
> > >right path with the 1st code set..
> > >
> > >$sql = "UPDATE phonedir SET fname =
> > >'".mysql_real_escape_string($fname)."',lname =
> > >'".mysql_real_escape_string($lname)."'  WHERE id=$id";
> > >$result = mysql_query($sql);
> > >echo mysql_error() . "\n";
> >
> > Haig:
> >
> > Interesting, I did not know that -- that sounds like a bug to me --
> > both should be the same.
> >
> > However, I commonly do [1] and when I have to display the data to a
> > browser, then I use htmlentities() and stripslashes() before
> > displaying the data. That way names like O'Brian appear correctly --
> > else they appear 0\'Brian.
> >
> > Now maybe I'm doing something wrong, but this way works for me. If
> > there is a better way, I would like to here it.
> >
> > Cheers,
> >
> > tedd
>
>
> Thanks Tedd.
>
> I did more testing and here's what I have found.
>
> @PHPSter - magic quotes are off
>
>
> Just entering simple data where an apostrophe is part of the data.
>
> The following code is entering the slash but that's becuase I am escaping
> it



>
> twice since mysql_num_rows is throwing an error if an apostrophe is in its
> search:
>
> 1 -
> $new_fname = mysql_real_escape_string($new_fname);
> $new_lname = mysql_real_escape_string($new_lname);
>
> $result = mysql_query("SELECT * FROM phonedir WHERE fname = '$new_fname' &&
> lname = '$new_lname'");
> $num_rows = mysql_num_rows($result);
>

The error message may be saying the mysql_num_rows is throwing an error but
actual error is on mysql_query function level (Not a correct query)

>
> if($num_rows > 0)
>
>  {
>echo $fname." ".$lname." already exists";
>  }
>
> else
>{
>
> mysql_query("INSERT INTO phonedir
> (fname, lname)
>
> VALUES('".mysql_real_escape_string($new_fname)."','".mysql_real_escape_string($new_lname)."')")
> or die(mysql_error());
>
>
>
BTW twice escaping is  not good

>
>
>
> 2 - If I do the same code above without the mysql_num_rows and no escaping,
> the data doesn't get entered.
>
> I think this is normal behaviour.
>
> Welcome to hell of quotes :(


>
>
>
>
> 3 - If I do any of the 2 following sets of code where there is 1 instance
> of
> escaping, the data gets entered with the apostrophe but I don't see any
> back
> slash entered.
>
> The part that I am concerned about is if I should be seeing the backslash
> entered without having to double escape,
>

Please see magic_quotes_runtime setting configuration...
http://www.php.net/manual/en/info.configuration.php#ini.magic-quotes-runtime

If it is enables it will automatically removed the slashes from any external
source including databases...
It was there to make the life of developer somewhat easier ()...
magic quotes things are deprecated and completely will be removed in PHP 6


>
> $new_fname = mysql_real_escape_string($new_fname);
> $new_lname = mysql_real_escape_string($new_lname);
>
>
> $result = mysql_query("SELECT * FROM phonedir WHERE fname = '$new_fname' &&
> lname = '$new_lname'");
> $num_rows = mysql_num_rows($result);
>
> if($num_rows > 0)
>
>  {
>echo $fname." ".$lname." already exists";
>  }
>
> else
>{
>
> mysql_query("INSERT INTO phonedir
> (fname, lname) VALUES('$new_fname','$new_lname')")
> or die(mysql_error());
>
>
>
> or
>
>
> mysql_query("INSERT INTO phonedir
> (fname, lname)
>
> VALUES('".mysql_real_escape_string($new_fname)."','".mysql_real_escape_string($new_lname)."')")
> or die(mysql_error());
>
>
>


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


Re: [PHP] I am RTFM, but still stumbling on how to get built-in functions parsed in heredoc

2009-07-11 Thread Zareef Ahmed
I always said :  Being good and Being FORCED to be good  are two different
things... and PHP normally don't force us to be good that why PHP is the
most popular programming language with a large code base which WORKS but
not as per the standard or recommended way ; so keep you old code as long as
it works

Sorry for TOP posting  This mailing list also don't force us to be good
:)

Zareef Ahmed

On Sun, Jul 12, 2009 at 4:50 AM, Eddie Drapkin  wrote:

> On Sat, Jul 11, 2009 at 5:37 PM, tedd wrote:
> > At 3:34 AM +0700 7/12/09, Lenin wrote:
> >>
> >> On Sun, Jul 12, 2009 at 2:56 AM, Eddie Drapkin 
> wrote:
> >>
> >>>  On Sat, Jul 11, 2009 at 3:53 PM, Govinda >
> >>
> >>  > wrote:
> >>  > > what does "EOT" stand for?
> >>>
> >>>  > (I realize that string can be anything..  but I am just asking what
> >>> EOT
> >>
> >>  > > means to everyone?
> >>  >
> >>  > I just use it as "End of Term" because I'm used to "EOF" as "End of
> >> File"
> >>
> >> EOT used to mean  End of Text. reference ASCII-7 notatioin
> >
> >
> > Yes, but in both cases the operator is used at both the beginning AND at
> the
> > end of the heredoc. I normally don't start anything with an "End" term.
> >
> > That's what I liked about the underscore (_) -- there's no inference that
> > it's an acronym.
> >
> > $whatever = <<<_
> > whatever
> > _;
> >
> > However with that said, one could come up with a dual purpose acronym
> like:
> >
> > TO  = (TEXT On or TEXT Off)
> >
> > or if you need three characters.
> >
> > HDO = (HEREDOC ON or HEREDOC OFF)
> >
> > I'm sure some clever person could come up with something better.
> >
> > Cheers,
> >
> > tedd
>
>
> When I see something like
>
> $foo = <<
> //stuff
>
> EOT;
>
> I always read "<< So, the whole statement, in my head, would be "$foo is equal to
> everything following until End of Text."  Although, less generic names
> like HTML, or XML, or ROW can also be fine, too.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


Re: [PHP] I am RTFM, but still stumbling on how to get built-in functions parsed in heredoc

2009-07-11 Thread Zareef Ahmed
On Sat, Jul 11, 2009 at 6:14 AM, Govinda wrote:

> On Jul 10, 2009, at 6:34 PM, Zareef Ahmed wrote:
>
>  heredoc was there to work with the strings... why you want to use
>> functions into that?
>>
>
> I'm lazy.  Like to type less.  ;-)



It is well known fact that normally only lazy people end up being a good
programmer.
BTW template system like smarty and many MVC pattern framework solved such
issues  But those are only useful if you are planning something big
(read more than a single page ) and want to put the logic not just for less
typing but also for less complication;
I hope I sound less complicated :)

>
>
> But now I know.
> Thanks guys.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


Re: [PHP] PHP not running properly

2009-07-10 Thread Zareef Ahmed
A quick checklist/todo list :

1. set display_errors=yes in php.ini
2. Make sure you are using full  wrote:

> On Fri, Jul 10, 2009 at 4:17 PM, Daniel Brown wrote:
> > On Fri, Jul 10, 2009 at 15:44, Togrul
> > Mamedbekov wrote:
> >> Hello Sir or Madam,
> >>
> >> We just updated our PHP 5.2 software. And when I try to run the php info
> >> script! I get a blank screen!
> >
> >What do you see when you view the source of the page with phpinfo() ?
> >
> > --
> > 
> > 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
> >
> >
>
> Your error handling is logging the errors, not displaying them to the
> screen. Check the php ini file settings for that.
>
> --
>
> Bastien
>
> Cat, the other other white meat
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


Re: [PHP] I am RTFM, but still stumbling on how to get built-in functions parsed in heredoc

2009-07-10 Thread Zareef Ahmed
On Sat, Jul 11, 2009 at 5:55 AM, Govinda wrote:

> How do I  get
> basename(__FILE__)
> or
> htmlentities($somevar)
> to be evaluated  in a heredoc?
>

heredoc was there to work with the strings... why you want to use functions
into that?


>
> 
> Govinda
> govinda.webdnat...@gmail.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


Re: [PHP] HELP SQL INJECTION

2009-07-10 Thread Zareef Ahmed
Hi,

 First of all change your FTP password and stop storing your password in
your FTP client.
This type of attacks are very common with the people who use insecure FTP
client.

My previous experience with your kind of problem tell me that chances of a
FTP attack are really higher in the pattern of your case.

Zareef Ahmed



On Sat, Jul 11, 2009 at 3:50 AM, Daniel Brown  wrote:

> On Fri, Jul 10, 2009 at 18:11, Chris Payne
> wrote:
> >
> > Sorry I post at the top because i'm legally blind and it's easier but
> > i'll try to post at the bottom :-)
> >
> > This is the main site on my server:
> >
> > http://www.oxyge.net
> >
> > I just took out the offending code at the end of the index page to get
> > it back up and running.
>
> Check the /blog/ as well.  Parse error.
>
> --
> 
> 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
>
>


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


Re: [PHP] setcookie

2008-03-12 Thread Zareef Ahmed
As a dirty trick you can put following line on the top of your script,
it will work
ob_start();

But you should try to know why it is not working, and what exactly
ob_start will impact your application and What is the thing called
"Output Buffering".

Zareef Ahmed

On 3/12/08, Hiep Nguyen <[EMAIL PROTECTED]> wrote:
>
> On Wed, 12 Mar 2008, Tim Daff wrote:
>
> > Hi,
> >
> > I am learning PHP, I am trying to set a simple cookie:
> >
> > 
> >   
> >   Cookies
> >   
> >   
> >> time()+(60*60*24*7)); ?>
> >   
> > 
> >
> > Firefox is returning this error:
> >
> > Warning: Cannot modify header information - headers already sent by
> (output
> > started at /Users/Daff/Sites/php_sandbox/cookies.php:7) in
> > /Users/Daff/Sites/php_sandbox/cookies.php on line 7
> >
> > I have googled this and can't find out what I am doing wrong.  Any help
> you
> > could give me would be much appreciated.
> >
> > Tim
>
>
> setcookie from php.net states the following:
>
> setcookie() defines a cookie to be sent along with the rest of the HTTP
> headers. Like other headers, cookies must be sent before any output from
> your script (this is a protocol restriction). This requires that you place
> calls to this function prior to any output, including  and 
> tags as well as any whitespace
>
> call setcookie before you output ANY THING, even error
>
> hope that helps.
> t. hiep
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Zareef Ahmed
http://www.zareef.net
A PHP Developer in India


Re: [PHP] Re: Transferring files between computers using php

2008-03-06 Thread Zareef Ahmed
On 3/7/08, Rahul <[EMAIL PROTECTED]> wrote:
>
> Thank you all so much for replying... I guess I was very vague in
> describing the situation. I will write in detail:
>
> I have three computers A, B and C. To login to B and C I should use A
> because it has a SSH key. I don't have any other way of accessing these
> two computers. Now, if I need to transfer a file between B and C, I am
> unable to find a way that would work... because I don't know how to
> authenticate without SSH keys... I was gathering some data in B and C
> using PHP. Now, I need these two computers to coordinate a little and
> didn't want to use a server in between and so I was thinking of
> establishing a direct connection between them..


If you have ruled out web server and ssh, then you can use ftp using PHP or
use NFS mounting.




Zareef Ahmed wrote:
> > On 3/7/08, Shawn McKenzie <[EMAIL PROTECTED]> wrote:
> >> Rahul wrote:
> >>> I have a small file to be transferred between two computers every few
> >>> seconds. I'm using unix with a bare bones version of php, i.e. just
> the
> >>> original thing that gets installed when I run "yum install php". As
> >> there is
> >>> no webserver on any of these machines, I was wondering if there is a
> way
> >> to
> >>> transfer a small file between them and if there is, could someone be
> >> kind
> >>> enough to provide me with an example please?
> >>>
> >>> Thank You
> >>>
> >>>
> >> FYI...  If you're using yum I assume it's a Linux machine (maybe
> Fedora)
> >> and not Unix.
> >
> >
> >
> > If you want to use rsync and scp in a cronjob (for continuous transfer
> at a
> > predefined interval), you may need to set your server (read ssh) to
> accept
> > connection without password.
> > Ref : http://linuxproblem.org/art_9.html
> >
> > BUT If you really want to do that from PHP, you can install a web server
> and
> > enable http as your stream for opening files. (In php.ini)
> >  You can read the file using fopen or any other file functions, then can
> > write that file to the server on which script will be running, then you
> can
> > set this script as your cron job.
> >
> > For example :
> >
> > $filecontents=file_get_contents("http://firstserver/file.txt";);
> >
> > $fp=fopen("path to local file", "mode");
> >
> > Now use $fiiecontents to write the file using $fp resource.
> >
> > BUT remember, using rsync is always a better solution, and
> file_get_contents
> > and file functions are resource hungry, specially they will consume more
> > memory of your system.
> >
> >
> >
> > --
> >> 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
>
>


-- 
Zareef Ahmed
http://www.zareef.net
A PHP Developer in India


Re: [PHP] Re: Transferring files between computers using php

2008-03-06 Thread Zareef Ahmed
On 3/7/08, Shawn McKenzie <[EMAIL PROTECTED]> wrote:
>
> Rahul wrote:
> > I have a small file to be transferred between two computers every few
> > seconds. I'm using unix with a bare bones version of php, i.e. just the
> > original thing that gets installed when I run "yum install php". As
> there is
> > no webserver on any of these machines, I was wondering if there is a way
> to
> > transfer a small file between them and if there is, could someone be
> kind
> > enough to provide me with an example please?
> >
> > Thank You
> >
> >
>
> FYI...  If you're using yum I assume it's a Linux machine (maybe Fedora)
> and not Unix.



If you want to use rsync and scp in a cronjob (for continuous transfer at a
predefined interval), you may need to set your server (read ssh) to accept
connection without password.
Ref : http://linuxproblem.org/art_9.html

BUT If you really want to do that from PHP, you can install a web server and
enable http as your stream for opening files. (In php.ini)
 You can read the file using fopen or any other file functions, then can
write that file to the server on which script will be running, then you can
set this script as your cron job.

For example :

$filecontents=file_get_contents("http://firstserver/file.txt";);

$fp=fopen("path to local file", "mode");

Now use $fiiecontents to write the file using $fp resource.

BUT remember, using rsync is always a better solution, and file_get_contents
and file functions are resource hungry, specially they will consume more
memory of your system.



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


-- 
Zareef Ahmed
http://www.zareef.net
A PHP Developer in India


Re: [PHP] How to measure memory leakage/usage in PHP?

2008-03-05 Thread Zareef Ahmed
Hi Chris,

  Thanks for such quick response.

quite good suggestion, but my application is using a framework and lots of
includes and even autoloads of classes are being done, so using break point
approach is not possible for me.

Well, trying to do something so I can call my memory usage function after
certain number of lines or predefined life time of php script, any
suggestion?

Thanks and Regards
Zareef Ahmed

On 3/6/08, Chris <[EMAIL PROTECTED]> wrote:
>
> Zareef Ahmed wrote:
> > Hi All,
> >
> >I am looking into the concepts behind memory management in PHP. Which
> > kind of approach will be best to measure memory leakage or usage in a
> PHP
> > script?
> >
> > I can measure my apache process but is there any way by which I can know
> > which exact part of script is consuming how much memory?
>
>
> Start off with putting something like this:
>
> error_log('in file ' . __FILE__ . ' at line ' . __LINE__ . ' memory
> usage is ' . memory_get_usage(true) . "\n", 3, '/path/to/log.file');
>
> every 100 lines and work out where your spikes are.
>
> When you're looking at a section that jumps a lot, put it every 10 lines
> - work out which parts are causing the big jumps and go from there.
>
>
> Or use xdebug profiling to work out which parts of your app are being
> used the most and start there - http://xdebug.org/docs/profiler
>
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>



-- 
Zareef Ahmed
http://www.zareef.net
A PHP Developer in India


Re: [PHP] How to measure memory leakage/usage in PHP?

2008-03-05 Thread Zareef Ahmed
HI Chirs,

On 3/6/08, Chris <[EMAIL PROTECTED]> wrote:
>
> Zareef Ahmed wrote:
> > Hi Chris,
> >
> >   Thanks for such quick response.
> >
> > quite good suggestion, but my application is using a framework and lots
> > of includes and even autoloads of classes are being done, so using break
> > point approach is not possible for me.
>
>
> Why not? It just means the files are spread out in different folders
> instead of one place.
>
> If you're using a framework, set up a new very simple environment and
> see how much memory that uses by itself (see
> http://www.php.net/memory_get_peak_usage).
>
> That'll at least tell you whether it's the framework using all the
> memory or your specific changes to it.


 I have done that check and I am sure that only my changes are taking time,
but they are large in numbers, so I was looking something to pin point the
exact change which is consuming more memory. Thanks for your suggestions, I
will definitely use them.





--
>
> Postgresql & php tutorials
> http://www.designmagick.com/
>



-- 
Zareef Ahmed
http://www.zareef.net
A PHP Developer in India


[PHP] How to measure memory leakage/usage in PHP?

2008-03-05 Thread Zareef Ahmed
Hi All,

   I am looking into the concepts behind memory management in PHP. Which
kind of approach will be best to measure memory leakage or usage in a PHP
script?

I can measure my apache process but is there any way by which I can know
which exact part of script is consuming how much memory?


-- 
Zareef Ahmed
http://www.zareef.net
A PHP Developer in India


Re: [PHP] Calendar booking form in PHP/MySQL

2007-07-08 Thread Zareef Ahmed

Hi Murphy,
I think till now you got the idea why you did't got replies for query.
Please do a simple google search and you will find something. using
sourceforge is also good idea.

People are here to solve and discuss the programming problems of each
others, NOT to do work for each other  :)

Zareef Ahmed

On 7/3/07, Timothy Murphy <[EMAIL PROTECTED]> wrote:


I'm looking for a PHP/MySQL "calendar booking form",
which I am sure must have been done a million times.

This will show a calendar on the web mirroring a MySQL table.
Each entry in the MySQL table will show two dates, Start and End.
The dates between these should be shown in red on the calendar.

Any pointers or scipts or suggestions gratefully received.

--
Timothy Murphy
e-mail (<80k only): tim /at/ birdsnest.maths.tcd.ie
tel: +353-86-2336090, +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland

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





--
Thanks and Regards
Zareef Ahmed
===
PHP Developer India http://www.zareef.net


Re: [PHP] Reverse Engineering of Smarty

2006-02-05 Thread Zareef Ahmed
Hi All,

  A lot of  talk on that topic.

Actually project was very small, Accidentally deleted that,  was going to
restore it from backup on other filesystem, then just thought that there
must be something that can restore from compiled code. So ask the question
in this prestigious group,

Rightly I got good adjectives ;)

Well I am using CVS for all of my projects and do regular backups. Above all
filesystem restore is also available in most of such cases.

Lets close this thread,  we people really have many meaningful questions to
answers.

  Zareef Ahmed



- Original Message - 
From: "Robert Cummings" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "PHP-General" 
Sent: Sunday, February 05, 2006 2:46 PM
Subject: Re: [PHP] Reverse Engineering of Smarty


> On Sun, 2006-02-05 at 01:12, Sumeet wrote:
> > Rory Browne wrote:
> > > If you don't have backups, then:
> > >
> > >  1: Why do you not have backups?
> > >  2: Are you insane?
> >
> > hmm. totally uncalled for 
>
> I don't know that it's "uncalled for". I think Rory was drawing to
> attention that not having some kind of backup of important code is
> tantamount to incompetence. I would have to agree with Rory that if the
> code was important enough to seek a method of reverse engineering to
> retrieve the original, then some kind of system should have been in
> place long ago. Might I suggest CVS? I would have to say that "are you
> insane" is a bit softer on the ego than "are you a complete moron".
>
> Cheers,
> Rob.
> -- 
> ..
> | InterJinn Application Framework - http://www.interjinn.com |
> ::
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for   |
> | creating re-usable components quickly and easily.  |
> `'
>
> -- 
> 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] Reverse Engineering of Smarty

2006-02-05 Thread Zareef Ahmed
 Original Message - 
From: "Rory Browne" <[EMAIL PROTECTED]>
To: "Zareef Ahmed" <[EMAIL PROTECTED]>
Cc: 
Sent: Sunday, February 05, 2006 8:39 AM
Subject: Re: [PHP] Reverse Engineering of Smarty


If you don't have backups, then:

 1: Why do you not have backups?
 2: Are you insane?
 3: What filesystem, and file recovery techniques have you
researched/attempted?
 4: Why do you not have backups?
 5: Are you insane?

NO I am not insane.. but it happens sometime...
I have recovered it from my file system

Zareef Ahmed

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



[PHP] Reverse Engineering of Smarty

2006-02-04 Thread Zareef Ahmed
Hi All, 

 Accidentally I got deleted all of my php code in one of my application, I was 
using smarty and its compiled directory has the code in its native format.

Is there any way so I can do some type of reverse engineering to bring back my 
original code?

Any suggestion?

Thanks in advance.

Zareef Ahmed

Re: [PHP] PHP6 Roadmap

2006-02-02 Thread Zareef Ahmed
Hi, 

 Please visit 
http://www.php.net/~derick/meeting-notes.html


- Original Message - 
From: "Yannick Warnier" <[EMAIL PROTECTED]>
To: "PHP General List" 
Sent: Wednesday, February 01, 2006 11:02 AM
Subject: [PHP] PHP6 Roadmap


> Hello,
> 
> Is a roadmap for PHP6 already available somewhere?
> 
> I've been looking for it on php.net and zend.com but haven't found
> anything yet, apart a few posts on the improvement of namespaces and
> unicode.
> 
> Thank you,
> Yannick
> 
> -- 

PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

> 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] private, public, protected in 4.3.11

2006-01-12 Thread Zareef Ahmed
Hi Peter,

   Code you are using is for php version 5. That is one in only reason.
You need to install PHP version 5 to run this code or just do it as simple
$var type declaration.

Zareef Ahmed

- Original Message - 
From: "Peter Lauri" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, January 12, 2006 1:28 AM
Subject: [PHP] private, public, protected in 4.3.11


> Hi,
>
>
>
> Example code that I try to run in version 4.3.11:
>
>
>
> Class Page {
>
> private $myID;
>
>
>
> function Page() {
>
> $this->myID=1;
>
> }
>
>
>
> function getID() {
>
> return $this->myID;
>
> }
>
>
>
> }
>
>
>
> But I get error message:
>
>
>
> Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or
> `T_VAR' or `'}'' in C:\Documents and Settings\Peter Lauri\My Documents\DWS
> Asia\webserver\ework\classes\page.class.php on line 8
>
>
>
> If I change to
>
> var $myID;
>
> it works.
>
>
>
> What is wrong?
>
>
>
> /Peter
>
>
>
>
>




PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

>
>
>

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



Re: [PHP] Re: Re: HAPPY NEW YEAR!!

2006-01-06 Thread Zareef Ahmed
France is so late ? ;)

zareef ahmed
- Original Message - 
From: "Michelle Konzack" <[EMAIL PROTECTED]>
To: 
Sent: Friday, January 06, 2006 1:37 PM
Subject: [PHP] Re: Re: HAPPY NEW YEAR!!


> A little bit late, but from France:
>
> Bonne Année!
>
> Greetings
> Michelle Konzack
> Systemadministrator
> Tamay Dogan Network
> Debian GNU/Linux Consultant
>
>
> -- 
> Linux-User #280138 with the Linux Counter, http://counter.li.org/
> # Debian GNU/Linux Consultant #
> Michelle Konzack   Apt. 917  ICQ #328449886
>50, rue de Soultz MSM LinuxMichi
> 0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)
>


PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]


> -- 
> 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] printing keys and values of array

2006-01-05 Thread Zareef Ahmed
read  about  "foreach"  function. 


Zareef Ahmd

- Original Message - 
From: "Ahmed Abdel-Aliem" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, January 05, 2006 7:58 PM
Subject: [PHP] printing keys and values of array


Hi
i need some help with printing an array, i would like to print the
keys and the values of them
example :

if i have an array like that


[EXTENDED] => Array
(
[RTCode] => CASE395
[ManuPartNum] => 1BRA1ACFB
[Colour] => WHITE
[Compatibility] => (ATX/E ATX)
[PowerSupply] => YES
[PowerSupplySize] => redundant 337W2
[ExtDriveBays] => 3 x 5.25 1 x 3.5
[IntDriveBays] => 6 x 5.25
[USBPortsFront] => no
[FirewirePortsFront] => no
[AudioPortsFront] => no
[CaseFan] => 8cm FAN2  12cm FAN1  P/S2
[NumCaseFans] => 5
[FreeCaseFanPoints] => No
[Material] => Stainless steel
[Window] => No
[Packaging] => Retail
[Warranty] => 24 months for the PSU
[BoxContents] => Manual
[CartonHeight] => 735mm
[CartonWidth] => 285mm
[CartonDepth] => 585mm
[ItemsPerCarton] => 1
[CartonWeight] => 1.6kg
[EAN] =>
[BoxWeight] =>
[ItemHeight] =>
[ItemWidth] =>
[ItemDepth] =>
)

and i like to print it this way

RTCode:CASE395
ManuPartNum] :1BRA1ACFB
Colour] :WHITE
Compatibility :(ATX/E ATX)
PowerSupply :YES
PowerSupplySize:redundant 337W2
ExtDriveBays:3 x 5.25 1 x 3.5
IntDriveBays:6 x 5.25
USBPortsFront:no
FirewirePortsFront:no
AudioPortsFront:no
CaseFan:8cm FAN2  12cm FAN1  P/S2
NumCaseFans:5
FreeCaseFanPoints] => No
Material :Stainless steel
Window :No
Packaging:Retail
Warranty:24 months for the PSU
BoxContents:Manual
CartonHeight:735mm
CartonWidth:285mm
CartonDepth:585mm
ItemsPerCarton:1
CartonWeight:1.6kg
EAN:
BoxWeight:
ItemHeight:
ItemWidth:
ItemDepth:

can anyone tell me plz how to do that ?
any help would be appreciated

thanks in advance

--
Ahmed Abdel-Aliem
Web Developer
www.SafariStudio.net
+20101108551
registered Linux user number 382789

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





PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

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



Re: [PHP] Reading body of page being recieved by another php page

2005-12-30 Thread Zareef Ahmed
Hi,

How you are sending the data to that script? It must be availble in $_POST,
$_GET, or $_REQUEST, depends how you are sending it.


Zareef Ahmed

- Original Message - 
From: "Jamie Kemp" <[EMAIL PROTECTED]>
To: 
Sent: Friday, December 30, 2005 8:57 PM
Subject: [PHP] Reading body of page being recieved by another php page


> I have data being sent to another php page containing xml styled data. Is
it
> possible to read that data into the script? I have looked into the the
> globals set but cannot see anything like waht im looking for.
>
> Does anyone have any ideas?
>
> Thanks
>
> Jamie



PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

>
> -- 
> 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] SELECT?

2005-12-28 Thread Zareef Ahmed
Hi,

As there are only 500 rows, there is not any harm in fetching all
records through one query and then do the update between while loop


$query="select * from table";
$result=mysql_query($query);

while($row=mysql_fetch_array($result))
{
$newquery="update YOUR STATEMENT where uniquefield like
$row['uniquefield']";
mysql_query($newquery);
}


if you really need to fetch only one record at a time, you can use the LIMIT
keyword in your SQL statement, and can create the script as needed.


Zareef Ahmed

- Original Message - 
From: "Christian Ista" <[EMAIL PROTECTED]>
To: "'William Stokes'" <[EMAIL PROTECTED]>; 
Sent: Wednesday, December 28, 2005 3:57 AM
Subject: RE: [PHP] SELECT?


> > From: William Stokes [mailto:[EMAIL PROTECTED]
> > I have one MySQL table with about 500 rows. I need to read the table one
> > row at a time, make some changes to data in one field and then store the
> > changed data to another table.
>
> 1. May be add a column, CHANGED_FL with default value N.
> 2. Select to find the ID minimum with a select CHANGED_FL is N
> 3. Select the row with the ID found above and make you business
> 4. Make change and change CHANGED_FL to Y
>
> Repeat operation 2 to 4
>
> C.
>



PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

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

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



Re: [PHP] PHP Frameworks

2005-12-23 Thread Zareef Ahmed
Hi,
There are a lot of  PHP frameworks like Mojavi, Phrame, php.MVC,
phpwebtk, Horde.

My choice is Mojavi.

BTW Zend is also doing some great work on it.

Zareef Ahmed



- Original Message - 
From: "Shawn McKenzie" <[EMAIL PROTECTED]>
To: 
Sent: Friday, December 23, 2005 2:57 PM
Subject: [PHP] PHP Frameworks


> Is there a good recent article on PHP Frameworks, or do people here has
> a predominant one that outshines the others?
>
> I'm looking for something that is easy to use, fast and stable.
>
> Thanks!
> -Shawn
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]


>

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



Re: [PHP] PHP is OK in IE but not in Netscape

2005-12-22 Thread Zareef Ahmed

- Original Message - 
From: "Nanu Kalmanovitz" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, December 22, 2005 4:22 AM
Subject: [PHP] PHP is OK in IE but not in Netscape


> Hi
>
> The http://www.kalmanovitz.co.il/hello.php file appears OK in M$-IE but
> not in Netscape 7.0.
Strange... Can you post the code, Well I check it with firefox it fine
there.

>
> How can I fix it?
>
> TIA
>
> Nanu



PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

>

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



Re: [PHP] AJAX Framework

2005-12-19 Thread Zareef Ahmed

Hi,

   You can try  pear package HTML_AJAX

http://pear.php.net/package/HTML_AJAX

Zareef Ahmed

- Original Message - 
From: "Erfan Shirazi" <[EMAIL PROTECTED]>
To: ; "Niklas Palmqvist" <[EMAIL PROTECTED]>
Sent: Monday, December 19, 2005 6:04 AM
Subject: [PHP] AJAX Framework


> Hi all
>
>
> Just wanted to get some feedback on which AJAX Framework people uses?
> I use SAJAX, is there anybody which maybe has used SAJAX but are now
> using something else instead, maybe somebody knows some better frameworks?
>
> Best Regards,
> /Erfan
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>




PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]


>

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



Re: [PHP] How to get a unixtime with micro/mille seconds

2005-12-19 Thread Zareef Ahmed
Hi, 

  use microtime function.

Zareef Ahmed 

- Original Message - 
From: "Mathijs" <[EMAIL PROTECTED]>
To: 
Sent: Monday, December 19, 2005 5:58 AM
Subject: [PHP] How to get a unixtime with micro/mille seconds


> Hello,
> 
> I Want to have a unique time stamp.
> And for this i want to use the normal timestamp but it is possible that 
> the seconds are the same, so i want to add the micro/milli seconds to 
> the end of it.
> 
> So when i have something like this as unixtime "1134989511"
> It wil be "113498951100" or even "1134989511".
> Where 00(00) will be the micro/milli time.
> 
> Is there a simple way to get this?
> 
> Thx in advanced.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 




PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

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



Re: [PHP] Load from db into -list

2005-12-18 Thread Zareef Ahmed


Hi,

  Using AJAX or JSRS you can do this.
See
http://www.ashleyit.com/rs/main.htm

Zareef Ahmed


- Original Message - 
From: "Gustav Wiberg" <[EMAIL PROTECTED]>
To: "PHP General" 
Sent: Sunday, December 18, 2005 2:28 PM
Subject: [PHP] Load from db into -list


> Hi there!
>
> Is it possible to load a -list with databasinfo without reloading
a
> page???
>
> /G
> http://www.varupiraten.se/
>
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

>

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



Re: [PHP] Someone please help me with this PHP script.

2005-12-18 Thread Zareef Ahmed
Hi Johnson,

   I am glad to know about you. In my view, PHP is one of easiest
language of world. Only one problem for beginners is the numbers of
functions in it , PHP has more than 4500 functions, ( infact, it is the
strength of PHP), so they face problems when every other person tell them
about a new function to do the same thing, but it is the part of  learning.
You just need to read something more about PHP  on sites like php.net or
w3schools.

One suggestion, first try to find out the solution of your problems, by
yourself  through  searching on the internet and old archive of  discussion
lists, because some time you may get very bad (!)  response from the group
members if you are asking very easy or normal questions.

Zareef Ahmed


- Original Message - 
From: "Erik Johnson" <[EMAIL PROTECTED]>
To: 
Sent: Sunday, December 18, 2005 10:59 AM
Subject: Re: [PHP] Someone please help me with this PHP script.


Thank you very much.  My dad is in college, but I have been teaching myself
HTML, Java, VB6, and PHP.  I've been learning to do graphical artwork with
Adobe Illustrator, and Photoshop.  I actually started programming before my
dad was in school, and I got him started I guess!  Anyway; I've learnt a
lot, and I hope to learn more, as I'm trying to make an online MMORPG /
ORPG.

Back on topic:  I looked IsSet() on PHP.net, but it didn't give that fluent
of an explanation.  Thanks!  I'll be sure to try it out.  If someone tries
my php script, and wants to make any changes, please just upload it to
ftp://lom.game-host.org/ .

Thanks again,

Erik Johnson



PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

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



Re: [PHP] Someone please help me with this PHP script.

2005-12-18 Thread Zareef Ahmed

- Original Message - 
From: "M. Sokolewicz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "PHP LIST" 
Sent: Sunday, December 18, 2005 4:34 AM
Subject: Re: [PHP] Someone please help me with this PHP script.


> Aside from the 20 suggestions you've already got, let me add this one:
> elseif( ($page != "one") or ($page != "two") or ($page != NULL) ) {
>
>   Echo "Undefined!page isn't
>   defined correctly!";
>   }
>
> is useless code. Why?
> $page = null; never happens (you made sure of that further up the page).
> $page = "one"; never happens (you already pulled that one out earlier).
> $page = "two"; never happens (you already pulled that one out earlier).
>

Johnson, make a note of it.

you can also read about "switch" statement.

Zareef Ahmed

> So... if *any* of those returns true you show an error... may I suggest
> just changing it to an else instead? a lot more logical(!).
> Besides that, were you to move this to its own if() you'd notice it
> would always display because if the page is "one" it *can not* be "two"
> or null, and will thus be displayed. Which means that you'd have an
> error which would always display...
>
> oh well, ignore my rant and first make sure to follow the suggestions
> provided by others
>
> - tul
> Wolf wrote:
> > What is it doing, or not doing?
> >
> > Try changing the  >
> > Robert
> >
> > Erik Johnson wrote:
> >
> >>I do not know why this isn't working, but it would be very helpful if
> >>someone looked over it.
> >>
> >> >>$defaultpage = "http://lom.game-host.org/uploads/erik/";;
> >>
> >>If($page == NULL) {
> >>$page = "one";
> >>}
> >>
> >>if($page == "one") {
> >>Echo "Page OneIt
works!! >>href=\"" . $defaultpage .
"index.php?page=two\">Nice...";
> >>}
> >>
> >>elseif($page == "two") {
> >>Echo "Page TwoThis is page "
.
> >>$page . " --  >>?page=\">;D";
> >>}
> >>
> >>elseif( ($page != "one") or ($page != "two") or ($page != NULL) ) {
> >>Echo "Undefined!page isn't
> >>defined correctly!";
> >>}
> >>
> >>if($page == "") {
> >>Echo "Main
> >>Page..";
> >>}
> >>?>
> >>
> >>Thank you,
> >>
> >>Erik Johnson
> >>
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]


>

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



Re: [PHP] Someone please help me with this PHP script.

2005-12-18 Thread Zareef Ahmed

- Original Message - 
From: "Erik Johnson" <[EMAIL PROTECTED]>
To: 
Sent: Sunday, December 18, 2005 10:41 AM
Subject: Re: [PHP] Someone please help me with this PHP script.


I was wondering.. how exactly does the isset function work?  I saw that
Robert Cummings wrote:

$page = isset( $_GET['page'] ) ? $_GET['page'] : null;

What exactly does that mean?


isset function checks if a given variable is set or not, in above line of
code you are seeing its use with operator (?).

What it will do:
It will check if there is any variable with named $_GET['page'], it is true
then it will assign the value of $_GET['page'] to $page variable, otherwise
it will be set to null value.

You are 14?? Welcome to the wonderfull world of PHP programming.

Zareef Ahmed





PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

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



Re: [PHP] insert to DB

2005-12-18 Thread Zareef Ahmed
Hi,

   I think you should read a beginner tutorial about SQL. there are just
four things Insert, Delete, Update and select, that need to be known for
working with database in normal conditions, after that you can move to
create, drop, alter or much more like joins etc.

http://www.lmpx.com/mysql_ref.php


Zareef Ahmed



- Original Message - 
From: "Anasta" <[EMAIL PROTECTED]>
To: 
Sent: Sunday, December 18, 2005 7:41 AM
Subject: [PHP] insert to DB


> It just wont insert new data into DB--any ideas as i have gone over and
> over.
>
>
>
>  mysql_connect("localhost","anasta","silteren");
>
> mysql_select_db("mytipperv1");
>
> if(!isset($cmd))
> {
>$result = mysql_query("select * from leaderboard order by ID");
>
>while($r=mysql_fetch_array($result))
>
>{
>   //grab the title and the rating of the entry
>   $id=$r["ID"];//take out the id
>$Name=$r["Name"];//take out the Name
>$Rating=$r["Rating"];//take out the Rating
>
>
> echo "$Name  Edit";
>
>
> }
> }
> ?>
>  if($_GET["cmd"]=="edit" || $_POST["cmd"]=="edit")
> {
>if (!isset($_POST["submit"]))
>{
>   $id = $_GET["ID"];
>   $sql = "SELECT * FROM leaderboard WHERE ID=$id";
>   $result = mysql_query($sql);
>   $myrow = mysql_fetch_array($result);
>   ?>
>
>   
>   ">
>
>   Name:  ?>" SIZE=15 maxlength="15">
>   Rating: " SIZE=3 maxlength="3">
>   
>   
>   
>
> 
> if ($_POST["$submit"])
>{
>   $Name = $_POST["Name"];
>$Rating = $_POST["Rating"];
>
>$sql = "UPDATE leaderboard SET Name='$Name', Rating='$Rating' WHERE
> ID=$id";
>   //replace news with your table name above
>   $result = mysql_query($sql);
>   echo "Thank you! Information updated.";
>  }
> }
> ?>
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>


PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

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



Re: [PHP] Someone please help me with this PHP script.

2005-12-18 Thread Zareef Ahmed
Hi Johnson,

what is not working in this code?
what is the problem? It will always execute the first part of if condition,
i.e.
It will print

Page OneIt works!!http://lom.game-host.org/uploads/erik/index.php?page=two";>Nice...<
/body>

What you are expecting from this script?


One recommendation, it is better to use isset  function to check if variable
has been set or not.

Zareef Ahmed

- Original Message - 
From: "Erik Johnson" <[EMAIL PROTECTED]>
To: 
Sent: Saturday, December 17, 2005 11:05 PM
Subject: [PHP] Someone please help me with this PHP script.


I do not know why this isn't working, but it would be very helpful if
someone looked over it.

http://lom.game-host.org/uploads/erik/";;

If($page == NULL) {
$page = "one";
}

if($page == "one") {
Echo "Page OneIt works!!Nice...";
}

elseif($page == "two") {
Echo "Page TwoThis is page " .
$page . " -- ;D";
}

elseif( ($page != "one") or ($page != "two") or ($page != NULL) ) {
Echo "Undefined!page isn't
defined correctly!";
}

if($page == "") {
Echo "Main
Page..";
}
?>

Thank you,

Erik Johnson




PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

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



Re: [PHP] EXPORT DATA

2005-12-13 Thread Zareef Ahmed
- Original Message - 
From: "Aftab Alam" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, December 13, 2005 11:20 PM
Subject: [PHP] EXPORT DATA


> Hi all,
> 
> How can i export excel data to PostgresSQL using PHP.
> 
http//ww.phpclasses.org is good place to search. you can go there.

Zareef Ahmed
> regards
> aftab
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

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



Re: [PHP] 1 ip address go here all others go here

2005-12-13 Thread Zareef Ahmed
Hi Dave,

You can look for the value of $_SERVER['REMOTE_ADDR'], and then you can
serve users as per your preferences.

Zareef Ahmed

- Original Message - 
From: "Dave Carrera" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, December 13, 2005 11:06 AM
Subject: [PHP] 1 ip address go here all others go here


> Hi List,
>
> Is there a way of sending users with a local ip address say 127.0.0.1
> and 192.168.xxx.xxx to goto one page and all other visitors to goto
another?
>
> Kind Regards
>
> Dave C
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>


PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

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



Re: [PHP] IE6 not returning POST data from a textarea

2005-12-12 Thread Zareef Ahmed

- Original Message - 
From: "Al" <[EMAIL PROTECTED]>
To: 
Sent: Monday, December 12, 2005 12:16 PM
Subject: [PHP] IE6 not returning POST data from a textarea


> Anyone know to get IE6 to return POST data from a textarea when the text
is pasted in?
>
Can you explain what exactly you are doing?  print_r($_POST) should show the
all values of the form including a textarea.

What do you mean by "pasted in"?

Zareef Ahmed



> Works fine for Mozilla, etc.
>
> print_r($_POST) shows several  and  values just fine.
>
> Thanks
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>


PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

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



Re: [PHP] Moving code from a specific file to a generic one

2005-12-11 Thread Zareef Ahmed
Hi MARG,

It will be better if you can provide the code here and what error you are
getting.

BTW  header function is the key here.

Zareef Ahmed



- Original Message - 
From: "Miles Thompson" <[EMAIL PROTECTED]>
To: 
Sent: Sunday, December 11, 2005 12:33 PM
Subject: Re: [PHP] Moving code from a specific file to a generic one


> At 10:31 AM 12/11/2005, MARG wrote:
> >Hi,
> >
> >I have this source code in this randomImage.php file (see source):
> >http://www.tuxdoit.com/randomImage.phps
> >
> >This generates a random image for form validation.
> >Now, as you can see, i call the picture from
> >http://www.tuxdoit.com/newslwetter.php
> >as
> >
> >and that works just fine.
> >
> >But... i'd like to include the source code of randomImage.php in a
> >generic functions.php file along with others.
> >
> >My problem is i'm not being able to do that.
> >
> >If i move the code to functions.php, what modifications must be made to
> >the image generation code and how do i call it from newsletter.php ?
> >
> >I've already tried to make it a function, of course, but no good :(
> >I'm driving nuts with this :(
> >
> >Any help would be apreciated.
> >
> >Warm Regards,
> >MARG
>
> "not able to do that" - what happens? What error messages do you get? Or
> does nothing happen?
>
> What is  the scope of $image? Have you recognized it as a global within
the
> function, and declared it external to the function?
>
> Have you deconstructed randomImage and built it up incrementally within
> function.php?
>
> Could it be that if you try and include it in functions.php there is
output
> somewhere sent to the browser before the header() and session_start()
> functions are called?
>
> Finally, what's wrong with calling it as you do at present? Flash
> programmers are forced into that model for every class they create. It
must
> be an independent .as file, with the same name as the function, and contai
n
> code only for properties and methods of that function.
>
> HTH - Miles Thompson
>
> -- 



PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]
>

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



Re: [PHP] simple-ish question but something i never knew

2005-12-10 Thread Zareef Ahmed

- Original Message - 
From: "Robert Cummings" <[EMAIL PROTECTED]>
To: "Zareef Ahmed" <[EMAIL PROTECTED]>
Cc: "Aaron Koning" <[EMAIL PROTECTED]>; "PHP-General"

Sent: Saturday, December 10, 2005 11:40 AM
Subject: Re: [PHP] simple-ish question but something i never knew


> On Sat, 2005-12-10 at 11:08, Zareef Ahmed wrote:
> >
> > Yes indeed, but normally people do not know about this.
> > Alternatively we can reverse the script, I mean,  we can write the
header
> > line as first line of script.
>
> Maybe so, but if you don't know to plug the power saw in, you're not
> going to get much sawing done either.

I agree.  I was just informing the group about the problem Aaron may have
with header function.

Zareef Ahmed

>
> Cheers,
> Rob.
> -- 
> ..
> | InterJinn Application Framework - http://www.interjinn.com |
> ::
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for   |
> | creating re-usable components quickly and easily.  |
> `'
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]


>

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



Re: [PHP] simple-ish question but something i never knew

2005-12-10 Thread Zareef Ahmed
- Original Message - 
From: "Robert Cummings" <[EMAIL PROTECTED]>
To: "Zareef Ahmed" <[EMAIL PROTECTED]>
Cc: "Aaron Koning" <[EMAIL PROTECTED]>; "PHP-General"

Sent: Saturday, December 10, 2005 11:03 AM
Subject: Re: [PHP] simple-ish question but something i never knew


> On Sat, 2005-12-10 at 10:45, Zareef Ahmed wrote:
> > - Original Message - 
> > From: "Robert Cummings" <[EMAIL PROTECTED]>
> > To: "Aaron Koning" <[EMAIL PROTECTED]>
> > Cc: "PHP-General" 
> > Sent: Saturday, December 10, 2005 3:07 AM
> > Subject: Re: [PHP] simple-ish question but something i never knew
> >
> >
> > > On Sat, 2005-12-10 at 03:01, Aaron Koning wrote:
> > > > My experience was with the Location keyword, it might work better
with
> > the
> > > > Redirect keyword in the header function. I stopped using header and
> > Location
> > > > after a few problems and  has never failed for me. MHO.
> > >
> >
> > > What kind of problems did you have? I've never experience a problem
with
> > > the location header, but would be interested to know of any gotchas
that
> > > I've just been fortunate enough to miss over the years.
> >
> > I do not think that using meta is better than header but  header has one
> > problem ( but in my view it is  feature) normally.
> > for eaxample:
> >
> >  > session_start();
> >
> > $_SESSION['somevar']="anything";
> > header("location:url");
> > ?>
>
> Shouldn't be a problem if you change it to:
>
>  session_start();
>
> $_SESSION['somevar']="anything";
> session_write_close();
>
> header("location:url");
>
> ?>
Yes indeed, but normally people do not know about this.
Alternatively we can reverse the script, I mean,  we can write the header
line as first line of script.


Zareef Ahmed


>
> I generally wrap redirection in a function, that way any shutdown
> routines can be performed transparently -- and also the URL can be
> reworked from relative to absolute.
>
> Cheers,
> Rob.
> -- 
> ..
> | InterJinn Application Framework - http://www.interjinn.com |
> ::
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for   |
> | creating re-usable components quickly and easily.  |
> `'
>
>


PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

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



Re: [PHP] simple-ish question but something i never knew

2005-12-10 Thread Zareef Ahmed


- Original Message - 
From: "Robert Cummings" <[EMAIL PROTECTED]>
To: "Aaron Koning" <[EMAIL PROTECTED]>
Cc: "PHP-General" 
Sent: Saturday, December 10, 2005 3:07 AM
Subject: Re: [PHP] simple-ish question but something i never knew


> On Sat, 2005-12-10 at 03:01, Aaron Koning wrote:
> > My experience was with the Location keyword, it might work better with
the
> > Redirect keyword in the header function. I stopped using header and
Location
> > after a few problems and  has never failed for me. MHO.
>

> What kind of problems did you have? I've never experience a problem with
> the location header, but would be interested to know of any gotchas that
> I've just been fortunate enough to miss over the years.

I do not think that using meta is better than header but  header has one
problem ( but in my view it is  feature) normally.
for eaxample:




In this script  session variable will not be set and will not available on
other
pages, because sessions also works with headers and headers executed (sent)
in
reverse order.
Am I correct?

Aaron, you was having problems with sessions na ?

Zareef Ahmed



>
> Cheers,
> Rob.
> -- 
> ..
> | InterJinn Application Framework - http://www.interjinn.com |
> ::
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for   |
> | creating re-usable components quickly and easily.  |
> `'
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


PHP Expert Consultancy in Development  http://www.indiaphp.com
Yahoo! : consultant_php MSN : [EMAIL PROTECTED]

>

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



Re: [PHP] PHP/MySql noob falls at first hurdle

2005-12-09 Thread Zareef Ahmed
Hi Paul,
 Why you are closing your connection before finishing your work on
the database?

Zareef Ahmed



- Original Message - 
From: "Paul Jinks" <[EMAIL PROTECTED]>
To: 
Sent: Friday, December 09, 2005 6:50 AM
Subject: [PHP] PHP/MySql noob falls at first hurdle


> Hi all
>
> I've been asked to put simple database interactivity on an academic
> site. They want users to enter a few details of their projects so other
> researchers can search and compare funding etc. How difficult can that
> be, I thought
>
> I've built the database in MySQL and entered some dummy data, and I'm
> now trying in the first place to get the data to display with a simple
> select query to display the variable "projTitle" from the table
> "project" thus:
>
> 
> 
> 
> $SQLquery = "SELECT projTitle FROM project";
> $result = mysql_query($SQLquery)
> or die ("couldn't execute query");
> mysql_close($connect)
>
> ?>
>
> 
> Result of 
>
> 
>  while($ouput_row = mysql_fetch_array($result)) {
> ?>
> 
>  }
> ?>
>
> 
> 
>
> When I view the page I get this:
>
> Result of SELECT projTitle FROM project
>
> 
> 
> 
> 
> 
>
>
> 
>
> There are indeed 4 entries in the database, but I can't figure out why
> it's not displaying the data. It worked fine on my "PHP/Mysql-in-a-box"
> course. No, we didn't study the syntax :(
>
> Any help gratefully received.
>
> Thanks
>
> Paul
>
> -- 
> 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] Test Mail please igonre it

2005-10-02 Thread Zareef Ahmed
--
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


Re: [PHP] PHP 5 Hosting

2005-10-02 Thread Zareef Ahmed
On 9/30/05, Tom Chubb <[EMAIL PROTECTED]> wrote:

> This is an interesting one.
> As someone learning PHP, I am still confused which route I should be going
> down?
> Especially as I am looking to take on a dedicated server soon, I don't
> know if PHP5 will become standard soon or are we going to see PHP6
> first??!?

 It is a really serious problem, PHP 5 have so much good things specially in
terms of XML that I just want to use them in my programmes but whenever I
decide to do programming in PHP 5, I stuck on the choice of a good server.
Most of the Hosting service providers are still providing hosting in PHP 4.
 I think PHP is going through a very tough phase. It has got the
capabilities but we can not use them, thats why we can SAY that PHP is good
programming language But we can not PROVE that in practically.
 Well the original posting was about hosting service provider, somewhere I
read about HOSTWAY. they are in PHP 5 hosting.
  Zareef Aahmed

Please can some more experienced people let me have their views on this?
> Many thanks,#
> Tom
>
> On 30/09/05, Joe Wollard <[EMAIL PROTECTED]> wrote:
> > The first two results both seem pretty good at a glance:
> >
> > http://www.google.com/search?hl=en&q=php5+ssh+hosting&btnG=Google+Search
> >
> >
> >
> > On Sep 29, 2005, at 8:29 PM, Ed Lazor wrote:
> >
> > > Any recommendations on good host providers for PHP 5? Bonus points
> > > if they support SSH access and a PHP compiler like Zend.
> > >
> > > Thanks,
> > >
> > > Ed
> > >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> Tom Chubb
> [EMAIL PROTECTED]
> 07915 053312
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


[PHP] Test Emai --- Please igonre

2005-10-02 Thread Zareef Ahmed
This is a test mail. Please igno
re it --
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net


Re: [PHP] PHP based project management

2005-05-05 Thread Zareef Ahmed
Hi, 

Look for phpcollab.

zareef ahmed 



On 5/4/05, Neal Carmine <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> There are a lot of open source project management packages. .Project,
> netoffice and others. Does anyone have a recommendation on the best overall
> project management software for tracking billable software projects?
> 
> Thanks,
> 
> Neal
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] Retrieve URL of website

2005-04-01 Thread Zareef Ahmed
HI, 

 Look for $_SERVER['REQUEST_URI'];



But Dear first you should search the documentation , it is very easy
to notice if you can use phpinfo();


zareef ahmed 


On Apr 2, 2005 8:12 AM, HarryG <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I want to retrieve the complete url in my php script. How can I do this?
> 
> eg. www.mysite.com/mydirectory/mypage.php
> 
> Result should either be www.mysite.com/mydirectory/mypage.php or 
> /mydirectory/mypage.php
> 
> Thanks in advance
> HarryG
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] Catching error from mail function?

2005-04-01 Thread Zareef Ahmed
Hi,

First of all set error reporting to E_ALL, you may  get the error string.

zareef ahmed  


On Apr 1, 2005 8:30 AM, Ben Cheng <[EMAIL PROTECTED]> wrote:
> Hi I'm using the mail() function to send email and I know it's failing
> because it's returning a false but how do I tell what problem is?  Is
> there an error message that I can grab that will show me why the
> function is returning false?  Any help greatly appreciated.  Thanks!
> 
> -Ben
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] booking

2005-04-01 Thread Zareef Ahmed
Hi , 

read about  uniqid() function, it may be usefull.

zareef ahmed 

On Apr 1, 2005 12:03 PM, Rob Agar <[EMAIL PROTECTED]> wrote:
> hey up all,
> 
> anyone have a snippet for generating a unique booking reference string,
> say 6-10 characters long?  The kind of thing you get when you book a
> flight or whatnot online.
> 
> it's friday afternoon and I'm too dim to figure one out myself :-/
> 
> Rob Agar
> Web Site Consultant
> Wild Lime Media - [EMAIL PROTECTED]
> Studio 1, 70 McLeod Street, Cairns 4870
> Tel: 07 4081 6677  |  Fax: 07 4081 6679
> 
> Web and Software Development Services  - www.wildlime.com
> Search Engine Optimisation Services - search.wildlime.com
> Professional Website Hosting Services -www.hostonlime.com.au
> 
> Winner 2004 Telstra North QLD Media Awards - Best Website - Online
> Content & Information
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] strange problem, seems to be related to the character '$'

2005-03-31 Thread Zareef Ahmed
Hi Chris, 

 I tried to reproduce the problem with vertsoin 4.3.3 and 5, and its
working fine(producing same string).
If you have not find a bug in bug database why not submit  a new bug?

anyway changing single quotes to double may help ;)


zareef ahmed 
 

On Apr 1, 2005 2:36 AM, Chris Francy <[EMAIL PROTECTED]> wrote:
> Hello all,
> 
> I am hoping someone can point me in the right direction to resolving an odd
> bug.  I tried searching the bugs database and groups, but I can't think of
> the terms to use while searching for my problem that the search system will
> accept.
> 
> I have a script like the below, copied from the crypt manual page
> ---
>  '$1$rasmusle$')); } ?>
> ---
> 
> On my main web server, which is running php 4.3.10 with apache this script
> produces the following when I view the page on the web
> ---
>  string(13) "$1Hat1hn6A1pw"
> ---
> 
> When I run the script from the command line [php test.php] on the exact same
> server I get
> ---
> string(34) "$1$rasmusle$rISCgZzpwk3UhDidwXvin0"
> ---
> 
> I have also occasionaly seen some odd behavior where strings with dollar
> symbols $ in them won't print out correctly, but they have never seen that
> important..  Does anyone have any guesses, or hints about what the next step
> is to search for what is causing this odd behavior?  Any suggestions about a
> better place to ask?
> 
> Thanks for any help
> 
> Chris Francy
> [EMAIL PROTECTED]
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



[PHP] Cleints Machine's Network Properties(NetMask, Default Gateway)

2005-03-31 Thread Zareef Ahmed
Hi All,

Is it possible to get client's machines network properties like
Netmask, Default gateway, I can get  the IP address, but unable to get
other details.

zareef ahmed

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



Re: [PHP] Class/object storing itself in a database

2005-03-14 Thread Zareef Ahmed
On Mon, 14 Mar 2005 12:11:40 -0800, Robby Russell <[EMAIL PROTECTED]> wrote:
> On Mon, 2005-03-14 at 14:07 -0600, Chris Boget wrote:
> > I have the following Class:
> >
> > class MyClass {
> >   function store_myself() {
> > $query = 'INSERT INTO mytable ( myfield ) VALUES ( ' . $this . ')';
> > $result = mssql_query( $query );
> >   }
> > }
> >
> > which works.  Kind of.  What I expected was a serialized copy of the
> > object to be stored in the column myfield.  However, what I am actually
> > seeing is simply the word 'Object'.
> >
> > How can I get it so that the serialize copy is stored so that I can retrieve
> > that copy later and use it as a PHP object?
> >
> > thnx,
> > Chris
> >
> 
> Try serializing it first.
> 
> What happens when you run:
> 
> echo $this;
> 
> ..your query is going to save the same thing.
> 
> try serialize($this) instead.

and do not forgot to unserialize($fieldvalue) ;)

zareef ahmed 


> 
> -Robby
> 
> --
> /***
> * Robby Russell | Owner.Developer.Geek
> * PLANET ARGON  | www.planetargon.com
> * Portland, OR  | [EMAIL PROTECTED]
> * 503.351.4730  | blog.planetargon.com
> * PHP, Ruby, and PostgreSQL Development
> * http://www.robbyonrails.com/
> /
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] Classes code completion and Zend Studio

2005-03-14 Thread Zareef Ahmed
On Mon, 14 Mar 2005 23:30:51 +, Alister Bulman <[EMAIL PROTECTED]> wrote:
> On Mon, 14 Mar 2005 19:14:37 +0530, Zareef Ahmed <[EMAIL PROTECTED]> wrote:
> > Hi All,
> >
> >  I have a function to load the classes and return the object.
> >
> > function LoadClass($ClassName)
> > {
> > require_once("Class.$ClassName.inc");
> > return new $ClassName();
> > }
> 
> With it being a require, won't it always be loaded, whether
> theLoadClass functon is called or not?  'Include/include_once' loads
> on demand, but right now thats effectively the same as
> require_once("Class.$ClassName.inc");
> function LoadClass($ClassName) {
>   return new $ClassName();
> }
> isn't it?
> 
QUOTE From PHP Documentation at php.net 
"require() and include() are identical in every way except how they
handle failure. include() produces a Warning while require() results
in a  Fatal Error."


"NOTE: This function changed how it worked.  In PHP 3 this behaved
very differently than it does on PHP
4"

 http://in.php.net/require/

Zareef Ahmed 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



[PHP] Re: Classes code completion and Zend Studio

2005-03-14 Thread Zareef Ahmed
On Mon, 14 Mar 2005 10:28:06 -0800, Jamie Alessio
<[EMAIL PROTECTED]> wrote:
> > I have a function to load the classes and return the object.
> >
> > function LoadClass($ClassName)
> > {
> > require_once("Class.$ClassName.inc");
> > return new $ClassName();
> > }
> >
> > Its working fine.
> >
> > But Zend Studio's Code completion is not working for this type of
> > object, Any hints?
> >
> Zareef,
> In Zend Studio 4.0 (not sure about earlier versions) you can use a
> "class type hint" to let the editor know what type of object you are
> working with. This is especially useful when you are using factory
> methods to create objects (as I often do with PEAR DataObjects) or have
> a setup similar to the above. The documentation for this in the studio
> distribution appears to be broken because it says something like "See
> below for example" but there is actually no example (I filed a bug with
> Zend about this). Butm, if you dig through he "Quick Tips" you can find
> the example which is where I first came across it.
> 
> Here's how I use it for DataObjects:
> --
> $user_obj =& DB_DataObject::factory('User');
> /* @var $user_obj DataObjects_User */
> $user_obj->youShouldHaveCodeCompletionNowForThisObject();
> --
> 
> In your example it would be something like:
> --
> $user_obj = LoadClass('user');
> /* @var $user_obj user */
> $user_obj->youShouldHaveCodeCompletionNowForThisObject();
> --

Yes Jamie  It works.
Thanks a lot 

zareef ahmed 
> 
> You'll need to make sure that Zend Studio knows to look through the file
> that contains the class that you are dynamically loading. I think you
> can do this if your code is withint a "project" and you specify it with
> "Add to Project".
> 
> - Jamie
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] Classes code completion and Zend Studio

2005-03-14 Thread Zareef Ahmed
On Mon, 14 Mar 2005 09:03:00 -0800 (PST), Richard Lynch <[EMAIL PROTECTED]> 
wrote:
> 
> > Hi All,
> >
> >  I have a function to load the classes and return the object.
> >
> > function LoadClass($ClassName)
> > {
> > require_once("Class.$ClassName.inc");
> > return new $ClassName();
> > }
> >
> > Its working fine.
> >
> > But Zend Studio's Code completion is not working for this type of
> > object, Any hints?
> 
> You could file a bug report with Zend for starters.
> 
> In the meantime, you could *maybe* set things up so that in your
> development environment, you load all the classes with a static
> "require_once" and then the class definitions will be there.
> 
>if ($DEVELOPMENT_SERVER){
> require_once "Class.foo.inc";
> require_once "Class.bar.inc";
>   }
> ?>
> 
> It will slow things down a bit, loading classes you don't need, but
> hopefully Zend Studio will pick up on all the classes that way.
Yes Zend Studio works fine in this way. Actually function was created
to load only needed classes at run time  a PHP4 version of  PHP5's 
__autoload function.

zareef ahmed

> 
> --
> Like Music?
> http://l-i-e.com/artists.htm
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



[PHP] Classes code completion and Zend Studio

2005-03-14 Thread Zareef Ahmed
Hi All,

 I have a function to load the classes and return the object.

function LoadClass($ClassName)
{
require_once("Class.$ClassName.inc");
return new $ClassName();
}

Its working fine.

But Zend Studio's Code completion is not working for this type of
object, Any hints?



Zareef Ahmed

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



Re: [PHP] Can't figure mail & post out

2005-03-07 Thread Zareef Ahmed
On Mon, 7 Mar 2005 10:02:32 +0530, anirudh dutt <[EMAIL PROTECTED]> wrote:
> On Mon, 7 Mar 2005 08:37:52 +0530, Zareef Ahmed <[EMAIL PROTECTED]> wrote:
> > Hi Robert,
> >
> >  Please take a look at php manual and try to know something about
> > $_POST, $_GET etc.
> > Your code is full of errors.
> >
> >
> > On Sun, 6 Mar 2005 15:33:30 -0500, Robert <[EMAIL PROTECTED]> wrote:
> > >  $sendto = "$row[1]";
> > >   echo "Row one output = $sendto";
> > >   mail ($_POST['sendto'],'Testing', $body, $headers);
> > Again you are sending the mail to same person very time.
> 
> no, that part is correct.

Dear Anirudh,
 Yes syntax is correct but receipent field is looking for the value in
$_POST and programe  is intended to  send the emails to users in the
database.


> while ($row = mysql_fetch_array ($result, MYSQL_NUM)) {
> ...
>  mail ($_POST['sendto'],'Testing', $body, $headers);
>  echo "Sent to $row[1]";} // <--*
$row['1'] is correct but it was not used as the reciepent.


zareef ahmed 

>  mysql_free_result ($result);
> 
> * the values are retrieved and used in the loop, the mail IS going to
> the right person.
> 
> > >  $headers = "MIME-Version: 1.0\r\n";
> > >  $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
> > >  $headers .= "From: ";
> > From is not set, value is not here.
> 
> this is the part that's causing the problem. u can leave it empty and
> let the system put the admin's email id. don't leave it incomplete
> though.
> 
> i agree that there are logical errors regarding the data he's used,
> but that's not why it didn't work.
> 
> @Robert: u may want to print/echo all the vars for mail() before using
> it, helps to debug. check all $POST vars too. this is how i generally
> set the headers:
> $headers = "From: $fname <$from_email>\n"."Return-Path: $ret"."\n";
> 
> i use return path so that bounce messages/delivery failures go to another id.
> 
> if u want to add the X-Mailer header:
> $headers.= 'X-Mailer: PHP/' . phpversion()."\n";
> (note  ^^^ the dot)
> 
> if still doesn't work, replace ur \r\n with \n. check manual page for details.
> 
> considering that u're possibly mass mailing...
> http://us2.php.net/manual/en/function.mail.php
> [quote]
> Note:  It is worth noting that the mail() function is not suitable
> for larger volumes of email in a loop. This function opens and closes
> an SMTP socket for each email, which is not very efficient.
> 
> For the sending of large amounts of email, see the PEAR::Mail, and
> PEAR::Mail_Queue packages.
> [/quote]
> u could also open a pipe to the mail program...
> http://www.devarticles.com/c/a/PHP/Getting-Intimate-With-PHPs-Mail-Function/2/
> 
> hth
> 
> --
> ]#
> Anirudh Dutt
> 
> ...pilot of the storm who leaves no trace
> like thoughts inside a dream
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] Newbie Question re substr

2005-03-07 Thread Zareef Ahmed
On Mon, 7 Mar 2005 22:23:19 -0500, Jackson Linux
<[EMAIL PROTECTED]> wrote:
> Hi,
> I'm really new and getting lots of help but need some assistance.
> 
> I'm running a script which gets specific articles from a database if
> they're entered in the URL after the ? . For instance if someone asks
> for
> 
> www.foo.com/index.htm?a=1234
> 
> then the script would look for an database entry with the id of 1234
> and display it in the page.
> 
> If there's no number specified (www.foo.com/index.htm) or if the number
> given is to an article which doesn't exist, it gets the titles of all
> the articles available and prints them as links to the proper article
> number.
> 
> I'd also like it to grab the first 200 characters of text from the
> $content field of the entry.
> 
> With help I have the title link part and I suspect I'm close but I keep
> messing up the syntax
> 
> The code is:
> 
> 
> 
> if (!empty($where)) {
> 
> echo "
>  ";
>   $article = mysql_fetch_assoc($result);
> } else {
> while ($article = mysql_fetch_assoc($result)) {
>   $table_of_contents[] = "
>  title='{$article['title']}'>{$article['title']}
> $article['content'] = substr($article['content'], 0 200);";

change these two lines to 

title='{$article['title']}'>{$article['title']}".
substr($article['content'], 0, 200)."";

zareef ahmed 


> }
> }
> 
> echo "
>  ";
> 
> 
> 
> Can anyone help ?
> 
> Thanks in advance!
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] Can't figure mail & post out

2005-03-06 Thread Zareef Ahmed
Hi Robert, 

 Please take a look at php manual and try to know something about
$_POST, $_GET etc.
Your code is full of errors.


On Sun, 6 Mar 2005 15:33:30 -0500, Robert <[EMAIL PROTECTED]> wrote:
> Hi -
> 
> I am very new to php and can't get this to work right.  It keeps telling me
> there is no send header.  I have tried multiple variations?  Any ideas?  I
> am simply trying to query the database and send out an email to each person
> in my database.
> 
> Thanks,
> Robert
> 
> $query = "SELECT first_name, email FROM offer";
> $result = @mysql_query ($query);
> 
> if ($result) {
>   echo 'Mailing List...';
>   while ($row = mysql_fetch_array ($result, MYSQL_NUM)) {
mysql_fetch_row can be an alternative.
>   $fname = "$row[0]";
>   $body = "Hi {$_POST['fname']},";
You are sendting the email to users who are in the database, but
greeting them with $_POST['fname']
>  $headers = "MIME-Version: 1.0\r\n";
>  $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
>  $headers .= "From: ";
>From is not set, value is not here.

>  $sendto = "$row[1]";
>   echo "Row one output = $sendto";
>   mail ($_POST['sendto'],'Testing', $body, $headers);
Again you are sending the mail to same person very time.

>   echo "Sent to $row[1]";}
Again problem.
>   mysql_free_result ($result);
> 
> --

PHP manual is good thing to start .
http://www.php.net


zareef ahmed

-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] Code Analyzer Needed ..can somebody suggest ?

2005-02-19 Thread Zareef Ahmed
Hi Ramya,

Try Zend Studio from zend.com

zareef ahmed



On Fri, 18 Feb 2005 22:22:34 +0530, Ramya Ramaswamy <[EMAIL PROTECTED]> wrote:
> Hey people,
> 
> Am in the look out for a code analyzer for PHP...can somebody help me
> out with that?Please...
> 
> Many Thankx
> Ramya
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] PHP to C interface?

2005-02-18 Thread Zareef Ahmed
Hi,

 Please Visit

http://pear.php.net/package/Inline_C

may be usefull

zareef ahmed 



On Fri, 18 Feb 2005 01:19:19 -0800, N Deepak <[EMAIL PROTECTED]> wrote:
> Hi,
> 
>   Is there a way to invoke C functions in a library (.so) from PHP?
>   Like Xs in Perl?
> 
> Thanks,
> Deepak
> 
> --
> N Deepak || http://www.ndeepak.info/
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] Student Suspended Over PHP use.

2005-02-11 Thread Zareef Ahmed
Hi, 

News is very old it was published  in  june 2000.

zareef ahmed 


On Thu, 10 Feb 2005 07:24:27 -0600, Steve Buehler <[EMAIL PROTECTED]> wrote:
> Shouldn't have taken your Cat to school with a bag of catnip.  That was
> asking for trouble. :)
> 
> Steve
> 
> At 08:44 PM 2/9/2005, Dotan Cohen wrote:
> 
> >Maybe it's not People Hate Perl after all...
> >Pot, Heroin, Pussy?!?
> >I think I got suspended for at leat two of those on campus grounds at
> >some point or another.
> >
> >Dotan
> >
> >On Thu, 10 Feb 2005 01:31:43 +1100 (EST), [EMAIL PROTECTED]
> ><[EMAIL PROTECTED]> wrote:
> > > PHP is bad Mkay.
> > >
> > > > I just ran across this interesting article from awhile back. Pretty
> > > > funny
> > > >
> > > > http://bbspot.com/News/2000/6/php_suspend.html
> > > > <http://bbspot.com/News/2000/6/php_suspend.html>
> > > >
> > > > Topeka, KS - High school sophomore Brett Tyson was suspended today
> > > > after teachers learned he may be using PHP.
> > > >
> > > > "A teacher overheard him say that he was using PHP, and as part of our
> > > > Zero-Tolerance policy against drug use, he was immediately suspended.
> > > > No questions asked," said Principal Clyde Thurlow.   "We're not quite
> > > > sure what PHP is, but we suspect it may be a derivative of PCP, or
> > > > maybe a new designer drug like GHB."
> > > >
> > > > php_logoParents are frightened by the discovery of this new menace in
> > > > their children's school, and are demanding the school do something.
> > > > "We heard that he found out about PHP at school on the internet.  There
> > > > may even be a PHP web ring operating on school grounds," said irate
> > > > parent Carol Blessing. "School is supposed to be teaching our kids how
> > > > to read and write.  Not about dangerous drugs like PHP."
> > > >
> > > > In response to parental demands the school has reconfigured its
> > > > internet WatchDog software to block access to all internet sites
> > > > mentioning PHP. Officials say this should prevent any other students
> > > > from falling prey like Brett Tyson did.  They have also stepped up
> > > > locker searches and brought in drug sniffing dogs.
> > > >
> > > > Interviews with students suggested that PHP use is wide spread around
> > > > the school, but is particularly concentrated in the geeky nerd
> > > > population.  When contacted by BBspot.com, Brett Tyson said, "I don't
> > > > know what the hell is going on dude, but this suspension gives me more
> > > > time for fraggin'.  Yee haw!"
> > > >
> > > > PHP is a hypertext preprocessor, which sounds very dangerous.  It is
> > > > believed that many users started by using Perl and moved on to the more
> > > > powerful PHP.  For more information on how to recognize if your child
> > > > may be using PHP please visit http://www.php.net <http://www.php.net> .
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > HTC Disclaimer:  The information contained in this message may be
> > > > privileged and confidential and protected from disclosure. If the
> > > > reader of this message is not the intended recipient, or an employee or
> > > > agent responsible for delivering this message to the intended
> > > > recipient, you are hereby notified that any dissemination, distribution
> > > > or copying of this communication is strictly prohibited.  If you have
> > > > received this communication in error, please notify us immediately by
> > > > replying to the message and deleting it from your computer.  Thank you.
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] explanation

2005-02-09 Thread Zareef Ahmed
On Wed, 09 Feb 2005 18:15:28 -0800 (PST), Pagongski
<[EMAIL PROTECTED]> wrote:
> 
> Hi,
> 
> I looked everywhere for a nice explanation of this darn simple thing, 
> but had no luck. I am working with some code made by a different person thats 
> why i am running into these sorts of things. (yes, i am kinda newbie)
> I have a file named "blah.php" with this line:
> 
> $B->var1 = "name1";
> 
> Then i have another file called "result.php" that has:
> 
>require_once("blah.php");
> 
> And then i want some code to display the "name1". The problem is i 
> have no idea how to deal with that "->", what it means (object of some sort?) 
> and how to get the value of that variable. Doing print ($var1) obviously 
> doesnt work.
> Can someone please explain this to me? What does the "->" do? How to 
> solve that problem above?
 -> operator used to accsses the method and properties of an object
Here B is an object and var1 is an member variable.



do a 

print_r($B->var1);

or 
 
print_r ($B);

You will get the all information about this object like class name etc.


zareef ahmed 
> 
> Big thanks.
> 
> Pag
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] .Net Web services

2005-01-17 Thread Zareef Ahmed
Hi Michael, 

   It would be helpful if you elaborate  your problem with details 
like PHP version, OS, Service etc. It will increase the chances of a
good response.


zareef ahmed


On Tue, 18 Jan 2005 11:06:16 +1000, Michael Leung
<[EMAIL PROTECTED]> wrote:
> Hi all,
>I have a parameter passing problem by using PHP SOAP extension.
> .Net web services seem not to be read the parameters.
> 
> yours,
> Michael
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] Re: unable to load curl

2005-01-11 Thread Zareef Ahmed
Please read install.txt carefully, it has a section on this problems,
if PHP.INI is fine., then you need to copy some of the dlls available
in dlls folder to your system folder.

zareef ahmed 



On Mon, 10 Jan 2005 22:38:41 +0530, Sagar C Nannapaneni
<[EMAIL PROTECTED]> wrote:
> > Please respond to the newsgroup and not to my personal email.
> >
> > Is it a file access/ownership thing?
> >
> > This is possible.  Have you checked permissions for PHP user?  My
> > original question remains unanswered though and it is probably a better
> > place to start...
> >
> >  > extension_dir = "C:\php\extensions"
> >  >
> >  > where all the extension dlls reside.
> >  > All extensions are working and all dlls are loading properly,,
> >
> > What do you mean by this statement? How do you know this if you claim
> > that cURL is not loading (it is an extension)... have you tried phpinfo()
> ?
> >
> 
> What i mean by the statement is that when i tried to load other
> modules(extensions u could say)
>  like php_cpdf,php_mhash...they are working...i mean i could see them as
> enabled in phpinfo().
> 
> But when i load the curl extension i'm getting error.
> 
> Yes..i've tried phpinfo().
> 
> Its not displaying anything about cURL.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] PHP code to analize email HELP

2005-01-09 Thread Zareef Ahmed
On Sun, 09 Jan 2005 18:00:09 -0800, Robby Russell <[EMAIL PROTECTED]> wrote:
> On Sun, 2005-01-09 at 19:20 -0500, Alejandro Marín Uribe wrote:
> > Hi all
> >
> > I really need help. I have an idea about to create a piece of code that it
> > analyze an email, extract certain data (this email contains Name, email and
> > telephone of a person in a standar html) and insert this data in MySQL
> > database. It this posible?
> >
> > I'm a newbie in PHP/MySQL, any ideas?
> >
> > Thanks,
> >

regular expressions are the answeres of your problems


zareef ahmed.


> > excuse my english
> >
> 
> You can probably search online and find some tutorials for this. Some
> terms that might help are 'php parse html email'
> 
> -Robby
> 
> --
> /***
> * Robby Russell | Owner.Developer.Geek
> * PLANET ARGON  | www.planetargon.com
> * Portland, OR  | [EMAIL PROTECTED]
> * 503.351.4730  | blog.planetargon.com
> * PHP/PostgreSQL Hosting & Development
> *--- Now supporting PHP5 ---
> ********/
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] PHP any Mysql connection- new b

2005-01-09 Thread Zareef Ahmed
On Sat, 8 Jan 2005 16:10:47 + (GMT), babu <[EMAIL PROTECTED]> wrote:
> Hi all,
> 
> I am using php 3.0 and mysql and win xp.
> i want to add users to database through php page.
> 
> adduser.php
> 
> 
> Real Name: 
> Username: 
> Password: 
> 
>  
> 
> 
> 
> 
> when i enter the fileds and submit ,the action is not performed, instead 
> add.php file is >opened.
What do you mean by it? You have action as add.php then it must be
opened. Are you getting all page code in plain text? If so please
check your php installation.
BTW php3 is outdated and I never see it running on Apache 2 with win xp.

zareef ahmed 




> add.php
>  
> $ID = uniqid("userID");
> 
> $db = mysql_connect("localhost","root","halfdinner");
> 
> mysql_select_db (userpass);
> 
> $result = mysql_query ("INSERT INTO users (id, real_name, username, password )
> VALUES ('$ID', '$real_name', '$username', '$userpass') ");
> if(!$result)
> {
> echo "User not added: ", mysql_error();
> exit;
> }
> if($result)
> {
> mysql_close($db);
> print "User $username added sucessfully!";
> }
> else
> {
> print ("Wrong Password");
> }
> ?>
> 
> is the problem due to mysql and php connection.i am using windows xp with 
> apache2.
> 
> i followed the steps said by someone in the previous thread.that is adding 
> libmysql.dll to system32 and so on. I cannot find php_mysql.dll in php.ini.
> can some one help
> 
> Thanks
> babu
> 
> 
> -
>  ALL-NEW Yahoo! Messenger - all new features - even more fun!
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] Why extra slashes???

2004-12-30 Thread Zareef Ahmed
Hi, 

   You can user stripslashes() function to remove them if gpc quotes
is creating some kind of confusion in your mind. BTW these quotes are
important in some security related  situations.

zareef ahmed.


On Thu, 30 Dec 2004 20:15:06 -0500, John Holmes
<[EMAIL PROTECTED]> wrote:
> Wiberg wrote:
> > Right now I'm creating a form that saves the text from a textarea to an
> > array. That doesn't seem to be any problem.
> > But when I save the contents, I get extra / ?
> 
> http://us4.php.net/manual/en/ref.info.php#ini.magic-quotes-gpc
> 
> --
> 
> ---John Holmes...
> 
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
> 
> php|architect: The Magazine for PHP Professionals â www.phparch.com
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] authentication

2004-12-28 Thread Zareef Ahmed
Hi  Ali,
 Visit 

http://zareef.users.phpclasses.org/browse/class/21.html

You will find a lot of code.

zareef ahmed 


On Tue, 28 Dec 2004 13:12:14 +1030, Ali <[EMAIL PROTECTED]> wrote:
> Hi everyone...
> can anyone lead me to a good tutorial on authentication...it wud be good if
> i can get a one in connection with a database..
> thnks
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] Making includes and requires safe.

2004-12-28 Thread Zareef Ahmed
I agree with John Holmes that  it is targeted at PHP. It is really
wonderfull thing to know that google, yahoo can detect my php code on
my site. These news item written by total uninformed (or Illinformed )
persons.

zareef ahmed 



-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] $HTTP_POST array

2004-12-28 Thread Zareef Ahmed
Hi Kalinga,

it is not recomended to use $HTTP_POST_VAR array. Use $_POST and 
it have global scope. In PHP5, we have a special directive by which we
can disable $HTTP_*_VAR. currently it defaults to enabled. But who
says in future versions of PHP it default set to disabled. then your
code will not run. So Use $_POST, $_GET etc. instead of using old long
$HTTP_*_* style.


zareef ahmed 


On Mon, 27 Dec 2004 18:31:21 +0300, Burhan Khalid <[EMAIL PROTECTED]> wrote:
> kalinga wrote:
> > Dear all,
> > Is it possible to pass the entire $HTTP_POST array to a function of a class
> > as a variable?
> 
> Use $_POST -- its automatically in scope of every function (you don't
> need to pass it).
> 
> You can pass any array to a function.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] Environment and Modules

2004-12-28 Thread Zareef Ahmed
HI,
Install instruction file contains all information you need to enable
some of the exetension.
HINT ::  dlls folder

zareef ahmed 

On Tue, 28 Dec 2004 18:26:52 +0100, Steven Spierenburg
<[EMAIL PROTECTED]> wrote:
> Hi There,
> 
> I recently installed PHP and have two things going on that I can't seem to
> rectify or solve.
> If I may use the collective knowledge of PHP users/developers on these
> groups I would be grateful.
> 
> First some info on my setup:
> OS : Windows 2000 Server
> Webserver :IIS6
> PHP : 4.3.10 (extracted zip version from php.net into folder "c:\php4")
> phpinfo() page : www.jikade.com/test.php
> 
> The problems:
> 
> 1) I want PHP to look for my php.ini file in the php folder (c:\php4) but it
> refuses to do so. Setting PHPRC doesn't help and this setting actualy won't
> show in the summary of phpinfo() in the environment section. I changed the
> PATH environment variable to include "c:\php4" but that doesn't help either.
> Putting the php.ini in the "c:\winnt" folder does work and then I configure
> PHP through this file. Otherwise it won't load *any* php.ini file and use
> defaults, or so it seems.
> What I want to accomplish is that PHP finds and uses the php.ini file that
> resides in the "c:\php4" folder
> 
> 2) Some modules won't load, php_mcrypt.dll for one. I tried setting the
> "extension_dir" (extension_dir = "c:\php4\extensions") but that doesn't
> help. Copying the dll to the "c:\winnt\system32" folder doesn't work either.
> Some modules do load however (php_df.dll loads fine from the same location),
> it's just some modules that don't/won't. Examples are: php_mcrypt.dll,
> php_mhash.dll and php_xmlrpc.dll.
> What I want to accomplish here is that modules can load (obviously) :-)
> Any help on these matters will be appreciated immensly!
> 
> ps: I used a MailExpire temporary email address to be able to post on this
> newsgroup. Don't know if that's a faux-pas around here but I tend to be
> realy carefull with my real email addresses on newsgroups due to spam
> problems. If people say it's ok to use my real email address then I'll use
> that one in future posts. Sorry for any inconvenience caused.
> 
> --
> 
> Greetings,
> Steven Spierenburg
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



Re: [PHP] CMS

2004-12-28 Thread Zareef Ahmed
HI Javier,

  You may try (!) pathos which is now available under a new name EXPONENT.
It is based on Smarty template. It is very good at adding   new
exetensions. One of the problem I faced in this CMS is its file
structure. IMO it is best .

visit

http://sourceforge.net/projects/exponent/


zareef ahmed 


On Tue, 28 Dec 2004 16:41:57 +0600, kalinga <[EMAIL PROTECTED]> wrote:
> typo3, it's a good one..
> 
> try it ;-)
> 
> vk.
> 
> On Tue, 28 Dec 2004 11:00:32 +0100, Javier Leyba
> <[EMAIL PROTECTED]> wrote:
> >
> > Hi
> >
> > I'm looking for a good CMS recommendation.
> >
> > I've seen comments in opencms and tested a few (Xaraya was good when I read
> > features but so slow at testing time) but I can't test all and may be other
> > user experience could reduce my test universe.
> >
> > I want a CMS with html code separated from PHP code, fully customizable,
> > easy to implement and fast...
> >
> > Any clue ?
> >
> > Thanks in advance
> >
> > Javier
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> --
> vk.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

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



RE: [PHP] Very fresh to php

2004-12-02 Thread Zareef Ahmed
Hi,

  Visit http://www.sitepoint.com/article/phps-creator-rasmus-lerdorf/39


Zareef ahmed 


-Original Message-
From: Reinhart Viane [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 01, 2004 8:09 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP] Very fresh to php

I think it was Darth Moeder

"PHP, I am your mother, *heavely breathing*"

(for those who don't speak dutch: Vader is 'father' and Moeder is
'mother') 

-Original Message-
From: Santa [mailto:[EMAIL PROTECTED] 
Sent: woensdag 1 december 2004 9:29
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Very fresh to php


В сообщении от Среда 01 Декабрь 2004 07:45 suneel написал(a):
> Hi...guys,
>
> I'm a new bee to php. Could any one tell me that who is 
> the father of php?
>
> take care guys,

and who is mother? 8)

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



Zareef Ahmed :: A PHP Developer in Delhi ( India )
Homepage :: http://www.zasaifi.com


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.802 / Virus Database: 545 - Release Date: 11/26/2004
 

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



RE: [PHP] php extension problem

2004-12-01 Thread Zareef Ahmed



>Hi folks,

>well, I hope you can help me out. I have a Windows XP machine running
>Apache 2.x and Php 5.x. So far, everything works fine. I have placed
>the php5ts.dll file in my System32 directory, kopied the php.ini file
>in the Windows root directory and loaded the apache module for php5. So
>far, the apache server with the php5 module is running fine.

>Then, I've installed PEAR. Also, without any problems. But, when I
tried
>a test run I get the message that PEAR cannot find a extension.

>Well, I altered my php.ini file and activated the php_mysql.dll
>extension. I also specified the extension_dir. BUT, when I try to
>restart the server I get the warning that Apache was not able to find
>the specified module. In the alert-window, showing me the message with
>the spcified path, I cannot find any mistakes. It is an absolute path
>to e.g. "C:\php\ext"
Do you have every file (you have loaded in php.ini) in your extension
directory i.e in c:\php\ext?

Zareef ahmed
>Any suggestions?

Thanks in advance.

Marcel

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

Zareef Ahmed :: A PHP Developer in Delhi ( India )
Homepage :: http://www.zasaifi.com

 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.802 / Virus Database: 545 - Release Date: 11/26/2004
 

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



RE: [PHP] How do I get referer in php?

2004-11-17 Thread Zareef Ahmed


Hi
  use 

Print $_SERVER['HTTP_REFRER'];

But some time browser do not send it properly so please check it with
another browser if fails.

Zareef Ahmed 


-Original Message-
From: John Holmes [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 18, 2004 3:39 AM
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] How do I get referer in php?


John Nichel wrote:
> M. Sokolewicz wrote:
> 
>>> I'm sure he meant
>>>
>>> echo '',print_r($_SERVER,1),'';
> 
> ---^---^
> 
>>> then... ;)
>>>
>> hadn't noticed that param... I feel ashamed... :$
>>
> Didn't notice that those were commas and not periods either, eh? ;)

Didn't notice the result is the same either way, eh? ;)

-- 

---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals - www.phparch.com

-- 


--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com

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



RE: [PHP] Error logging problem

2004-11-10 Thread Zareef Ahmed

-Original Message-
From: Al [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 10, 2004 9:19 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Error logging problem


My site is on a virtual host and I'd like to log errors to a file while
I'm 
debugging.  Can't get it to work.

Here is the code at the top of my script:

>  ini_set("display_errors", "on"); //also tried "Off"
>  
>  ini_set("error_log", "/AutoSch/error.log");

This problem may be related to your path.
Try to user $_SERVER['DOCUMENT_ROOT']."/AutoSch/error.log"

AutoSch must be in your document root .



Zareef ahmed 


>  
>  $ini_array= ini_get_all();
>  
>  error_reporting(E_ALL ^ E_WARNING );
//On for debuging only
>  
>  print_r($ini_array);

Printing $ini_array shows my ini_set() statements are working; but, the
errors 
are not being appended to error.log.

I put a error.log in the folder, assuming the error handler needed one
to append 
to.

I don't want to turn on error logging for the whole site; just the
folder I'm 
working on.

Thanks

-- 


--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com

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



RE: [PHP] Array to $_GET variable

2004-11-10 Thread Zareef Ahmed
Hi, 
   Yes it is a good idea to store this value in $_SESSION array.
$_GET value sometime (depend on php setting) add slashes to all values, 
Those slashes will create the problem at the time of unserialization.
Doing urlencode and decode also can be help full but in my view
$_SESSION  are best way to manage this as sometime value may be too long
to store in $_GET variable.

Do You get any error on unserialization?

Zareef ahmed 



-Original Message-
From: Mike Smith [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 10, 2004 10:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Array to $_GET variable


I am trying to cache a database recordset so users can sort, etc without
hitting the database everytime. I'm using ADODB to access a MSSQL
database.


$s = "SELECT id, part, description FROM parts\n";
$r = $db->Execute($s);

$parts = array(id=>array(),part=>array(),desc=>array())

while(!$r->EOF){
array_push($parts['id'],$r->fields[0]);
array_push($parts['part'],$r->fields[0]);
array_push($parts['desc'],$r->fields[0]);
$r->MoveNext();
}

// print_r($parts) displays array data.
Here's what I'm doing:

$v = serialize($parts);


echo "Link\n";

If($_GET['getvar']){
$newvar = unserialize($_GET['getvar']); 

//This does nothing
echo $newvar;
print_r($newvar);

}

Am i missing something very simple? Should I make the array a $_SESSION
variable, or how do others "cache" a recordset?




--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com

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



RE: [PHP] php mail() error

2004-11-10 Thread Zareef Ahmed
Hi,
Well this time I will take the responsibility :)

Here is the link about mail sending in PHP .

http://www.phpclasses.org/browse/package/9.html

Zareef ahmed 

-Original Message-
From: Greg Donald [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 10, 2004 8:48 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] php mail() error


On Wed, 10 Nov 2004 23:14:43 +, Jason Wong
<[EMAIL PROTECTED]> wrote:
> Or you can wait for Manuel Lemos' reply :)

Good one.  :)


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

--------
--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com

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



RE: [PHP] php mail() error

2004-11-10 Thread Zareef Ahmed
Hi,
   Problem is realted to your smtp server.
Make sure it allowed outgoing mail without authenctication.

You must also set a  header in fourth parameter of mail function, it is
good practice and can save you from some basic indentification problems.

In windows you can set default send mail from in php.ini

Try
Mail("[EMAIL PROTECTED]","test subject","test
body","from:[EMAIL PROTECTED]");

If it fails contact your ISP. 

Additionally read
http://www.chilkatsoft.com/faq/Smtp550.html


Zareef ahmed 



-Original Message-
From: Garth Hapgood - Strickland [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 10, 2004 6:06 PM
To: [EMAIL PROTECTED]
Subject: [PHP] php mail() error


Im using the php mail() function to try send an email to a user that has
just registered.

mail($HTTP_POST_VARS['emailaddress1'], 'Matchmakers Website
Registration' , 'Welcome');

But when I get the following error back.:
  Warning: mail(): SMTP server response: 550 5.7.1 Unable to relay for
[EMAIL PROTECTED]

Can someone help me out, by telling me what it means or what Im doing
wrong?

Thanx
Garth

--------
--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com

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



RE: [PHP] basic script

2004-11-09 Thread Zareef Ahmed

Hi,
Use 
 print $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];

Zareef Ahmed 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 10, 2004 9:56 AM
To: [EMAIL PROTECTED]
Subject: [PHP] basic script


I just want the URL that is on the navigator bar be 
printed... this is my script but it just does not do it... 
why,.. please help, cheers

First Variables Example




>> Well where you set the $x






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




--------
--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com

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



RE: [PHP] page redirect question

2004-11-09 Thread Zareef Ahmed

Hi,

   Alas there is no any other way to redirect the page without sending
headers in PHP. 
You may use javascript for this purpose.

Well it is matter of programming practice.
We must do processing before presenting the content to users.
It will be helpful in many situations.

So instead of doing 

1.Draw header
2. Draw middle bar upon user input and according to business logic.
3. Draw footer

We Must Use
1. Make Business logic and process user input  and  do required task
such as redirection
2. Store result of step 1 in any entities like variables.
3. Draw Header
4. Make Middle bar using set entities.
5. Draw footer.


This is just a overview of approach. You may need to process more things
along with middle bar, but it is good idea to do logical  processing
before presentation.

Zareef Ahmed 









-Original Message-
From: Victor C. [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 09, 2004 9:37 PM
To: [EMAIL PROTECTED]
Subject: [PHP] page redirect question


Hi,

Is there anyway to redirect php page other than using
HEADER("LOCATION:URL") ?
Header can only be called if nothing is written to HTML... Is there
anyway around it?

Thanks,

-- 

----
--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com

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



RE: [PHP] Re: User's language settings

2004-11-08 Thread Zareef Ahmed
Hi,
  You may try a ip locator and then guess for users country.
IN this way you can design your programme to treat users from Russia to
Russian language etc.

Visit 
http://zareef.users.phpclasses.org/browse/package/1477.html 

Zareef Ahmed 


-Original Message-
From: Daniel Schierbeck [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 09, 2004 1:45 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: User's language settings


Dmitri Pissarenko wrote:
> Hello!
> 
> I have a web-site, part of which is in Russian and another part in 
> English.
> 
> English and Russian parts are located in different directories. The
> web-site is static.
> 
> I want to create a PHP file, which redirects the user from /index.php 
> to
> /ru/index.html, when his primary language is Russian and to 
> /en/index.html, when his primary language is non-Russian.
> 
> In other words:
> 
>  
> if ($languageRussian)
> {
> header("Location: http://dapissarenko.com/ru/index.html";);
> }
> else
> {
> header("Location: http://dapissarenko.com/en/index.html";);
> }
> 
> exit;
> ?>
> 
> How can I determine user's primary language?
> 
> Thanks!
> 
> dap
I don't think it's possible. You can, however, ask the user to select 
which language he wishes to see, then store that option in a cookie so 
he doesn't have to do it every time he visits the site.


-- 
Daniel Schierbeck

Help spread Firefox (www.getfirefox.com): 
http://www.spreadfirefox.com/?q=user/register&r=6584

-- 

--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com

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



RE: [PHP] Arrays

2004-11-08 Thread Zareef Ahmed

Hi Ben,

 Welcome to the wonderful world of PHP.

Working with array in PHP is very easy. A large number of functions are
there.
Please visit the manual
http://www.phpcertification.com/manual.php/ref.array.html

You can move values ( including Arrays) from page to page in session
variables.

But you need to do serialize and unserialize in case of array or object.


Do ::

$val_ar=array("one","two","three");
$_SESSION['val_ar_store']=serialize($val_ar);

Now you can get your array in any page simply

$val_ar=unserialize($_SESSION['val_ar_store']);
Print_r($val_ar);

This process is very simple. Please see manual

http://www.phpcertification.com/manual.php/function.serialize.html

http://www.phpcertification.com/manual.php/function.unserialize.html

Revert back with any other problem.

Zareef ahmed 



-Original Message-
From: Ben [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 09, 2004 4:31 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Arrays


I hope this is not a stupid question, but I am learning how to work with

Arrays, and am having trouble figuring out how to move array values from

page to page and/or store in a db.  Once again, I am new to arrays (and 
fairly new to PHP for that matter), so please don't get too technical in

replies.  Thanks so much for help.

ben 

--------
--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com

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



RE: [PHP] OOP, Out of Scope Issue

2004-11-07 Thread Zareef Ahmed

Hi, 

 Please visit 

http://www.phpcertification.com/manual.php/functions.arguments.html#func
tions.arguments.by-reference

Hope it will be helpful.


zareef Ahmed 

-Original Message-
From: Jonathan Chum [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 08, 2004 9:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP] OOP, Out of Scope Issue


I have a class called FrontEnd which extends a TemplateManager class.

The purpose of the TemplateManager class is to initate Smarty.

So my FrontEnd constructor looks like this:

function FrontEnd()
{
$db = new DatabaseConnection();

$this->db = $db->initDatabase();
$this->sm = $this->initTemplate();
}

I have another function:

function DisplayMain($parentID)
{
if (!isset($parentID)) $parentID = '1';

$product = new Products($this->db, $this->sm);

$category = new Categories($this->db, $this->sm);

$category->FetchCategories($parentID);
$product->FetchProducts($parentID);

$this->DisplayPage('display-products');
}

I'm passing in an instance of the smarty object instantiated by the
FrontEnd 
constructor into Products and Categories. The FetchCategories and 
FetchProducts methods will take the smarty instance and assign the
variables 
into the template, assuming it's the same instance of Smarty. The
problem 
I'm having is that it sees in each class a new instance of Smarty or a
copy 
of the object which when I call DisplayPage, a method within the
FrontEnd 
class, it doesn't see all of the variables I assigned earlier by 
FetchProducts and FetchCategories even though I've not declared a new 
instance of Smarty.
How can I fix it so that it uses the same Smarty object and not a copy? 

----
--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com

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



RE: [PHP] Authentification related to browser window

2004-11-03 Thread Zareef Ahmed
Hi Cristi,

I think you must know and understand how the session works in PHP.
Please Read.
http://in2.php.net/session

Some things to note on that page

session.use_cookies
session.use_trans_sid


Zareef Ahmed 



-Original Message-
From: Cristi Barladeanu [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 04, 2004 3:56 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Authentification related to browser window


Thank you all for the answers. 

As I thought, Skippy is right. It is the only solution for independent
windows, but still no idea about opening new tabs in same browser. It is
at least a good starting point.

I'll search the docs and the web for this. Your help (useful links
maybe?) is welcome.

Cheers,
Cristi


On Wed,  3 Nov 2004 12:09:32 +0200, Skippy <[EMAIL PROTECTED]> wrote:
> Quoting Cristi Barladeanu <[EMAIL PROTECTED]>:
> > My problem is pretty simple. User enters the site, logins, and after

> > that he hits ctrl+n or something, to open a new window from same 
> > browser. Can I make him to login again in the new window but to keep

> > him logged in the old one? Now i'm using sessions, but i realise 
> > that the cookies set by them are related to browser, so every window

> > use them.
> 
> You'll need to use URL session id's. I seem to recall that PHP 
> sessions can be configured to use only them and never cookies. This 
> way, the session id is passed as a GET parameter to every page you go 
> to on your site. A new browser window won't have the id by default (if

> you go to the homepage) but it will if you do "open this link in a new

> tab" or "new window".
> 
> Session id's in the URL have a lot of downsides to them. First of all,

> you have to propagate them by hand. ALL links on your site must be 
> careful to include them as GET parameters, and all POST forms must 
> include them too. It's gets tedious very fast, and is error prone.
> 
> Plus, it doesn't solve your problem 100%, as you can see above. If the

> new window is derived from an existing link they'll still seem already

> logged on.
> 
> Finally, there are horrible security issues with URL sid's. The user 
> may chose to save an URL containing a sid to his bookmarks, where they

> can be seen by someone else. They may send the URL (with the sid 
> included) to a friend who may pass it on to others. The URL also gets 
> passed to other sites in the Referer HTTP header. Finally, as long as 
> they have JavaScript active in the browser, any site can check their 
> recent browsing history and pick up the sid from there.
> 
> --
> Romanian Web Developers - http://ROWD.ORG
>


--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com

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



RE: [PHP] blank function parameters

2004-11-03 Thread Zareef Ahmed
Hi,

 when declaring function 


function example($var1, $var2, $var3, $var4="anything")
{


}

Now calling  
Example("one","two","three");
will not throw an error, but pass 'anything' as the value of $var4 by
default if you override the value pass all the argumets.

Zareef ahmed 

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 03, 2004 9:12 PM
To: Giles Roadnight; [EMAIL PROTECTED]
Subject: RE: [PHP] blank function parameters


[snip]
If I defined a function with 4 parameters but only pass 3 I get an
error. Is there anyway around this?
 
I want to be able to set the missing parameter to a default value if it
is not passed which works ok but How do I get rid of the error message?
[/snip]

http://us2.php.net/manual/en/function.func-num-args.php "func_num_args()
may be used in conjunction with func_get_arg() and func_get_args() to
allow user-defined functions to accept variable-length argument lists. "

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




----
--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com

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



RE: [PHP] SQL-Injection, XSS and Hijacking

2004-11-03 Thread Zareef Ahmed
Hi,

 look for escapeshellcmd().
It is another good function to minimize the security risks.

http://in2.php.net/escapeshellcmd


Zaeeef ahmed

>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
>Sent: Thursday, November 04, 2004 3:55 AM
>To: [EMAIL PROTECTED]
>Subject: [PHP] SQL-Injection, XSS and Hijacking


>Hi,

>I read now quite a lot of articles about SQL-Injection,
>XSS and session hijacking in a hopefully appropriate way.

>As I understand the function addslashes(),quote_meta()
>and mysql_real_escape_string() are to avoid SQL Injection
>e.g. in order to use page_sliding with entered POST data 
>over forms with $_REQUEST parameters, while strip_tags(),
>htmlentities() and utf8_decode() is useful to have a 
>clean output within the browser by not having arbitrary 
>code within.

>For a session authentication PEAR::Auth is used.

>I just wanted to ask if there's more to take care of.

>-- 
>Best Regards,

>Mark


--------
--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com

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



RE: [PHP] URL thing

2004-11-03 Thread Zareef Ahmed
Hi,

  You may use $_SERVER['REQUEST_URI'];


Zareef ahmed 


-Original Message-
From: Kevin Javia [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 03, 2004 1:43 PM
To: [EMAIL PROTECTED]
Subject: [PHP] URL thing


How can I get the URL in the address bar in any variable?

If URL is "http://www.mysite.com/page.php?var1=12&var2=hello+world";, I
want to store it in any variable in my code.

$PHP_SELF gives only page name.

Can any one help me?

Thanks.

----
--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com

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



RE: [PHP] Authentification related to browser window

2004-11-02 Thread Zareef Ahmed

Quoting Cristi Barladeanu <[EMAIL PROTECTED]>:

> Greetings
> 
> My problem is pretty simple. User enters the site, logins, and after 
> that he hits ctrl+n or something, to open a new window from same 
PHP can not track the events at the client side.

I think it is not possible , But you may try the combination of
javascript and php to do so
Following function may be usefull

session_regenerate_id();

See the manual for it.
 
Zareef ahmed 

> browser. Can I make him to login again in the new window but to keep 
> him logged in the old one?
> 
> Now i'm using sessions, but i realise that the cookies set by them are

> related to browser, so every window use them.
> 
> I hope you will understand what i mean.
> 
> Cheers,
> Cristi
> 
> --
> 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




--------
--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com

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



RE: [PHP] No luck creating dynamic images

2004-11-01 Thread Zareef Ahmed
Hi,

After setting error_reporting to E_ALL.

You may need to set show_errors in php.ini
Use
error_reporting(E_ALL);
ini_set("show_errors","1");

Zareef ahmed


-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 02, 2004 4:11 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] No luck creating dynamic images


On Monday 01 November 2004 19:51, Ken Tozier wrote:

> > Enable FULL error reporting.
>
> I tried this with error_reporting(E_ALL); and ran the script in 
> multiple browsers no errors reported.

Are you looking in the correct place for errors?

> Also ran phpinfo(); (as suggested by Jay Blanchard) which worked 
> without problem. The settings under GD were all enabled for the common

> image types.

phpinfo() will tell you whether errors are to be displayed and/or logged
to 
file.

> Anybody see any glaring errors in the following?

Works for me.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The bugs you have to avoid are the ones that give the user not only the
inclination to get on a plane, but also the time.
  -- Kay Bostic
*/

-- 

--------
--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com

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



RE: [PHP] php array question

2004-11-01 Thread Zareef Ahmed



>-Original Message-
>From: Victor C. [mailto:[EMAIL PROTECTED] 
>Sent: Tuesday, November 02, 2004 3:06 AM
>To: [EMAIL PROTECTED]
>Subject: [PHP] php array question
>
>
>Hi,
>I have a line of php that I don't really understand.
>
>foreach($this->orders as $OrderID => $value) {
>echo $OrderID."";
I think Problem is with this line (I am surprised to see it does not
throw a parsing error. As it should !)
>$OrderObject =$this->orders[$OrderID=>$value];

If $this->orders is an array of order objects then
Following line should be  sufficient 
$OrderObject =$this->orders[$OrderID];
  Or
$OrderObject =$value;

Zareef ahmed
>echo $OrderObject->OrderID."<--all the same";
>}
>
>I know that $this->orders is an array of "order" objects.
>
>the result i get from this is:
>
>line1. 388<--OrderID.
>line2. 389<--all the same
>line3. 389<--OrderID.
>line4. 389<--all the same
>
>I'm really confused about why line 1 and line 3 have different OrderID,
but line 2 and 4 have the same... I've been trying >to fix this bug for
3 hrs with no luck. Any help would be really appreciated..

>Thanks a lot


--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com

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



RE: [PHP] Newbie again: get no $QUERY_STRING

2004-10-27 Thread Zareef Ahmed
Hi,
   What are you trying to do? If you want to get the values of query
string they will be available in $_GET array.

Try

Print "";
print_r ($_GET);
Print "";

Zareef ahmed 

----
--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com


-Original Message-
From: Horst Jäger [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 27, 2004 4:33 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Newbie again: get no $QUERY_STRING


Date: Wed, 27 Oct 2004 12:50:36 +0200
To: [EMAIL PROTECTED]
From: Horst Jäger [EMAIL PROTECTED]
Subject: Newbie: get no $QUERY_STRING


Hi,

when I received my own Mail back from the list I found that my example
page 
has been removed. Maybe my mail program thought I was sending styled
text. 
So I'm using these brackets [] in my example in order to fool the damned
thing.

I'm afraid this might be a stupid question but this is my first PHP-day.

I get no $QUERY_STRING (and no GET- or POST-Params).

I'm using PHP 4.3.3 on a SUSE LINUX 9.0 Machine. When I view the
following 
page:

[html][head][/head][body]
[?php
echo gettype($QUERY_STRING);
  ?]
[/body][/html]

I get:

NULL

I copy my phpinfo below in case someone wants to have a look at it.

Thanks

Horst




PHP Version 4.3.3

System  Linux wittgenstein 2.4.21-99-smp4G #1 SMP Wed Sep 24 14:13:20
UTC 
2003 i686
Build Date  Sep 24 2003 00:27:33
Configure Command  './configure' '--prefix=/usr/share' 
'--datadir=/usr/share/php' '--bindir=/usr/bin' '--libdir=/usr/share' 
'--includedir=/usr/include' '--sysconfdir=/etc' '--with-_lib=lib' 
'--with-config-file-path=/etc' '--with-exec-dir=/usr/lib/php/bin' 
'--disable-debug' '--enable-bcmath' '--enable-calendar' '--enable-ctype'

'--enable-dbase' '--enable-discard-path' '--enable-exif'
'--enable-filepro' 
'--enable-force-cgi-redirect' '--enable-ftp' '--enable-gd-imgstrttf' 
'--enable-gd-native-ttf' '--enable-inline-optimization' 
'--enable-magic-quotes' '--enable-mbstr-enc-trans' '--enable-mbstring' 
'--enable-mbregex' '--enable-memory-limit' '--enable-safe-mode' 
'--enable-shmop' '--enable-sigchild' '--enable-sysvsem'
'--enable-sysvshm' 
'--enable-track-vars' '--enable-trans-sid' '--enable-versioning' 
'--enable-wddx' '--enable-yp' '--with-bz2' 
'--with-dom=/usr/include/libxml2' '--with-ftp' '--with-gdbm' 
'--with-gettext' '--with-gmp' '--with-imap=yes' '--with-iodbc' 
'--with-jpeg-dir=/usr' '--with-ldap=yes' '--with-mcal=/usr'
'--with-mcrypt' 
'--with-mhash' '--with-mysql=/usr' '--with-ndbm' '--with-pgsql=/usr' 
'--with-png-dir=/usr' '--with-readline' '--with-snmp' '--with-t1lib' 
'--with-tiff-dir=/usr' '--with-ttf' '--with-freetype-dir=yes'
'--with-xml' 
'--with-xpm-dir=/usr/X11R6' '--with-zlib=yes'
'--with-qtdom=/usr/lib/qt3' 
'--with-gd' '--with-openssl' '--with-curl' 
'--with-swf=/usr/src/packages/BUILD/swf/dist/' '--with-imap-ssl' 
'--enable-xslt' '--with-xslt-sablot' '--with-iconv' '--with-mm' 
'--with-apxs=/usr/sbin/apxs' 'i586-suse-linux'
Server API  Apache
Virtual Directory Support  disabled
Configuration File (php.ini) Path  /etc/php.ini
PHP API  20020918
PHP Extension  20020429
Zend Extension  20021010
Debug Build  no
Thread Safety  disabled
Registered PHP Streams  php, http, ftp, https, ftps, compress.bzip2, 
compress.zlib

  This program makes use of the Zend Scripting Language Engine: Zend
Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies





PHP Credits




Configuration
PHP Core
Directive Local Value Master Value allow_call_time_pass_reference On On
allow_url_fopen On On always_populate_raw_post_data Off Off
arg_separator.input & & arg_separator.output & & asp_tags Off Off
auto_append_file no value no value auto_prepend_file no value no value
browscap no value no value default_charset no value no value
default_mimetype text/html text/html define_syslog_variables Off Off
disable_classes no value no valu

  1   2   >