[PHP] hello everybody

2012-03-18 Thread saeed ahmed
i am a full time warehouse worker and do not have time.i hardly can spend
2/3 hours a week on internet(at work we do not use internet but only
computer)i am learning php and have xampp installed on my computer and i
think i am learning slowly slowly.i want ot ask one favor to someone,who is
capable of doing this small work.i have learned that when visitor fill a
form after visitor get message with his name.how this function is added and
where?

can anyon give me a example like giving a example to a child of 10 years.i
would like if someone explain me.


[PHP] free space

2012-01-31 Thread saeed ahmed
is there any free server where one can practice php(myadmin) - sql without
installing on personal computer?


[PHP] array

2011-12-31 Thread saeed ahmed
how can you explain someone in a simplest and everyday use example of ARRAY.

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



[PHP] offline practice

2011-12-09 Thread saeed ahmed
i have learned a bit to work php-mysql but i want to practice to know
more.at this moment i only can do primary works.creating users,inserting
data,viewing very simple reports.i want to practice any sample php_mysql
site offline.any help please.
thanks


[PHP] php sqlite

2011-11-05 Thread saeed ahmed
i want to start with php sqlite.which  light weight versions should i
download?i have win xp sp3.


[PHP] starting php by asking basic questions

2011-10-16 Thread saeed ahmed
i want to learn php and i do not know much and my english is also
limited.isthere anyone who can explain me php by most simple
example,like explainig to
a child,something like this:if you put "this" symbol or writing, in your php
script,when someone open this page,will see this message"long time not see"
.
at the moment ,i am scared of terms used by professionals.
thnks,for many this could a stupid but this is what i am facing.
thanks.


[PHP] CGI PHP vs. FastCGI vs. mod_php vs. application server?

2011-10-12 Thread saeed ahmed
greeting all,

As far as I know, there are different ways to write a PHP application:
- CGI, ie. the usual way : some PHP code in web pages, and the PHP
interpreter is loaded each time a PHP page is called
- FastCGI : apparently, the interpreter is loaded at boot time; the
application itself might also be compiled and loaded once
- mod_php : same as FastCGI?
- application server : the application is compiled and loaded once;
the application can either have its own web server, or use a web
server as front end, and only handle its own part

Any tips much appreciated, thank you.

--
Saeed Ahmed
Junior Software engineer
Codemate Ltd <http://www.codemate.com>.
My Blog: saeedahmed.net


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


[PHP] which one is faster

2010-10-05 Thread saeed ahmed
$a = 'hey';
$b = 'done';

$c = $a.$b;
$c = "$a$b";

which one is faster for echo $c.


[PHP] Encrypt and Decript email using PHP

2010-06-20 Thread saeed ahmed
hello friends,

Is there a way to send an encrypted email from server-side PHP, and then
decrypt it using an email client such as Outlook?

regards
saeed
http://saeed05.wordpress.com


Re: [PHP] is

2010-06-11 Thread Ahmed Mohsen

On 6/11/2010 11:43 PM, Daevid Vincent wrote:

-Original Message-
From: tedd [mailto:tedd.sperl...@gmail.com]

I believe, just because it can be done doesn't mean that it
should be done.

My practice is *never* to use

I am sure there will be some that think that my practice is an
overkill, or not "good practice", but it's a good thing that we all
have a choice. Make your choice to best serve how you want your code
to look.


As per http://us3.php.net/echo

echo() is not actually a function (it is a language construct), so you are
not required to use parentheses with it. echo() (unlike some other language
constructs) does not behave like a function, so it cannot always be used in
the context of a function. Additionally, if you want to pass more than one
parameter to echo(), the parameters must not be enclosed within
parentheses.

So you might want to reconsider your coding practice/style here and use the
construct as designed or you might end up with a far worse scenario than
short-tags could ever provide. Something more along the Python "print"
debacle.

Also, for the love of God, please don't embed a variable into a literal
string and use preprocessing.

Do it like so:





Hey Daevid, does this form  
improve anything in processing time or it's just for the sake of 
readability?


--
Kind regards,
Ahmed Mohsen.

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



Re: [PHP] is

2010-06-11 Thread Ahmed Mohsen

On 6/12/2010 12:34 AM, tedd wrote:

At 2:19 PM -0700 6/11/10, Daevid Vincent wrote:

EVERY other tag in an XML document is just straight up "html" :


Just curious -- like html tags:




Or do you have to change them to:




How does XML handle those tags?

Cheers,

tedd



If they have no content, you should use  tags, otherwise use the 
full open and close tags around the content. CONTENT


--
Kind regards,
Ahmed Mohsen.

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



Re: [PHP] is

2010-06-10 Thread Ahmed Mohsen

On 6/11/2010 2:49 AM, Daniel Brown wrote:

On Thu, Jun 10, 2010 at 19:35, David Harkness  wrote:


According to some PHP 6 will remove support for short tags. They won't be
disabled by default--the feature simply won't exist.

http://www.slideshare.net/thinkphp/php-53-and-php-6-a-look-ahead


 I don't know why Stefan said that, but in fairness, that slideshow
is two years old.  You'll still see short_open_tags, but you'll no
longer have ASP-style tags or the little-known

[PHP] Re: Redirect to

2010-06-10 Thread Ahmed Mohsen

Thanks for help.

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



[PHP] is

2010-06-10 Thread Ahmed Mohsen
I know that i should use the full open tag in php  but i want to 
know if its good to use this tag  instead of 


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



[PHP] Redirect to

2010-06-10 Thread Ahmed Mohsen

Hi folks,
I know that this is not a php question, but I'm sure it some kind 
related to it.  I need to put my public files under "public" folder, and 
other includes files and database config in other folder not shown to 
the public, but i don't know how to do that. I hope if some one show me 
how to achieve this.


For example, this is the directory structure:

/root
--/includes
db.php
config.php

--/public
/index.php
/images
/admin
--/login.php



I don't want to enter (example.com/public) to view index.php file.  I 
just want to enter (example.com) and it redirects to the public folder 
and shows only (example.com/index.php) in the URL.  And for login.php 
should display (example.com/admin/login.php) not 
(example.com/public/admin/login.php)


Kind regards,
Ahmed.

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



[PHP] Re: Test [don't read]

2010-06-07 Thread Ahmed Mohsen

On 6/7/2010 9:15 PM, João Cândido de Souza Neto wrote:

I couldn´t resist.


"tedd"  escreveu na mensagem
news:p0624080cc832e662f...@[192.168.1.102]...


--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com




me too ;)

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



[PHP] image thumbnail from blob data

2010-06-06 Thread saeed ahmed
hello friends,

image store into database in a blob field, But when I'm trying to retrieve
it from the database then its cause problems.

if I'm trying header( "Content-type: image/jpeg") (if my image type is
jpeg), then its working well. but when I'm trying to mixing up this with
some HTML code then its not working. Ok I understand its not working because
the header already sent by the browser.

now suggest me what should I use there to retrieve the image from database?
I have to mix the HTML code in my script. So is their any other way to do
this without header?

saeed ahmed
http://saeed05.wordpress.com


[PHP] dompdf class problem

2010-05-18 Thread saeed ahmed
I extremely sorry, if my topic isn't related with this group. I apologizes
for this.

I'm trying to add page number on the pdf. I have try the below code.
but couldn't get the page number at the pdf.
where I'm doing wrong. please suggest me.
';
$html .='
$font = Font_Metrics::get_font("verdana", "bold");
$dompdf->page_text(200, 16, "{PAGE_NUM} of
{PAGE_COUNT}", $font,
10, array(0,0,0)); ';
$html .=  '';
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");
?>

regards,
saeed


[PHP] special character problem

2010-04-27 Thread saeed ahmed
hello friends,

I have used

preg_replace('/[^0-9a-zа\~...@\$\%\^\*\(\)\;\,\.\'\/\_]/i', ' ',$match);

for remove the special characters.  its work fine. but the problem I want to
remove special characters from this kind of sentence

///

#: "'''''Amor''' é fogo que arde sem se ver,''
#: ''é ferida que dói, e não se sente,''
#: ''é um contentamento descontente,''
#: ''é dor que desatina sem doer.''"
#:: ''- Camões''


///

its remove all special character including é, ã, õ, which I do not want to.
I want to remove special character except these three. please suggest me...

-
Regards
Saeed Ahmed
http://saeed05.wordpress.com
-


Re: [PHP] collect string from string

2010-04-22 Thread saeed ahmed
yes I have used preg_match_all and preg_match. now its working.  thanks a
lot guys

-
Regards
Saeed Ahmed
http://saeed05.wordpress.com
-


On Fri, Apr 23, 2010 at 4:40 AM, Ashley Sheridan
wrote:

>  On Fri, 2010-04-23 at 02:38 +0600, saeed ahmed wrote:
>
>
> this is not working
>
> /^(\#.+)$/g
>
> I have tried the preg_match function
>
> -
> Regards
> Saeed Ahmedhttp://saeed05.wordpress.com
> -
>
>
> On Thu, Apr 22, 2010 at 11:39 PM, Ashley Sheridan
> 
> wrote:
>
> >  On Thu, 2010-04-22 at 23:41 +0600, saeed ahmed wrote:
> >
> > hello friend,
> >
> > I have a string like below
> > "
> >
> > ===Pronunciation===
> > * {{enPR|tē}}, {{IPA|/tiː/}}, {{SAMPA|/ti:/}}
> > * {{audio|en-us-tea.ogg|Audio (US)}}
> > * {{audio|En-uk-tea.ogg|Audio (UK)}}
> > *: {{rhymes|iː}}
> > * {{homophones|T|te|tee|ti}}
> >
> >
> > # {{uncountable}} The dried leaves or buds of the [[tea plant]],
> > ''[[w:Camellia sinensis|Camellia sinensis]]''.
> > #: ''Go to the supermarket and buy some '''tea'''.''
> > # {{uncountable}} The drink made by [[infuse|infusing]] these dried
> > leaves or buds in hot water.
> > Usage notes
> > In the [[United Kingdom]], [[Canada]], other English speaking
> > [[Commonwealth]] countries, and in northern areas of the [[United
> > States]], ''tea'' is assumed to mean [[hot]] tea and is usually served
> > in a [[teapot]] with separate [[cup]]s, or sometimes served directly
> > in cups such as for large groups or for [[takeout]].
> >
> > In southern areas of the United States, ''tea'' is assumed to mean
> > [[iced tea]] and is usually served with ice, either in a [[pitcher]]
> > with separate [[glass]]es or directly in glasses.
> >
> > Strictly speaking, "tea" has been reserved for [[infusion]]s made from
> > leaves of ''[[w:Camellia sinensis|Camellia sinensis]]''. Infusions
> > made from other [[herb]]s such as [[rooibos]], [[mint]]{{,}} and
> > [[chamomile]] are called [[tisane]]s. In recent years the word "tea"
> > has been extended to include the herbal infusions.
> >
> > Synonyms
> > * {{italbrac-colon|dried leaves of tea plant}} [[tea leaves]]
> > * {{italbrac-colon|drink made by infusing parts of various other
> > plants}} [[herb tea]], [[herbal tea]], [[infusion]], [[tisane]]
> >
> > Derived terms
> >
> > "
> >
> > now I want to collect only the string which are start with '#'. how
> > can I do this? please suggest me.
> >
> >
> > -
> > Regards
> > Saeed Ahmedhttp://saeed05.wordpress.com
>
> > -
> >
> >
> > If the text is in a file, use file() to read the contents into an array and
> > then check the first character.
> >
> > Alternatively, if the text is in a string, you could use a regex to pull
> > out only matching lines. This is an untested regex, but it should do the
> > trick:
> >
> > /^(\#.+)$/g
> >
> >   Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> >
>
>
> Do you have a bit more information other than 'not working'. Are you
> receiving an error of some kind? I'm assuming your data is in a string
> variable if you're using preg_match() yes?
>
>
>   Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>


Re: [PHP] collect string from string

2010-04-22 Thread saeed ahmed
this is not working

/^(\#.+)$/g

I have tried the preg_match function

-
Regards
Saeed Ahmed
http://saeed05.wordpress.com
-


On Thu, Apr 22, 2010 at 11:39 PM, Ashley Sheridan
wrote:

>  On Thu, 2010-04-22 at 23:41 +0600, saeed ahmed wrote:
>
> hello friend,
>
> I have a string like below
> "
>
> ===Pronunciation===
> * {{enPR|tē}}, {{IPA|/tiː/}}, {{SAMPA|/ti:/}}
> * {{audio|en-us-tea.ogg|Audio (US)}}
> * {{audio|En-uk-tea.ogg|Audio (UK)}}
> *: {{rhymes|iː}}
> * {{homophones|T|te|tee|ti}}
>
>
> # {{uncountable}} The dried leaves or buds of the [[tea plant]],
> ''[[w:Camellia sinensis|Camellia sinensis]]''.
> #: ''Go to the supermarket and buy some '''tea'''.''
> # {{uncountable}} The drink made by [[infuse|infusing]] these dried
> leaves or buds in hot water.
> Usage notes
> In the [[United Kingdom]], [[Canada]], other English speaking
> [[Commonwealth]] countries, and in northern areas of the [[United
> States]], ''tea'' is assumed to mean [[hot]] tea and is usually served
> in a [[teapot]] with separate [[cup]]s, or sometimes served directly
> in cups such as for large groups or for [[takeout]].
>
> In southern areas of the United States, ''tea'' is assumed to mean
> [[iced tea]] and is usually served with ice, either in a [[pitcher]]
> with separate [[glass]]es or directly in glasses.
>
> Strictly speaking, "tea" has been reserved for [[infusion]]s made from
> leaves of ''[[w:Camellia sinensis|Camellia sinensis]]''. Infusions
> made from other [[herb]]s such as [[rooibos]], [[mint]]{{,}} and
> [[chamomile]] are called [[tisane]]s. In recent years the word "tea"
> has been extended to include the herbal infusions.
>
> Synonyms
> * {{italbrac-colon|dried leaves of tea plant}} [[tea leaves]]
> * {{italbrac-colon|drink made by infusing parts of various other
> plants}} [[herb tea]], [[herbal tea]], [[infusion]], [[tisane]]
>
> Derived terms
>
> "
>
> now I want to collect only the string which are start with '#'. how
> can I do this? please suggest me.
>
>
> -
> Regards
> Saeed Ahmedhttp://saeed05.wordpress.com
> -
>
>
> If the text is in a file, use file() to read the contents into an array and
> then check the first character.
>
> Alternatively, if the text is in a string, you could use a regex to pull
> out only matching lines. This is an untested regex, but it should do the
> trick:
>
> /^(\#.+)$/g
>
>   Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>


[PHP] collect string from string

2010-04-22 Thread saeed ahmed
hello friend,

I have a string like below
"

===Pronunciation===
* {{enPR|tē}}, {{IPA|/tiː/}}, {{SAMPA|/ti:/}}
* {{audio|en-us-tea.ogg|Audio (US)}}
* {{audio|En-uk-tea.ogg|Audio (UK)}}
*: {{rhymes|iː}}
* {{homophones|T|te|tee|ti}}


# {{uncountable}} The dried leaves or buds of the [[tea plant]],
''[[w:Camellia sinensis|Camellia sinensis]]''.
#: ''Go to the supermarket and buy some '''tea'''.''
# {{uncountable}} The drink made by [[infuse|infusing]] these dried
leaves or buds in hot water.
Usage notes
In the [[United Kingdom]], [[Canada]], other English speaking
[[Commonwealth]] countries, and in northern areas of the [[United
States]], ''tea'' is assumed to mean [[hot]] tea and is usually served
in a [[teapot]] with separate [[cup]]s, or sometimes served directly
in cups such as for large groups or for [[takeout]].

In southern areas of the United States, ''tea'' is assumed to mean
[[iced tea]] and is usually served with ice, either in a [[pitcher]]
with separate [[glass]]es or directly in glasses.

Strictly speaking, "tea" has been reserved for [[infusion]]s made from
leaves of ''[[w:Camellia sinensis|Camellia sinensis]]''. Infusions
made from other [[herb]]s such as [[rooibos]], [[mint]]{{,}} and
[[chamomile]] are called [[tisane]]s. In recent years the word "tea"
has been extended to include the herbal infusions.

Synonyms
* {{italbrac-colon|dried leaves of tea plant}} [[tea leaves]]
* {{italbrac-colon|drink made by infusing parts of various other
plants}} [[herb tea]], [[herbal tea]], [[infusion]], [[tisane]]

Derived terms

"

now I want to collect only the string which are start with '#'. how
can I do this? please suggest me.


-
Regards
Saeed Ahmed
http://saeed05.wordpress.com
-


[PHP] wiki api help needed with php

2010-04-10 Thread saeed ahmed
I'm trying to do build a system which is described below.

"The user inputs a word. The system check if word exists at portuguese
section of wiktionary. If true,
get and show to user the word definiton. If false, sugest (displays) similar
words, as in Wiktionary,
with her links."

I have done this
http://troyee.com/example/sl_project_36/index.php

using this api
http://en.wiktionary.org/w/api.php?action=opensearch&search=api&format=xml&limit=1
*it is for english word.

Now I stuck with two questions

1. Am I going to the right way?
2. how to handle with portuguese section of wiktionary. which api will use
for this?


I need your useful suggestions please.

-
Regards
Saeed Ahmed
http://saeed05.wordpress.com
-


[PHP] how to get the local time

2010-03-15 Thread saeed ahmed
hi friends,

I'm trying to set local time in my php script. I was trying date and time
function but its always show the server time not local time. i need help on
this problem. how can i set the local time. i need sweden time zone
-
Regards
Saeed Ahmed
http://saeed05.wordpress.com
-


[PHP] Got a packet bigger than 'max_allowed_packet' bytes

2010-02-01 Thread saeed ahmed
i have write a script which search few element from a database. I use a text
file as input.

input file contains these kind of data

clubhouseforkids.com
cairouniversity.com
501c3nonprofit.com
mrbling.com
cellsocket.com

this is the scripts for read the file data

/**/
$file = fopen("files.txt", "r") or exit("Unable to open file!");

 while(!feof($file))
 {
 $data[] = stream_get_line($file, 100, "\n");
 }
 fclose($file);
//

this script worked fine for small size of file. but if i use a large size
like 900KB then its show "Got a packet bigger than 'max_allowed_packet'
bytes" .

where I'm doing wrong? please help me out there...


-
Regards
Saeed Ahmed
http://saeed05.wordpress.com
-


[PHP] Happy New Year

2009-12-31 Thread saeed ahmed
hi all my friends,

Happy New Year... from BANGLADESH

regards,
saeed


Re: [PHP] Ckeckbox list populated from database

2009-09-20 Thread saeed ahmed
you can do that
here is the example,

 >

--
Regards,
Saeed Ahmed
Rajshahi, Bangladesh
Blog: http://saeed05.wordpress.com
--
Follow Me Linkedin
<http://www.linkedin.com/in/sas05>Twitter<http://twitter.com/saeed05>


[PHP] how i assign a js variable to a php variable

2009-09-17 Thread saeed ahmed
hello guys,

i'm new here in this list. guys i need a help. i can't assign a js variable
value to a php variable. how can i do this?


--
Regards,
Saeed Ahmed
Rajshahi, Bangladesh
Blog: http://saeed05.wordpress.com
--
Follow Me Linkedin
<http://www.linkedin.com/in/sas05>Twitter<http://twitter.com/saeed05>


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


[PHP] standard safe permissions for php scripts in web directory

2008-11-13 Thread Noor Ahmed Afridi
Sounds like a weird question though :( what should be standard safe php
script/directory permissions under Apache.
-- 
Regards,
Noor Afridi


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



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


[PHP] Job Opportunities in Web Design company

2006-07-01 Thread Ahmed Abdel-Aliem

Safari Studio Inc. is looking for qualified
designers/developers for a full time/part time
position. This is position is available for
designers/developers that want to work in a company
that is growing.

click here to fill in the application form
http://www.safaristudio.net/hr/

Job Number 1 : PHP web developer
Job Type : Full Time

Job Description:

We need an experienced PHP/MySQL developer (based
anywhere) for long term work with our growing company.
The person hired will work for us Full time.

Qualifications
* Intermediate level PHP/MySQL programmer.
* Have experience in working with e-commerce.
* Fluent English is required.
* XHTML/CSS layout and design.
* Solid references and examples of previous work.
* Ability to come up with novel solutions.
* Fast learner. Fast worker.
* Dedicated.
* Easy to talk to, with a positive attitude.

Job Description

* Design and code a wide range of PHP and PHP/MySQL
applications.
* Modify a range of existing PHP and PHP/MySQL
applications.
* Full time commitment to our projects. Must be
reliable, trust-worthy and have a high level of
integrity.
* Must be available at all times during your shift on
Instant Messenger .
* Install/upgrade PHP applications.
* Must be able to multi-task, work independently, and
communicate.
We need an experienced PHP/MySQL developer (based
anywhere) for long term work with our growing company.
The person hired will work remotely for us on a
project basis. Hourly rate is nrgotiable.

click here to fill in the application form
http://www.safaristudio.net/hr/

Job Number 2 : Graphic/Web Designer
Job Type : Full Time

We want to hire multiple Designers who are experts
with the following:
Flash 8
Adobe Photoshop
Slicing Design in HTML

We are looking for someone that can prove themselves
through working project based. You will be graded on
being reliable, efficient and on time.

Multiple Designers will be selected. Pay will be great
as long as you can prove yourself to be the cream of
the crop. Individuals who demonstrate excellent
quality of work will be hired as full time.

Requirements:
- Expert level knowledge of the above mentioned
technologies
- Ability to develop an application based on a
functional description
- Available via an instant messenger MSN/Yahoo/etc.
- A reliable, high-speed DSL. internet connection
- Good English communication skills, both verbal and
grammar
- A telephone or Mobile
- Willingness to give frequent updates on work being
done and maintain a consistent work schedule
- Good organizational skills and work habits
- Resume and work samples.

click here to fill in the application form
http://www.safaristudio.net/hr/

Job Number 3: Marketing Representative
Job Type : Full Time

Requirements:
- fair level knowledge of the web design technologies
- Good Looking
- Negotiation Skills
- Good English communication skills, both verbal and
grammar
- A telephone or Mobile
- Good organizational skills and work habits

Please DO NOT apply if you:
- Do not meet any of the above requirements
- Are a company or group of individuals, we will only
hire individuals to perform contract work
- Are a recruiter, we will only hire individuals with
whom we can work with directly
click here to fill in the application form
http://www.safaristudio.net/hr/

SafariStudio Inc.
HR Department
http://www.safaristudio.net



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


Re: [PHP] detect user click "stop" button in browser

2006-06-23 Thread Ahmed Saad

On 23/06/06, Richard Lynch <[EMAIL PROTECTED]> wrote:

On Thu, June 22, 2006 4:16 am, weetat wrote:



An javascript thingie for "onStop" if it exists might help.



window.onunload


/ahmed

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



Re: [PHP] STRING TO ASCII CHARACTERS

2006-06-23 Thread Ahmed Saad

On 23/06/06, cajbecu <[EMAIL PROTECTED]> wrote:


  $data .= "&#".ord(substr($string,$i,1)).";";


and I think there's no need for substr.. just

$data .= "&#".$string[$i].";";


/ahmed

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



Re: [PHP] xmldoc

2006-06-23 Thread Ahmed Saad

On 23/06/06, weetat <[EMAIL PROTECTED]> wrote:

  Anybody have any ideas what happening here ?


Try this as the first line



You can remove it later, of course, but it would enable displaying php
errors as it's commonly disabled in production systems, AFAIK..


/ahmed

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



Re: [PHP] php calendar

2006-06-19 Thread Ahmed Saad

On 19/06/06, Ryan A <[EMAIL PROTECTED]> wrote:

guess i am using special version of google...


an iGoogle? ;)

/ahmed

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



Re: [PHP] serving video files with php

2006-06-17 Thread Ahmed Saad

On 15/06/06, Andras Kende <[EMAIL PROTECTED]> wrote:

Is there any drawback servings video files through php downloader script on
high load site?


the question is why you want that?

If you want to "log" how many times/when the video files were viewed,
you can send the request to a PHP script that does the logging first
and then send an HTTP redirection to the actual video file (but
actually users could bypass logging if they head directly for the
video URL)..

If you manipulate the video file on-the-fly, I think you might need to
consider caching with the above solution ..

/ahmed

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



Re: [PHP] transfer file

2006-06-17 Thread Ahmed Saad

Hi Richard..

On 15/06/06, Richard Lynch <[EMAIL PROTECTED]> wrote:

HTTP just plain ain't gonna let you open a file up for "writing" --
thank god.



I think it does in form of PUT requests..
http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
(apparently not supported by PHP streams(?))

Security restrictions to keep away black hats might be enforced
through HTTP authentication.


/ahmed

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



Re: [PHP] file_exists() behind firewall

2006-06-17 Thread Ahmed Saad

On 17/06/06, Richard Lynch <[EMAIL PROTECTED]> wrote:

I dunno if AJAX will let you quit partway through, but you could
definitely do this with the lean and mean hand-coded XmlHttpRequest
object and sending HEAD to see if the URL is "there" or not.


For security reasons, an XMLHttpRequest objects can only communicate
with the originating server. And even if it could, it supports only
HTTP (so the PDFs have to be put on a web server behind the firewall).
You might want to consider a client-side technology that supports more
protocols than just HTTP (e.g a signed Java applet that prompts users
for the necessary permissions, ?) if that's not the case (SSH, or even
in a database.. )


/ahmed

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



[PHP] remove keys from array

2006-06-11 Thread Ahmed Abdel-Aliem

hi all
when i have array in the form of :
Array ( [0] => 2 [ID] => 2 [1] => asdasd [CategoryName] => asdasd ) )
how can i make it in the form of :
Array ( [ID] => 2 [CategoryName] => asdasd ) )

can anyone help me with that plz ?

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


Re: [PHP] PHP Standard style of writing your code

2006-04-25 Thread Ahmed Saad
On 4/25/06, Richard Lynch <[EMAIL PROTECTED]> wrote:
> Now *THAT* would be a feature worth paying for in an IDE! :-)


Well, you actually don't have to pay anything. TruStudion PHP
foundation version (read free/open source version) has a decent code
formatter and a pretty neat editor: argument order, code completion
and insight working with PHP 4 and 5 (unlike PHPEclipse), code 
templates, ...

http://www.xored.com/trustudio


Regards,
Ahmed


Re: [PHP] list noise [WAS: How to find tag and get src of image]

2006-04-25 Thread Ahmed Saad
On 4/25/06, Robert Cummings <[EMAIL PROTECTED]> wrote:
> If you carefully comb the archives you'll see that many of us that make
> quite liberal use of RTFM also quite often give answers to the same
> simple questions, and often quite recently.

That's a _quite_ true statement, I think :)


I have been reading the list for around a year now but unfortunately I
haven't really been active. I think maybe we can handle the
newbie-style of threads with a protocol (a stateless one is much
recommended ;)

a) Write a short answer or a pointer to some page about the subject
(where an answer could be found. Same applies to the PHP manual)
b) Write a pointer to a How-to-ask-questions-the-smart-way-style
document, gently pointing out what was wrong.

RTFMs may be well deserved if the come back doing it again (which
doesn't happen that often)


Regards,
Ahmed


Re: [PHP] strange php url

2006-04-24 Thread Ahmed Saad
On 4/21/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> redirects to:
> http://www.example.com/index.php?action=edit&type=customer&id=1234&adminaccess=1


and you put admin access flags (read, determine roles) in URL parameters?


-ahmed


[PHP] Re: interview

2006-04-13 Thread Ahmed Saad
On 4/13/06, Mad Unix <[EMAIL PROTECTED]> wrote:
> can you please send some interview questions for php
> i have in few days to inteview some people.

Well, a simple google search could have saved you all this

http://www.google.com/search?q=php+interview+questions

and do NOT try PHP at home! It's highly flammable ;)


/ahmed


Re: [PHP] CURLOPT_BINARYTRANSFER

2006-04-13 Thread Ahmed Saad
Hi Richard,

On 4/12/06, Richard Lynch <[EMAIL PROTECTED]> wrote:
> I need the cookies and all that...

There's a PHP implementation of an HTTP client at
http://www.phpclasses.org/browse/package/576.html
Even if you needed to tweak something, it should be easier to modify and debug

good luck

/ahmed


[PHP] Contact List Grabber

2006-03-05 Thread Ahmed Abdel-Aliem
Hi
i would like to make a script to import contact list from msn, yahoo
and gmail instant messenger.
any ideas or tutorial on how to do that.
any help will 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



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] wrapping anchor tags around a URL

2006-01-26 Thread Ahmed Saad
On 1/26/06, Richard K Miller <[EMAIL PROTECTED]> wrote:
> @(http://\S+)(?!\.)@   -- this still captures everything
> @(http://\S+?)(?!\.)@-- this captures too little

hmm maybe this would work?

@http://.+(?=\.)@


Re: [PHP] wrapping anchor tags around a URL

2006-01-25 Thread Ahmed Saad
On 1/25/06, Ahmed Saad <[EMAIL PROTECTED]> wrote:
> On 1/25/06, Ahmed Saad <[EMAIL PROTECTED]> wrote:
> > On 1/23/06, Richard K Miller <[EMAIL PROTECTED]> wrote:
> >
> > > function link_the_links($s) {
> > > return preg_replace('@(http://[^\s]+)@sm', '$1', 
> > > $s);
> > > }

try "looking ahead" in the first regex
http://www.regular-expressions.info/lookaround.html


-ahmed


Re: [PHP] wrapping anchor tags around a URL

2006-01-25 Thread Ahmed Saad
On 1/25/06, Ahmed Saad <[EMAIL PROTECTED]> wrote:
> On 1/23/06, Richard K Miller <[EMAIL PROTECTED]> wrote:
>
> > function link_the_links($s) {
> > return preg_replace('@(http://[^\s]+)@sm', '$1', 
> > $s);
> > }

> if ($s[strlen($s)-1] == '.'){
>   $s = substr($s, 0, -1);
> }

oops! sorry i thought $s had only one link (per time) no all of them


-ahmed


Re: [PHP] wrapping anchor tags around a URL

2006-01-25 Thread Ahmed Saad
On 1/23/06, Richard K Miller <[EMAIL PROTECTED]> wrote:

> function link_the_links($s) {
> return preg_replace('@(http://[^\s]+)@sm', '$1', $s);
> }

> I've got to somehow ignore the trailing period if it is present.

if ($s[strlen($s)-1] == '.'){
  $s = substr($s, 0, -1);
}

-ahmed


Re: [PHP] Image handling advice needed

2006-01-18 Thread Ahmed Saad
On 1/18/06, William Stokes <[EMAIL PROTECTED]> wrote:

> I'am trying to deside between two options. To resize (=scale down) the
> images once they are uploaded to server and store the smaller file or upload
> and store the original BIG file and scale it to thumbnail once it's viewed.
> Any opinnions about this.


Why not scaled them once and for all (first option)? are you going to
need them in BIG size on the server or anything else?

-ahmed


Re: [PHP] FW: error de php!

2006-01-18 Thread Ahmed Saad
On 1/18/06, Miguel Guirao <[EMAIL PROTECTED]> wrote:
>  $this->$NumDias = $unixtime2 - $unixtime1;   <--- This is the line 44


hmm wasn't it supposed to be $this->NumDias? (with no $ before the propery name)

-ahmed


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



[PHP] printing keys and values of array

2006-01-05 Thread Ahmed Abdel-Aliem
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



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] detecting file size

2005-12-13 Thread Ahmed Saad
Ahmed basha :)

On 12/12/05, Ahmed Abdel-Aliem <[EMAIL PROTECTED]> wrote:
> i know i can detect the file size after being uploaded, but i do want
> to detect the file after it is being uploaded to the server.

You may want to read this code walkthrough
http://blog.joshuaeichorn.com/archives/2005/05/01/ajax-file-upload-progress/

-ahmed


[PHP] detecting file size

2005-12-12 Thread Ahmed Abdel-Aliem
hi
i am making a form to upload files to server
i know i can detect the file size after being uploaded, but i do want
to detect the file after it is being uploaded to the server.
is there anyway i can do this ?

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



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



  1   2   3   >