Re: [PHP] How do i replace table names?

2003-11-03 Thread zhuravlev alexander
On Mon, Nov 03, 2003 at 04:37:41PM +0100, Bas wrote:
> OKAY, I WANT TO REPLACE IN THE TABLENAME THE TEXT BAS_ WITH DUMMY_
> 
> SUCH LIKE THAT "CREATE TABLE BAS_DATA" BECOMES "CREATE TABLE DUMMY_DATA"
> 
> I AM NOT THAT DUMB... I JUST WANT TO REPLACE 1 TABLE PREFIX BY ANOTHER!!!

sed -i.bak -e s'/BAS_/DUMMY_/g' your_sql_file.sql 


     -- zhuravlev alexander
   u l s t u  n o c

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



Re: [PHP] PHP Documentation procedure

2003-11-05 Thread zhuravlev alexander
On Wed, Nov 05, 2003 at 10:42:02AM -0600, Ahbaid Gaffoor wrote:
> Is there any utility that can be run against a php script to generate 
> documentation of the functions in that script?
> 
> Sort of like javadoc is for java code

http://www.phpdoc.de/
http://phpdocu.sourceforge.net/

 -- zhuravlev alexander
   u l s t u  n o c
 ([EMAIL PROTECTED])

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



Re: [PHP] Help with scripts to add records to a database

2003-11-11 Thread zhuravlev alexander
On Tue, Nov 11, 2003 at 07:44:58PM -0800, Mark wrote:
> I am following the tutorial at
> http://www.freewebmasterhelp.com/tutorials/phpmysql/
> The source code is on the website on the left hand side
> http://www.freewebmasterhelp.com/static/tutorials/phpmysql/example.zip
> 
> 
> My software:
> PHP version 4.3.4 on Windows 2000
> MYSQL version 4.0.16 on Windows 2000
> Apache version 1.3.29 on Windows 2000
> 
> The problem is I cannot get the database to add a new records aside from
> the auto-increment field. All the other fields are left blank when the
> add.html is subitted. 
> 
> I have the add.html with the following code exactly the same as the
> source code.
> 
> 
> First Name: 
> Last Name: 
> Phone: 
> Mobile: 
> Fax: 
> E-mail: 
> Web: 
> 
> 
> 
> 
> The insert.php
>  include("dbinfo.inc.php");
> mysql_connect(localhost,$username,$password);
> @mysql_select_db($database) or die( "Unable to select database"); 
> 
> $query = "INSERT INTO contacts VALUES
> ('','$first','$last','$phone','$mobile','$fax','$email','$web')";

http://ru3.php.net/manual/en/security.registerglobals.php

try 
$query = "insert into contacts values 
('',".$_POST['first'].",".$_POST['last'].",".$_POST['phone'].",".$_POST['mobile'],",".$_POST['fax'].",".$_POST['email'].",".$_POST['web'].")";

and so on ... 

> mysql_query($query);
> 
> mysql_close();
> ?> 
> 
> 
> 
> Any help would be much appreciated.
> 
> Regards,
> Mark
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

 -- zhuravlev alexander
   u l s t u  n o c
 ([EMAIL PROTECTED])

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



Re: [PHP] X-Cart

2003-11-13 Thread zhuravlev alexander
On Thu, Nov 13, 2003 at 02:54:35PM -0300, Ing. Gustavo Edelstein wrote:
> Hi list members,
> 
> Has anybody been working with the software X-Cart ?

Yes, we are.

Which question do you have?


     -- zhuravlev alexander

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



Re: [PHP] X-Cart

2003-11-13 Thread zhuravlev alexander
On Thu, Nov 13, 2003 at 04:39:35PM -0300, Ing. Gustavo Edelstein wrote:
> Hi Alexander,
> 
> Lets say i'll sell T-Shirts. They comes is differents sizes (S, M, L, XL...)
> and I've different stock amounts for each one of them and different price.
> When the user finds the desired T-Shirt (model, color, etc), the product.tpl
> must show different sizes and prices in order to be selected by the user.
> How can I do that ?

You could do this in your admin interface (Products | Modify
products | choose your product id | select T-shirt | Modify ).
And near the middle of the page there is "Products options form".

For example:
Admin page:
http://demo.x-cart.com/demo/provider/product_modify.php?productid=16131

Customer's page:
http://demo.x-cart.com/demo/customer/product.php?productid=16131&cat=247&page=1
    
 -- zhuravlev alexander

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



Re: [PHP] preg question

2003-11-13 Thread zhuravlev alexander
On Thu, Nov 13, 2003 at 03:17:14PM -0500, Jake McHenry wrote:
> What else would I need to check for? I'm tired.. Running on 2 pots of
> coffee.. All I can think of is the @ and at least one . After the @,
> then at least 2 characters after the last .
> 
> I haven't had much experience with regular expresssions, all of the
> stuff I've done has been for my intranet, and I didn't really need to
> validate.. Now I'm on a project where it's public

http://www.zend.com/codex.php?id=861&single=1
http://www.zend.com/codex.php?id=88&single=1

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



Re: [PHP] X-Cart

2003-11-13 Thread zhuravlev alexander
On Thu, Nov 13, 2003 at 05:28:49PM -0300, Ing. Gustavo Edelstein wrote:
> Thanks Alexander, I've already saw this demo, but what happens with the
> stock amount and the price for that size? How do I rest the amount bought
> from the right size and show the right price for that size ? Remember that i
> need to have different stock amounts and prices.

looking at
http://demo.x-cart.com/demo/provider/global_prodopts.php
Cover Choose cover   10 Soft
Hard=+5
 
I came up with idea that you could write your own options
M=+5
XL=+7
in http://demo.x-cart.com/demo/provider/product_modify.php?productid=16131

(+5 I guess mean "additional 5 dollars" ...)

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



Re: [PHP] X-Cart

2003-11-13 Thread zhuravlev alexander
On Thu, Nov 13, 2003 at 06:12:28PM -0300, Ing. Gustavo Edelstein wrote:
> Ok, but what about the different stock amounts for every size ?

M=+5 mean product cost + 5 dollars for middle sized t-shirt.
just try ... 

 -- zhuravlev alexander

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



Re: [PHP] X-Cart

2003-11-13 Thread zhuravlev alexander
On Thu, Nov 13, 2003 at 06:31:39PM -0300, Ing. Gustavo Edelstein wrote:
> Yes, I've tried it and it's correct, but what about stock amounts ??

To my mind you should make t-shirt of each color as individual
product with corresponding stock amount.

     -- zhuravlev alexander

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



Re: [PHP] Alternet row colors

2003-11-15 Thread zhuravlev alexander
On Sat, Nov 15, 2003 at 06:09:18PM +0200, Boaz Yahav wrote:
> 
> function alternate_rows(
> // color_1 and color_2 have default values, but can be over-ridden.
> $data,
> $color_1 = '#99',
> $color_2 = 'black'
> )
> {
> // Declare $color as static so it retains its value when program // execution leaves 
> the local function's scope.
> static $color;
> 
> // Set the color to that's not currently set.
> if ( $color == $color_1 )
> {
> $color = $color_2;
> }
> else
> {
> $color = $color_1;
> }
> 
> echo '' . $data . ''; }
> 
> I have tried a few was of implamenting this into my current php code but i have had 
> no luck :(
> 
> 
> Could some one help me with this please :)
> If you check the website and click "top ten" 
> http://thor.ancilenetworks.co.uk/~pferrie/vinrev/index2.htm
> 
> 
> The code for return the top ten result is :
> $result = mysql_query("SELECT * FROM albums where id <15");
> 
> $Count = @mysql_num_rows($result);
> 
>  echo "\n";
> echo "IDARTIST bgcolor='#66'>TITLELABEL bgcolor='#66'>PRICE\n";
> 
> for ($count = 0; $count < $Count; $count++) {
> // Extract post details from database
> $myrow = mysql_fetch_array($result);
> $id = $myrow ['id'];
>$artist = $myrow ['artist'];
>  $title = $myrow ['title'];
>  $label = $myrow ['label'];
>  $price = $myrow ['price'];
> 

replace 

> printf(" bgcolor='#00'>$id$artist$title$label
> ?$price\n");

with 
echo ''.$id.''.$artist.''.$title.''.$label.''.$price."\n";

> }
>  echo "\n";
> 
> ?>
> 

 -- zhuravlev alexander
   u l s t u  n o c
 ([EMAIL PROTECTED])

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



Re: [PHP] Include an encoder into PHP distribution?

2003-11-15 Thread zhuravlev alexander
On Sat, Nov 15, 2003 at 11:58:18AM -0600, Eugene Lee wrote:
> On Sat, Nov 15, 2003 at 07:52:28PM +0200, John Smith wrote:
> : 
> : I have no connection to Turck MMcache in any way than just a user who needs
> : it. But distributing software encoded with it is difficult while it is not
> : so easily available (have to be separately downloaded and installed).
> 
> I'm still having problems getting Turck MMcache to work on FreeBSD.
> It looks like the configure script is Linux-centric.  That's a bit of a
> minus when it comes to distributing software across multiple platforms.

I've successfully installed turck-mmcache-2.4.6 from FreeBSD
Ports collection.

cd /usr/ports/www/turck-mmcache/
make install

     -- zhuravlev alexander
   u l s t u  n o c
 ([EMAIL PROTECTED])

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



[PHP] fgetcsv

2003-11-16 Thread zhuravlev alexander
Hello.

I wonder if PHP has fgetcsv() function why doesn't
PHP has fputcsv ?

     -- zhuravlev alexander
   u l s t u  n o c
 ([EMAIL PROTECTED])

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



Re: [PHP] getting an variable value from an array entry

2003-11-30 Thread zhuravlev alexander
On Sun, Nov 30, 2003 at 01:04:08PM -0800, Ian Truelsen wrote:
> On Sun, 30 Nov 2003 21:44:50 +0100
> "Bronislav Klucka" <[EMAIL PROTECTED]> wrote:
> 
> > The temperature is $$temp
> > 
> Unfortunately, that is not working for me. I have tried changing it in
> the text file, but that just outputs $$temp instead of the value of
> $temp. What I have is the array words, for which the relevant entry is
> words[3] being equal to "$temp". What I need to be able to do is to
> print $words[3]; in such a way that it outputs the value of $temp and
> not the value of $words[3]. 
> 
> I also tried print $$words[3] but that outputs nothing. I tried print
> $($words[3]); but that gives a parse error. And print ${$words[3]}
> prints out nothing.

Use eval. http://www.php.net/eval

% cat temp.txt
Temperature $temp degree.
% cat temp.php
";
eval("\$result = \"".addslashes($code)."\";");
echo $result;
?>

 -- zhuravlev alexander
   u l s t u  n o c
 ([EMAIL PROTECTED])

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



Re: [PHP] Local PHP installation conflict

2003-12-06 Thread zhuravlev alexander
On Sat, Dec 06, 2003 at 02:07:53PM -, Shaun wrote:
> Hi,

Hi!
> 
> I have been running my site successfully on a remote server for sometime
> now. However I have just installed PHP, MySQL and Apache on my local Windows
> XP Pro machine and when I try to log on to my site I get the following
> errors:
> 
> Warning: session_start(): open(/tmp\sess_3bfb39a88b7b180b859aa17f1661031b,
> O_RDWR) failed: No such file or directory (2) in c:\program files\apache
> group\apache\htdocs\mysite\authenticate_user.php on line 13

> Is this because I am running different versions of PHP?

Create directory tmp on disk C: (c:\tmp).

         -- zhuravlev alexander
   u l s t u  n o c
 ([EMAIL PROTECTED])

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



Re: [PHP] query_data

2003-12-06 Thread zhuravlev alexander
On Sat, Dec 06, 2003 at 09:34:24AM -0500, Randy  Johnson wrote:
> I have a query
> 
> $query="select a,b,c,d,e from table where id='z'";
> $result=mysql_query();
> 
> $query_data=mysql_fetch_array($result);
> 
> I normally would do this:
> 
> $a=$query_data["a"];
> etc..
> 
> is there a way to do this is in a loop so I do not have to do all that
> typing?

use list (http://www.php.net/list)

list ($a, $b, $c, $d, $e) = mysql_fetch_row($result);

 -- zhuravlev alexander
   u l s t u  n o c
 ([EMAIL PROTECTED])

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



Re: [PHP] Apache Installation Query

2003-12-06 Thread zhuravlev alexander
On Sat, Dec 06, 2003 at 03:56:49PM -, Shaun wrote:
> Hi,
> 
> I have just installed Apache on my local machine. However, when browsing a
> directory I get the listing of it's contents rather than it defaulting to
> the index.php file, is there a way to make this happen?

DirectoryIndex index.php index.html
in your httpd.conf

     -- zhuravlev alexander
   u l s t u  n o c
 ([EMAIL PROTECTED])

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