Gossamer Forum
Home : General : Internet Technologies :

Perl and PHP

Quote Reply
Perl and PHP
Are there any problems in running a site using both perl and PHP? For example my database (DBmanSQL) is perl but it looks like I will have to use a PHP password/user manager. Can anyone see any problems or is it common practice these days?

I know nothing about PHP (and have been struggling with perl for about 2 years) but I am wondering if it's going to be confusing working with both? Should I make the effort and learn PHP?

Any advice?

Thanks

Simon
Quote Reply
Re: [jai] Perl and PHP In reply to
If possible, try and keep the frontend in one language, and the backend of the site in the same one. If not, then at least try and make it stay as much to one language as possible. Both my sites use PHP, but thats because I write all my own applications, so they do exactly what I need them to do. If you have the knowledge,I would suggest doing the same thing :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Perl and PHP In reply to
Thanks Andy!

So if I want to use DBManSQL I should really try to find a Perl password/user manager to run with it? Is that what you are saying?

What kind of problems can you see if one is Perl and the other is PHP?

Also, is PHP easier to learn than perl?

Thanks

Simon.
Quote Reply
Re: [jai] Perl and PHP In reply to
What kind of stuff are you looking in a password manager? Does it need to be .htaccess, or a MySQL database one?

>>>Also, is PHP easier to learn than perl? <<<

It depends on what you want to do really. In Perl, its a lot easier to do stuff with regexes ... i.e;

Code:
$var =~ m,(.+?)/(.+?)/(.+?),;
my $var1 = $1;
my $var2 = $2;
my $var3 = $3;

.. but in PHP, I have yet to work out how to do this Tongue I'm just using this as an example, as its very practical.

However, in Perl, to get rid of leading/trailing spaces, you have to do;

Code:
$var =~ s/^\s//g;
$var =~ s/\s$//g;

... whilst in PHP, you could use;

Code:
$var = trim($var);

If possible, learn both languages.. they both have their ups, and also their downs :p

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Perl and PHP In reply to
   

Andy,

As I mentioned in my other post, Pasword/Account Manager, I thought that most of the good applications use .htaccess plus a MySQL database. Do some use one or the other? I'm not sure of the difference.

I like the features of aMember http://membership.cgi-central.net/scripts/amember/ which uses .htaccess plus a MySQL database. But, aparently it can't be fully internationalized (error messages and currency formats) so I'm still thinking about it.

Would you like to write a Perl based password manager that is fully compatible with DBManSQL??????

Thanks

Simon.
Quote Reply
Re: [jai] Perl and PHP In reply to
>>>Would you like to write a Perl based password manager that is fully compatible with DBManSQL?????? <<<

LOL...I'm still trying to figure out DBMan SQL plugins/globals at the moment. I only started playing with it yesterday Tongue

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Perl and PHP In reply to
Andy,

Can you explain the following please -

1/ What's the difference in the password managers that use .htaccess, the ones that use MySQL and the ones that use BOTH? I'm still trying to understand this?

2/ Do you recommend that I stick with a perl password manager if I am using DBManSQL???

Thanks

Simon.
Quote Reply
Re: [jai] Perl and PHP In reply to
1) .htaccess is a lot more secure than a MySQL system, due to the encryption methods. You can set .htaccess to block a users IP, if they enter an incorrect password more than a few times. With a MySQLscript, you could do this, but it would require editing a .htaccess script (or your main config file), so that it block their IP. With the combo scripts (both .htaccess and MySQL), I would imagine they store the user/password in the .htaccess file, and the user + other details in the MySQL database. That way, when someone logs in.. they can grab the .htaccess username they are logged in with, and cross reference it with the MySQL database.

2) If you can find one that works, then yes. If not, then just make do with what you can do/find. The beauty of PHP/Perl, is that its open source... so you can just modify the core codes to do what you want Smile

Chees

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [jai] Perl and PHP In reply to
Hi,

No, there is no problem at all with running a mix of perl and php on your site.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Perl and PHP In reply to
>>>No, there is no problem at all with running a mix of perl and php on your site. <<<

As long as you know how to integrate them Tongue I knew someone once, who tried to use a PHP Shopping cart, a Perl validation script for PayPal, and a PHP contact script (they wanted the contact script and paypal script integrated into the shopping cart).

Just my personal opinion :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Alex] Perl and PHP In reply to
Thanks Alex.

If you read through this post you would have gathered that I am looking for a password/user manager to use with DBManSQL. I just sent a request via the GT webform on your services page asking for a price for GT to develop it for me. Would'nt it be a useful product for everyone!!!!!!!!!!!!!!!!!!!!!!!

Thank you.

Simon.

Last edited by:

jai: Aug 27, 2003, 7:31 AM
Quote Reply
Re: [Andy] Perl and PHP In reply to
Well, it's easy enough to pass variables on from PHP to Perl or vice versa, or onto Flash for that matter. I don't really see what the problem is in regards to 'integration'. Both can also use the same backend system and the same databases.

If I really wanted to I could engineer a multi-page form consiting of:

First page in PHP -> second page in perl with all variables passed to it from our PHP page -> third results page in flash with variables passed to it via the Perl page.

- wil

Last edited by:

Wil: Aug 27, 2003, 8:08 AM
Quote Reply
Re: [Wil] Perl and PHP In reply to
Of course its possible, I was refering to it in terms of how easy it would be Wink

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!