php-general Digest 24 Jan 2004 15:24:48 -0000 Issue 2549

Topics (messages 175608 through 175632):

How do you set up table columns for numerals?
        175608 by: Freedomware
        175612 by: Giz
        175613 by: Freedomware
        175615 by: David OBrien

Re: Securing php from rogue php scripts
        175609 by: David T-G

Re: Function for crypt and decript.
        175610 by: Justin French

Re: what PHP really needs
        175611 by: Jason Sheets
        175618 by: Hamid Hossain

porting perl scripts to php
        175614 by: admin.datazap.net

Re: Session time-out value
        175616 by: Jason Wong

Re: can't figure out this mysql error
        175617 by: Jason Wong

Using templates (Code & User Interface)
        175619 by: Hamid Hossain
        175631 by: rush

AFter the URL in PHP
        175620 by: Randy  Johnson
        175622 by: Justin French

XSL
        175621 by: Aidan Lister
        175632 by: Tobias Bradtke

Re: "Additional Features for working with linked Tables have been deactivated."
        175623 by: Aidan Lister
        175624 by: Freedomware
        175626 by: Jason Wong
        175627 by: Freedomware
        175628 by: Jason Wong

Importing Data with EMS MySQL Manager
        175625 by: Freedomware

mycrypt on local doesn't decode but does on web server?
        175629 by: Will
        175630 by: Tom Rogers

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message --- I'm having some roblems creating a table with phpMyAdmin. I think they're pretty minor problems, mostly relating to numerals.

Would someone be willing to look at my notes at http://geowebworks.geobop.org/mysql/3.php - especially the last picture - and suggest what I need to do to fix it?

It's also possible the instructions I'm following are flawed, though they look pretty sensible. Here's the last error message I got:

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(20), `Area` VARCHAR(6), `Area` SMALLINT(8), `HighestAltitude`
--- End Message ---
--- Begin Message ---
I looked at your page.  First off, you should add a primary key column that
has no information in it.  Just make this a number(4) called state_id. 
Then you will be able to specify that it's auto_increment.  The problem you
had is that you tried to make a varchar column auto_increment which makes no
sense.  Auto_increment will start at 1 and each time you insert a new row
will assign a unique key = max(state_id)+1

Also any number columns should be number types.  You can apply formatting
(commas separating 100's) when you select the data or present it with php.

As for your other issues, I can't see what the error message was, but when
you are using number types like smallint, you shouldn't specify lengths..
these are implicit in the type.  A smallint for example is 2 bytes. This
means that you have 64k of possible integers that can be stored in there.
What you do want to make sure is that it's unsigned.


-----Original Message-----
From: Freedomware [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 23, 2004 6:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How do you set up table columns for numerals?

I'm having some roblems creating a table with phpMyAdmin. I think 
they're pretty minor problems, mostly relating to numerals.

Would someone be willing to look at my notes at 
http://geowebworks.geobop.org/mysql/3.php - especially the last picture 
- and suggest what I need to do to fix it?

It's also possible the instructions I'm following are flawed, though 
they look pretty sensible. Here's the last error message I got:

#1064 - You have an error in your SQL syntax.  Check the manual that 
corresponds to your MySQL server version for the right syntax to use 
near '(20), `Area` VARCHAR(6), `Area` SMALLINT(8), `HighestAltitude`

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

--- End Message ---
--- Begin Message --- Giz wrote:

I looked at your page.  First off, you should add a primary key column that
has no information in it.  Just make this a number(4) called state_id.

OK, I gave it another try, but I don't see where I type in "4."

When I clicked Save, I got an error message: "This is not a number!" but it didn't specify what it was referring to.

I put a screenshot online at http://geowebworks.geobop.org/mysql/3.php - the last picture on the page. Thanks.
--- End Message ---
--- Begin Message ---
normally auto_increment fields need to be of a number type  not varchar
-Dave

At 11:30 PM 1/23/2004, Freedomware wrote:
Giz wrote:

I looked at your page.  First off, you should add a primary key column that
has no information in it.  Just make this a number(4) called state_id.

OK, I gave it another try, but I don't see where I type in "4."

When I clicked Save, I got an error message: "This is not a number!" but it didn't specify what it was referring to.

I put a screenshot online at http://geowebworks.geobop.org/mysql/3.php - the last picture on the page. Thanks.

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

--- End Message ---
--- Begin Message ---
Adrian, et al --

...and then Adrian Teasdale said...
% 
% Hi there

Hi!


% 
% I have been reading about certain php scripts that, if used incorrectly,
% can compromise servers. There are certain open source scripts that I

Interesting.


% know if (no names mentioned) that have exploits that allow this and I
% want to know if there is a "How to" or best practice anywhere for
% securing PHP against this.  I was told to add some stuff to the php.ini
% file to prevent certain actions (phpinfo ,system, include, chown, chmod,
% exec, passthru, mail, readfile , dir , read, readdir) but was wondering
% if someone could give some advice

1) I'm no expert, though I'd like to be somewhat closer

2) If you're not speaking of safe mode, then look at safe mode

3) Please share what you find to help others, including me.


% 
% 
% Thanks
% 
% Ade


TIA & HTH & HAND

:-D
-- 
David T-G                      * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: pgp00000.pgp
Description: PGP signature


--- End Message ---
--- Begin Message --- On Friday, January 23, 2004, at 08:55 PM, <[EMAIL PROTECTED]> wrote:

Hi all,
are in PHP, functions for crypt and decrypt string?
I would to use this function in my script in PHP, how can I use this?
I need of an example for use this and a list of this function.

Thanks in advance.

READ THE MANUAL SEARCH THE MANUAL

I was able to find this page by searching the entire site for 'encrypt' in around 10 seconds, and there are more pages to be found.

http://www.php.net/mcrypt

Justin French
--- End Message ---
--- Begin Message --- Chris Boget wrote:

I'm not really sure and am possibly wayyyy off base but...cant something
like this also be done by using "global" for variables?



No, not really. That wouldn't be accessable by all users, which, as it turns out, is what the OP had asked for.

Chris



Like someone else mentioned using PHP's shared memory functions would get you close.

I prefer to use something like Turck MMCache to cache the compiled php script rather than using shared memory.

PHP not making variables accessible to all instances is a feature a lot of people depend on, very few PHP programmers seem to unset variables when they are done with them unfortunately

If you are wanting to cache information consider serialize like others have said, there is very little PHP doesn't already do, if you are having a problem attack it from another angle because it is most likely you have not designed the best solution to the problem.

It is always best to define the problem before deciding on a solution.

Jason
--- End Message ---
--- Begin Message --- As a ColdFusion Certified Developer I can say: You are right!

In CF you can fire a sql statment and store its result in a variable which is not going to be removed from the server's memory after responding to the user. That variable will be available for sometime declared by you when you created the query.

This is usefull, suppose you want to show the last 20 recoreds added to your site, you will fire the query once per hour! So, if your site visitors are 1000 per hour, your transaction to the actual db will be 1 time per hour not 1000 per hour.

Sounds Greate!

That also has a drawback, you have to be smart enough. You should use this feature only if your query is fixed and it should return some limited value. For example, you cannot store your search results because each and every visitor will use his own key words.

Regards,
Hamid Hossain
Saudi Arabia


----Original Message Follows---- From: "PHP general" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: [PHP] what PHP really needs Date: Fri, 23 Jan 2004 20:42:59 +0100

There's 1 really important thing missing in PHP as I see it, and it's the
ability to keep variables in memory for as long as
the programmer choose. If this was possible there could be some truly great
optimizations done. Some things are very
slow to create but very fast to work with. I wrote a XML class a couple of
days ago and while it's extremly quick to
search and work with, sadly it's rendered pretty much useless since creating
the tree which it uses isn't fast enough.

I've heard there's a feature like this in Cold Fusion, which every Cold
Fusion user seems to think of  as the holy grail,
and I would have to agree with them.

One thing I've heard they use this for is to load an entire database into
system memory. I don't know exactly how it's
works but imagine having the whole database in system memory. When you
change data you update it both in system
memory and on the drive, but when you select (which is what you mostly do),
you just query the mirror in system memory.

So how cost effective could this be? 1GB of system memory is pretty much
minimum on a decent server today.
Assuming the site generates aprox 1 million bytes worth of data every day
(storing images and other types of massive data
in the tables would perhaps not be apropiate) the site could be up and
runing for 1 thousand days. And if you just keep
tables that gets queried a lot, but doesn't get altered often, you could
most likely come up with a great compromise.

I can't say for sure how much faster things would be but I'm guessing at
several 1000% faster, however I might be way off.

The only drawback I can see is that there might be multi threading issues,
so if this would be implemented a new key word
would probably have to be introduced to make data mutexed, or perhaps the
other way around to avoid to many people
scratching their heads.

/Sebastian Karlsson

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

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail
--- End Message ---
--- Begin Message ---
Hi,

I was wondering if there is an easy way to port perl scripts to php, or
maybe someone could recommend someone who could help me?

Thanks,
Al

--- End Message ---
--- Begin Message ---
On Saturday 24 January 2004 05:46, Pushpinder Singh wrote:

>    I tried to keep a .htaccess file in the Dir that my application
> esided in and kept the session lifetime of about 8 hrs. However I
> checked to see after 2 hr and it had already kicked me out of the
> system. Please advise.

Does your hosting service allow you to use .htaccess files?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
You can't fall off the floor.
*/

--- End Message ---
--- Begin Message ---
On Saturday 24 January 2004 01:07, Chris W. Parker wrote:

>     on Friday, January 23, 2004 8:54 AM said:
> > All of what you say makes sense. Hopefully your suggestion will help
> > me find the problem!
>
> In looking through my code I see that I already do this. EVERY call to a
> mysql function has "or die($this->stop("$current_line:".__LINE__));"
> along with the call. $this->stop() is method that prints out
> mysql_errno(); and mysql_error();.
>
> In this case the "or die" is not even being tripped meaning there isn't
> an error. I'm beginning to think it's a bug, but it's more likely that
> it's not.
>
> Here's another bit of crazy to throw in. The function I am trying to
> perform is that of adding a record to my db. Guess what? The record
> insertion is successul each time. And no I'm not closing the resource/db
> link before those two functions are called. They happen immediately
> after the the mysql_query() function.
>
> Sounds pretty fishy....

Time to put the php debugger in action -- echo all your variables to see that 
contain what you expect them to contain.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
An expert is the person who avoids the small errors while sweeping on to the 
grand fallacy
                -- Thoreau's Theories of Adaption n1
*/

--- End Message ---
--- Begin Message --- Hi,

Always I have a problem that I don't know how to make my code away from the user interface files.

I tried to use some template classes, but I did'nt like what I tired because some if statments are used inside the template.

How can I prepare my code to be working in more that one template? Should I use some methodology like FuseBox.org

Regards,
Hamid Hossain

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail
--- End Message ---
--- Begin Message ---
"Hamid Hossain" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Always I have a problem that I don't know how to make my code away from
the
> user interface files.
>
> I tried to use some template classes, but I did'nt like what I tired
because
> some if statments are used inside the template.

Maybe you could try to use TemplateTamer. With TT there are no statements
inside the template (like if loops etc), in template file there are only
begin i end markers which show where some template starts and palceholders
for variables, and that is all. All program logic is stored in separate php
file, and programed in standard php.

Aside from that TemplateTamer commes with IDE to develop in which shows you
structure of the templates in tree like view, lets you conviniently edit
template and coresponding php file, keeps account of all files in the
project, and even has some rudimentary vizards that can offer you some code
that fits your template.

So if this sounds interesting please try it, and also do not hesitate to
mail me if you have some questions, or need some advice.

rush
--
http://www.templatetamer.com/

--- End Message ---
--- Begin Message ---
Hello,

I am not sure if this is a php thing or not but hope is...


I see some sites like this:

www.domain.com/tree

where tree is not a directory

for example 
www.domain.com/tree/   would not work


the word tree above is not really a directory but a username or id or whatever....

Anybody know what I am talking about?

Thanks

Randy



--- End Message ---
--- Begin Message --- On Saturday, January 24, 2004, at 05:57 PM, Randy Johnson wrote:

Hello,

I am not sure if this is a php thing or not but hope is...


I see some sites like this:

www.domain.com/tree

where tree is not a directory

for example
www.domain.com/tree/   would not work


the word tree above is not really a directory but a username or id or whatever....

Anybody know what I am talking about?

Apache mod_rewrite.

Typically, it can be used for things like [internally] converting the url from...
http://example.com/articles/45/
...to...
http://example.com/articles.php?id=45

It's a big can of worms to open, but searching for 'mod_rewrite tutorial' on google, or looking at the sitepoint.com forums (they have a mod_rewrite forum especially) and do some research.

Either way, it's not really a PHP question :)


Justin French
--- End Message ---
--- Begin Message ---
I am attempting to put this in my XSL, <a href="<xsl:value-of select="link"
/>">, However I get a ton of errors. How do I do this properly?

--- End Message ---
--- Begin Message ---
Aidan Lister wrote:
> I am attempting to put this in my XSL, <a href="<xsl:value-of select="link"
> />">, However I get a ton of errors. How do I do this properly?


try something like this:
  <a href="{link}"></a>

or this:
  <a>
    <xsl:attribute name="href"><xsl:value-of select="link"
/></xsl:attribute>
  </a>

(^untested, but this is the way to do it in xsl..)

look here: http://www.w3.org/TR/xslt#dt-attribute-value-template


greetz!
webwurst

--- End Message ---
--- Begin Message ---
How about checking the phpmyadmin documentation, where this is all clearly
explained?


"Freedomware" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> It looks like all the databases I view with phpMyAdmin feature the
> following error message:
>
> "The additional Features for working with linked Tables have been
> deactivated. To find out why click here."
>
>
> When I click the link, I get this:
>
> Database mysql  running on localhost
> $cfg['Servers'][$i]['pmadb'] ... not OK [ Documentation ]
>
> $cfg['Servers'][$i]['relation'] ... not OK [ Documentation ]
> General relation features: Disabled
>
> $cfg['Servers'][$i]['table_info'] ... not OK [ Documentation ]
> Display Features: Disabled
>
> $cfg['Servers'][$i]['table_coords'] ... not OK [ Documentation ]
> $cfg['Servers'][$i]['pdf_pages'] ... not OK [ Documentation ]
> Creation of PDFs: Disabled
>
> $cfg['Servers'][$i]['column_info'] ... not OK [ Documentation ]
> Displaying Column Comments: Disabled
> Bookmarked SQL-query: Disabled
> MIME ... not OK [ Documentation ]
> $cfg['Servers'][$i]['history'] ... not OK [ Documentation ]
> SQL-history: Disabled
>
>
> Rather than troubleshoot all seven of these, can you see any evidence of
> a central problem that might be causing it? Or is there some way to work
> around it?
>
> Thanks.

--- End Message ---
--- Begin Message --- Aidan Lister wrote:

How about checking the phpmyadmin documentation, where this is all clearly
explained?

I thought it made more sense to see if anyone who's been through this before knows of a quick fix - before I dive into SEVEN "documentation" links, none of which strike me as particularly "clear."
--- End Message ---
--- Begin Message ---
On Saturday 24 January 2004 15:22, Freedomware wrote:
> Aidan Lister wrote:
> > How about checking the phpmyadmin documentation, where this is all
> > clearly explained?
>
> I thought it made more sense to see if anyone who's been through this
> before knows of a quick fix - before I dive into SEVEN "documentation"
> links, none of which strike me as particularly "clear."

It makes even more sense to ask on the phpmyadmin list/forum?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Freedom is nothing else but the chance to do better.
                -- Camus
*/

--- End Message ---
--- Begin Message --- Jason Wong wrote:

> It makes even more sense to ask on the phpmyadmin list/forum?


I thought this was a general purpose PHP list and some people who frequent this list had used phpMyAdmin. My mistake.
--- End Message ---
--- Begin Message ---
On Saturday 24 January 2004 15:51, Freedomware wrote:

> I thought this was a general purpose PHP list 

It is. But your questions have nowt to do with PHP.

> and some people who
> frequent this list had used phpMyAdmin. My mistake.

The people frequenting the phpMyAdmin list/forum are *more* likely to be using 
phpMyAdmin and the people frequenting this list.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Most people can do without the essentials, but not without the luxuries.
*/

--- End Message ---
--- Begin Message --- I'm getting closer. I find that I can work around a lot of problems by creating tables in EMS MySQL Manager, which also has a neat feature for importing data from CSV files.

Has anyone done this with EMS MysQL Manager before? If so, would you mind looking at http://geowebworks.geobop.org/mysql/csv/ and seeing if you can see where I went off track?

It looks like I'm probably just doing one or two things wrong now. Thanks.
--- End Message ---
--- Begin Message ---

Hello, I am hoping that some body might be able to point out what is going wrong.

 

Basically I am running apache2 etc (sokkit) on a local MS XP machine. I downloaded libmcrypt.dll from http://ftp.emini.dk/pub/php/win32/mcrypt/ as specified on php.net

underMcrypt Encryption Functions’ and configured with no probs.

 

Viewing my local phpinfo() mcrypt: is showing up however with less supported ciphers than on the web server I use, but that’s not a problem.

 

So I run the script on localhost. It encodes but won’t decode. I run the same script on the web server and all works? What am I missing none of the functions are returning any error #s / Falses etc.

 

Code is attached.

 

Thanks for any help or advice

 

Will

 


I've stopped 46,300 spam messages. You can too!
One month FREE spam protection at www.cloudmark.com
Cloudmark SpamNet - Join the fight against spam!

 

<<image001.gif>>


--- End Message ---
--- Begin Message ---
Hi,

Saturday, January 24, 2004, 11:02:23 PM, you wrote:
W> Hello, I am hoping that some body might be able to point outwhat is going wrong.

W>  

W> Basically I am running apache2 etc (sokkit) on a local MS
W> XPmachine. I downloaded libmcrypt.dll from
W> http://ftp.emini.dk/pub/php/win32/mcrypt/as specified on php.net

W> under ‘Mcrypt Encryption Functions’ and configuredwith no probs. 

W>  

W> Viewing my local phpinfo() mcrypt: is showingup however with
W> less supported ciphers than on the web server I use, but that’snot
W> a problem.

W>  

W> So I run the script on localhost. It encodes but won’t decode.
W> Irun the same script on the web server and all works? What am I
W> missing none ofthe functions are returning any error #s / Falses
W> etc. 

W>  

W> Code is attached.

W>  

W> Thanks for any help or advice

W>  

W> Will

Get the dll from here and try (just the mycrypt.dll, don't use the
php_mycrypt.dll it is missing a bit)

http://ftp.proventum.net/pub/php/win32/misc/mcrypt/


-- 
regards,
Tom

--- End Message ---

Reply via email to