[PHP] Table trouble

2003-07-07 Thread phpu
Hello
I need help.
I'm querying a database then printing the results in a table. I want the result to be 
in a table with 2 columns per row.
something like that
 

----  --
--  row 1  -- row 2 --
----  --

----  --
--  row 3  -- row 4 --
----  --

----  --
--  row 5   -- row 6 --
----  --

 and so on.

How can I do that?
Please help me asap




Re: [PHP] Table trouble

2003-07-07 Thread phpu
10x but i am new to php and i do not know how to dump all of the results
into an array can you help me with this one please?

- Original Message -
From: "Kevin Stone" <[EMAIL PROTECTED]>
To: "phpu" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, July 08, 2003 1:19 AM
Subject: Re: [PHP] Table trouble


> I'd just dump all of the results into an array and do something like this:
>
> echo "\n";
> for($i=0; $i {
> echo "\t\n";
> for($j=0; $j<2; $j++)
> {
> echo "\t\t".$array[$i]."\n";
> $i++;
> }
> echo "\t\n";
> }
> echo "\n";
>
> On odd numbered arrays you'll end up with an empty cell.  Most browsers
will
> handel the empty cell by simply not displaying it.  Others might show the
> box.  It's a minor cosmetic thing but if you want it to look consistent
then
> test for that situation and add a non-breaking space to the final cell.
>
> HTH,
> Kevin
>
> - Original Message -
> From: "phpu" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, July 07, 2003 4:03 PM
> Subject: [PHP] Table trouble
>
>
> Hello
> I need help.
> I'm querying a database then printing the results in a table. I want the
> result to be in a table with 2 columns per row.
> something like that
>
> 
> ----  --
> --  row 1  -- row 2 --
> ----  --
> 
> ----  --
> --  row 3  -- row 4 --
> ----  --
> 
> ----  --
> --  row 5   -- row 6 --
> ----  --
> 
>  and so on.
>
> How can I do that?
> Please help me asap
>
>
>
>
>


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



Re: [PHP] Table trouble

2003-07-07 Thread phpu
so far i have:

$sql="select * from cate order by name asc";
$resurs=mysql_query($sql);
while ($row=mysql_fetch_array($resurs))
{

echo  ".$row[1].";
echo  ".$row[2].";
echo  ".$row[3].";

}

how can i put all of this together?
echo "";
- Original Message -
From: "Michael A Smith" <[EMAIL PROTECTED]>
To: "phpu" <[EMAIL PROTECTED]>
Sent: Tuesday, July 08, 2003 1:43 AM
Subject: Re: [PHP] Table trouble


> fetchinto?
> On Mon, 2003-07-07 at 14:42, phpu wrote:
> > 10x but i am new to php and i do not know how to dump all of the results
> > into an array can you help me with this one please?
> >
> > - Original Message -
> > From: "Kevin Stone" <[EMAIL PROTECTED]>
> > To: "phpu" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Tuesday, July 08, 2003 1:19 AM
> > Subject: Re: [PHP] Table trouble
> >
> >
> > > I'd just dump all of the results into an array and do something like
this:
> > >
> > > echo "\n";
> > > for($i=0; $i > > {
> > > echo "\t\n";
> > > for($j=0; $j<2; $j++)
> > > {
> > > echo "\t\t".$array[$i]."\n";
> > > $i++;
> > > }
> > > echo "\t\n";
> > > }
> > > echo "\n";
> > >
> > > On odd numbered arrays you'll end up with an empty cell.  Most
browsers
> > will
> > > handel the empty cell by simply not displaying it.  Others might show
the
> > > box.  It's a minor cosmetic thing but if you want it to look
consistent
> > then
> > > test for that situation and add a non-breaking space to the final
cell.
> > >
> > > HTH,
> > > Kevin
> > >
> > > - Original Message -
> > > From: "phpu" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Monday, July 07, 2003 4:03 PM
> > > Subject: [PHP] Table trouble
> > >
> > >
> > > Hello
> > > I need help.
> > > I'm querying a database then printing the results in a table. I want
the
> > > result to be in a table with 2 columns per row.
> > > something like that
> > >
> > > 
> > > ----  --
> > > --  row 1  -- row 2 --
> > > ----  --
> > > 
> > > ----  --
> > > --  row 3  -- row 4 --
> > > ----  --
> > > 
> > > ----  --
> > > --  row 5   -- row 6 --
> > > ----  --
> > > 
> > >  and so on.
> > >
> > > How can I do that?
> > > Please help me asap
> > >
> > >
> > >
> > >
> > >
> --
> Michael Smith
> [EMAIL PROTECTED]
>
> "The great thing about democracy is that it gives
> every voter a chance to do something stupid."
>  -Art Spander
>


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



[PHP] Big problem....need help

2003-07-09 Thread phpu
I have a table like this:

-  product_id-mark_name-category_name  -

-1-   aaa   -   catg 1   -
-2-   bbb   -   catg 2   -
-3-   aaa   -   catg 1   -
-4-   ddd   -   catg 1   -
-5-   bbb   -   catg 2   -

and so on

I want to show all the mark_name in a category only once (if they more than once) 

I have this code:

..
$sql = "SELECT * FROM products, category WHERE 
category.name_category=products.name_category and 
category_id=".$_GET['category_id'] ;
$rezultat = mysql_query($sql); 

while ($row=mysql_fetch_array($rezultat))
{
  echo "Name: ".$row["mark_name"]."\n";
  
}

..

When i choose the category catg 1 the result is 
Name: aaa
Name: aaa
Name: ddd

As you can see the name aaa appears 2 times insted 1.
How to make the result look like this:
Name: aaa
Name: ddd



Re: [PHP] Big problem....need help

2003-07-09 Thread phpu
 It isn't work. it gives me an error at this line.

- Original Message -
From: "Nicolas Costes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 09, 2003 4:49 PM
Subject: Re: [PHP] Big problemneed help


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Le Mercredi 9 Juillet 2003 15:13, phpu a écrit :
> I have a table like this:

> ..
> $sql = "SELECT * FROM products, category WHERE
> category.name_category=products.name_category and
> category_id=".$_GET['category_id'] ;

>
> When i choose the category catg 1 the result is
> Name: aaa
> Name: aaa
> Name: ddd
>
> As you can see the name aaa appears 2 times insted 1.
> How to make the result look like this:
> Name: aaa
> Name: ddd

Use "GROUP BY" 

$sql = "SELECT * FROM products, category WHERE
category.name_category=products.name_category and
category_id=".$_GET['category_id'] GROUP BY products.mark_name;


- --
   ,,
  (°>   Nicolas Costes
  /|\   IUT de La Roche / Yon
 ( ^ )  Clé publique: http://www.keyserver.net/
  ^ ^   http://www.gnu.org/philosophy/can-you-trust.fr.html


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/DB2GNc2aXy7LuOgRAmE6AKCIeGpWg78san/72M7vbhwJXQKXbQCfVxAJ
OgayWbAh0cOXc5OCdVy2uWs=
=vH6U
-END PGP SIGNATURE-


--
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] Big problem....need help

2003-07-09 Thread phpu
10x a lot. it worked.
Now I have another problem. How to find the number of the records in the table.
this is the way i want (in this case}

Name: aaa   2 times
Name  ddd   1 times

Please help with this one




- Original Message - 
  From: Haseeb 
  To: [EMAIL PROTECTED] ; [EMAIL PROTECTED] 
  Cc: [EMAIL PROTECTED] 
  Sent: Thursday, July 10, 2003 8:18 AM
  Subject: Re: [PHP] Big problemneed help


 try like this

$sql = "SELECT * FROM products, category WHERE 
category.name_category=products.name_category and category_id=".$_GET['category_id']." 
GROUP BY products.mark_name";
  




---Original Message---

From: phpu
Date: Wednesday, July 09, 2003 09:51:08 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Big problemneed help

  It isn't work. it gives me an error at this line.

- Original Message -
From: "Nicolas Costes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 09, 2003 4:49 PM
Subject: Re: [PHP] Big problemneed help


-BEGIN PGP SIGNED MESSAGE-
    Hash: SHA1

Le Mercredi 9 Juillet 2003 15:13, phpu a écrit :
> I have a table like this:

> ..
> $sql = "SELECT * FROM products, category WHERE
> category.name_category=products.name_category and
> category_id=".$_GET['category_id'] ;

>
> When i choose the category catg 1 the result is
> Name: aaa
> Name: aaa
> Name: ddd
>
> As you can see the name aaa appears 2 times insted 1.
> How to make the result look like this:
> Name: aaa
> Name: ddd

Use "GROUP BY" 

$sql = "SELECT * FROM products, category WHERE
category.name_category=products.name_category and
category_id=".$_GET['category_id'] GROUP BY products.mark_name;


- --
,,
   (°> Nicolas Costes
   /|\ IUT de La Roche / Yon
  ( ^ ) Clé publique: http://www.keyserver.net/
   ^ ^ http://www.gnu.org/philosophy/can-you-trust.fr.html


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/DB2GNc2aXy7LuOgRAmE6AKCIeGpWg78san/72M7vbhwJXQKXbQCfVxAJ
OgayWbAh0cOXc5OCdVy2uWs=
=vH6U
-END PGP SIGNATURE-


--
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
   
   
   
  
IncrediMail - Email has finally evolved - Click Here


[PHP] What is wrong??????

2003-07-14 Thread phpu
I have this script to login to site:


..
  if ($_POST['email'] == "" || $_POST['password'] == "")
{
print 'Email or password cannot be blank !Back';
exit;
}
include ("connect_mysql.php");
$crpass=md5($_POST['password']);
$sql = "SELECT * FROM users WHERE email='".$_POST['email']."' AND 
password='".$crpass."'";
$result= mysql_query($sql);
if(mysql_num_rows($result) != 1)
{
   print 'Name or password do not match!Back';
exit;
 }
 mysql_close($connect);
 session_start();
 $_SESSION['email']=$_POST['email'];
 $_SESSION['password']=$crpass;
 $_SESSION['key_login']= session_id();


Every time i run this script i got this error:( my apache server is very well 
cofigured)
Warning: Cannot send session cookie - headers already sent by (output started at 
c:\apache\htdocs\proiect_gsm\login.php:11) in c:\apache\htdocs\proiect_gsm\login.php 
on line 81






[PHP] How can I add records to database every 60 minutes???

2003-07-29 Thread phpu
Hello
I'm making an online game in php and mysql. Can someone tell me how can I add records 
to database every 60 minutes (even when i'm not online)


[PHP] previous and next link

2003-09-05 Thread phpu
I have this code and I wanna display only 10 records on page. For the rest of them I 
wanna use a "next" link(or a previous link).
Please tell me hoe can I do that.
 

$sql = "SELECT * FROM categorie" ;
$rezultat = mysql_query($sql); 
$num_rows = mysql_num_rows($rezultat);

while ($row=mysql_fetch_array($rezultat)) {


 print ' '.$row['nume_categorie'].'';
  
}

 


[PHP] previous and next link

2003-09-05 Thread phpu
I've tried but i don't know how to put it in my script. And also i don't know  how to 
display it in page. Here is my script and I hope you could help me with this one.
thanks


$sql = "SELECT * FROM categorie" ;
$rezultat = mysql_query($sql); 
$num_rows = mysql_num_rows($rezultat);

while ($row=mysql_fetch_array($rezultat)) {


 print ' '.$row['nume_categorie'].'';
  
}



[PHP] game in php

2003-09-07 Thread phpu
Hello,
I wanna create an online game in php and mysql and I have a problem. I have this 
database with this fields; id and number_attacks. And every 10 minutes number_attack 
to be increased by 1. How can i do that?

Thanks



[PHP] divide

2003-09-09 Thread phpu
Hello,
I'm new in php and i've got allready a problem.
I wanna divide 2 numbers and the result to be an integer separated by comma. For 
example:
$number1=1000;
$number2=17;
$result=$number1 / $number2;
In this case the result is 588235.29411764
And I wanna the result to be like this 588,235

thanks


Re: [PHP] divide

2003-09-09 Thread phpu
yes but if the result is a number like this 34056983 i wanna display this number like 
this 34,056,983
Please help me with this one
  - Original Message - 
  From: Nathan Taylor 
  To: phpu 
  Sent: Wednesday, September 10, 2003 2:49 AM
  Subject: Re: [PHP] divide


  Check out number_format();

  www.php.net/number_format
- Original Message - 
From: phpu 
To: [EMAIL PROTECTED] 
Sent: Tuesday, September 09, 2003 7:50 PM
Subject: [PHP] divide


Hello,
I'm new in php and i've got allready a problem.
I wanna divide 2 numbers and the result to be an integer separated by comma. For 
example:
$number1=1000;
$number2=17;
$result=$number1 / $number2;
In this case the result is 588235.29411764
And I wanna the result to be like this 588,235

thanks



Re: [PHP] divide

2003-09-09 Thread phpu
Sorry
I've got it.
Thanks a lot
  - Original Message - 
  From: Nathan Taylor 
  To: phpu 
  Sent: Wednesday, September 10, 2003 2:59 AM
  Subject: Re: [PHP] divide


  Check out number_format() like I said.
- Original Message - 
From: phpu 
To: Nathan Taylor 
Cc: [EMAIL PROTECTED] 
Sent: Tuesday, September 09, 2003 8:04 PM
Subject: Re: [PHP] divide


yes but if the result is a number like this 34056983 i wanna display this number 
like this 34,056,983
Please help me with this one
  - Original Message - 
  From: Nathan Taylor 
  To: phpu 
  Sent: Wednesday, September 10, 2003 2:49 AM
  Subject: Re: [PHP] divide


  Check out number_format();

  www.php.net/number_format
- Original Message - 
From: phpu 
To: [EMAIL PROTECTED] 
Sent: Tuesday, September 09, 2003 7:50 PM
Subject: [PHP] divide


Hello,
I'm new in php and i've got allready a problem.
I wanna divide 2 numbers and the result to be an integer separated by comma. 
For example:
$number1=1000;
$number2=17;
$result=$number1 / $number2;
In this case the result is 588235.29411764
And I wanna the result to be like this 588,235

thanks




[PHP] sessions

2003-09-17 Thread phpu
I have a little problem whit this script

...

$sql="INSERT INTO tranzactii (name, email) values 
('".$_POST['name']."','".$_POST['email']."')";
$result=mysql_query($sql);
$id_transaction=mysql_insert_id();

for ($i=0; $i < count($_SESSION['id_product']); $i++)
{
if ($_SESSION['nr'][$i] > 0)
{
$sql1="INSERT INTO sales values 
('".$id_tranzactie."','".$_SESSION['id_product'][$i]."','".$_SESSION['nr'][$i]."')";
mysql_query($sql1);
}
}
---
The probem is that if i have more products only first id_product is insert into table 
sales. The rest id_product are inserted with 0.

How can I get over it?


[PHP] Subcategories in php

2003-09-20 Thread phpu
Hi, 

I have been trying to do this for weeks but i just cant figure this out. I have 
categories that have subcategories and i want to insert them into database. My table 
looks like this: cat_id, parent_id and cat_name.
Let's say i wanna insert a subcategory that is associated with its parent category.
For example

ParentCat 1 
ParentCat 1 > ItsSubCat 1 
ParentCat 1 > ItsSubCat 2
ParentCat 1 > ItsSubCat 3
ParentCat 1 > ItsSubCat 4
ParentCat 2 
ParentCat 2 > ItsSubCat 1 

and so on ... 

I don't know how to create the script that inserts any subcategory(in this case let's 
say ItsSubCat 3) in its parent category.
Please, can someone help me

thanks


[PHP] search result

2003-09-21 Thread phpu
Hi,
I have this code that search an specify word in the database. This search is working. 
The only problem that I have is that I wanna show only 7 rows per page. When I wanna 
jump to the next page with results it shows all records in the database(7 rows per 
page).
How can i do to show only the records that match with the search word?



$rows_per_page = 7;
$sql = "SELECT * FROM products";
$rezultat = mysql_query($sql);
$total_records = mysql_num_rows($rezultat);
$pages = ceil($total_records / $rows_per_page);
mysql_free_result($rezultat);
mysql_close($conectare);


if (!isset($pagina))
  $pagina = 0;
$start = $pagina * $rows_per_page;
$sql="SELECT id_products, name_product FROM products WHERE name_product LIKE 
'%".$word."%' LIMIT $start, $rows_per_page ";

$result=mysql_query($sql);
if (mysql_num_rows($result) == 0)
{
print 'Product not found';
}
while ($row=mysql_fetch_array($result))
{
some code here
}



if ($pagina > 0) {
  $url = "product.php?pagina=" . ($pagina - 1);
  echo "Previous\n";
}

for ($i = 1; $i < $pages; $i++) {
  $url = "product.php?pagina=" . $i;
  echo "   $i   ";
}
if ($pagina < ($pages-1)) {
  $url = "product.php?pagina=" . ($pagina + 1);
  echo "Next\n";
}



Re: [PHP] search result

2003-09-21 Thread phpu
Sorry but i'm new to php and i don't know how to do that. Can you help me, please?
  - Original Message - 
  From: [EMAIL PROTECTED] 
  To: [EMAIL PROTECTED] 
  Sent: Monday, September 22, 2003 1:00 AM
  Subject: Re: [PHP] search result


  whwen you jump to the next page, make sure there's a parameter that contains the 
original search term in each search result page you're loadingeither by including 
it in a URL (for a link) or hidden field for a "Next" button. 


Re: [PHP] search result

2003-09-21 Thread phpu
I have tried but didn't work. I think i'm going crazy. I don't know how to
do it...



$rows_per_page = 7;
$sql = "SELECT * FROM products";
$rezultat = mysql_query($sql);
$total_records = mysql_num_rows($rezultat);
$pages = ceil($total_records / $rows_per_page);
mysql_free_result($rezultat);
mysql_close($conectare);


if (!isset($pagina))
  $pagina = 0;
$start = $pagina * $rows_per_page;
$sql="SELECT id_products, name_product FROM products WHERE name_product LIKE
'%".$word."%' LIMIT $start, $rows_per_page ";

$result=mysql_query($sql);
if (mysql_num_rows($result) == 0)
{
print 'Product not found';
}
while ($row=mysql_fetch_array($result))
{
some code here
}



if ($pagina > 0) {
  $url = "product.php?pagina=" . ($pagina - 1);
  echo "Previous\n";
}

for ($i = 1; $i < $pages; $i++) {
  $url = "product.php?pagina=" . $i;
  echo "   $i   ";
}
if ($pagina < ($pages-1)) {
  $url = "product.php?pagina=" . ($pagina + 1);
  echo "Next\n";
}

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



Re: [PHP] search result

2003-09-21 Thread phpu
Finally I got it.
Thanks a lot


- Original Message -
From: "phpu" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 22, 2003 1:36 AM
Subject: Re: [PHP] search result


> I have tried but didn't work. I think i'm going crazy. I don't know how to
> do it...
>

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



[PHP] checked / unchecked

2003-09-28 Thread phpu
Hi
I have this form:

 
Picture
';
}
?>




All i wanna do is to modify picture only if the modify_picture checkbox is checked. 
How can i do that?

thanks


Re: [PHP] checked / unchecked

2003-09-28 Thread phpu
It's working..
Thanks a lot

- Original Message -
From: "Jason Sheets" <[EMAIL PROTECTED]>
To: "phpu" <[EMAIL PROTECTED]>
Sent: Sunday, September 28, 2003 6:55 PM
Subject: Re: [PHP] checked / unchecked


> With a conditional, note that if you have more than one picture your
> current setup is not going to work.
>
> if ($_REQUEST['modify_picture'] == 'check') {
> // do update code here
> }
>
> If you will ever have more than one picture at a time you should
> probably use an array instead of just one variable for modify_picture.
>
> Jason
>
> phpu wrote:
>
> >Hi
> >I have this form:
> >
> > 
> > >$sql = "SELECT * FROM table Where id_cat=".$_POST['id_cat'];
> >$result = mysql_query($sql);
> >while ($row=mysql_fetch_array($result))
> >{
> >
> >print 'CategoryPicture
> >';
> >}
> >?>
> >
> >
> >
> >
> >All i wanna do is to modify picture only if the modify_picture checkbox
is checked. How can i do that?
> >
> >thanks
> >
> >
> >
>
>

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



[PHP] Text from file into database

2004-08-22 Thread Phpu
Hi,

I have a file, test.txt. The containig of this file is:

line 1
line 2
line 3
--
and so on

I want to create a script that will read each line of the file and insert it to 
database.
I am new to php and maybe you could help me

Thanks


[PHP] Instant message

2004-08-22 Thread Phpu
Hi,
I have a site where people meet and talk. I want to be able to send instant messages 
to those who are online, but i do not know how to do it.
I need java? Can i do it in php?
Please give me a link or something to grab
Thanks

[PHP] Where clause

2004-08-24 Thread Phpu
Hi,
I have a table with 2 fields: id_from and id_to.
I want to interogate the database and to display the results if the id_to is equal to 
some current id OR id_from id_from is equla to saame current id.

I use this but doesn't work

$sql = "SELECT id_from, id_to  FROM ids WHERE id_from ='$current_id'  OR  
id_to='$current_id' ";
$result = mysql_query($sql); 

How can i do?

Thanks

[PHP] Instant private messenger

2004-09-06 Thread Phpu
Hi,
I wanna create an instant private messenger for users who are online on my site.
Foe example: I have a list with online users. I select the user which i wanna send an 
message. A popup window will apear, i write the message and click send. To that user 
it will appear a popup window with my message.

How can i do that? I've googled but all i found was expensive. 
I need a tutorial or something. Could someone help me please !!! 

Thank you

[PHP] Newbie array problem

2004-09-23 Thread Phpu
If i have an array
$array = array(1, 2, 3, 4, 5, 6, 7)
How can i display the array element sepparated by (;) like this
$display = 1;2;3;4;5;6;7


Thanks

[PHP] Newbie array problem

2004-09-23 Thread Phpu
If i have an array
$array = array(1, 2, 3, 4, 5, 6, 7)
How can i display the array element sepparated by (;) like this
$display = 1;2;3;4;5;6;7


Thanks

[PHP] What's going on?

2004-09-26 Thread Phpu
For the last 2 days i haven't received emails. What's going on with this mailing list?

[PHP] Instant messenger

2004-09-26 Thread Phpu
Hi,
I wanna create an instant private messenger. This kind of  IM i have seen on dating 
sites.
I've googled for such IM but i found nothing. 
Can someone please help me with this?

Thank you

[PHP] World time convertor

2004-09-30 Thread Phpu
Howdy

Is there a time convertor written in php?
I mean to convert a specific hour/date in all world countries.

[PHP] A good search tutorial

2004-04-21 Thread Phpu
Hi there
I have a site driven by a database and I need a search engine...when someone enter a 
word the script to search the entire database for that word and return the results.
Could someone give me the link to that kind of tutorial?
Please email me asap 


[PHP] Problems with patters

2004-04-21 Thread Phpu
Hi,

i have a script that searches a database after a specific word.

this function check the entered word
 
function valid_word($word) {

  if(ereg("^[a-zA-Z0-9_]{3,15}$", $word)) {

   return true;

  } else {

   return false;

  }

 }

If i search for a word is ok but when i searches for a phrase it returns no result.

What do i have to modify the function?

Thank you for your reply


[PHP] Problems with patterns

2004-04-21 Thread Phpu
Hi,

i have a script that searches a database after a specific word.

this function check the entered word
 
function valid_word($word) {

  if(ereg("^[a-zA-Z0-9_]{3,15}$", $word)) {

   return true;

  } else {

   return false;

  }

 }

If i search for a word is ok but when i searches for a phrase it returns no result.

What do i have to modify the function?

Thank you for your reply



Re: [PHP] Problems with patterns

2004-04-21 Thread Phpu
where in the ereg("^[a-zA-Z0-9_]{3,15}$", $cuvant) i should place \s+ ?

- Original Message - 
From: "Matt Matijevich" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, April 22, 2004 3:34 AM
Subject: Re: [PHP] Problems with patterns


> you need to account fir white space if you want phrases
> 
> \s+
> 
> 
> I would switch to preg_match() instead of ereg()
> 
> http://www.php.net/manual/en/function.preg-match.php
> 

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



[PHP] Vulnerabilities in vBulletin ????

2004-04-23 Thread Phpu
I have vBulletin  installed on my site. A few hours ago a friend sent me a link to 
securityfocus.com.
There, it is said that if i have vBulletin installed i could be vulnerable.

Here the script shown on the site

[form action="http://[victim]/register.php?do=register"; method="post" 
style="display:none"] 
[input type="hidden" name="s" value="" /] 
[input type="hidden" name="regtype" value="1" /] 
[input type="text" class="bginput" name="field1" value="" size="25" 
maxlength="250" /] 
[input type="hidden" name="url" value="index.php" /] 
[input type="hidden" name="do" value="addmember" /] 
[/form] 
[script] 
//Code that will be executed 
var xss = "\"][script]alert(document"+".cookie)[\/script]"; 
document.forms[0].field1.value=xss; 
document.forms[0].submit(); 
[/script] 

*Replace ([],<>)


The only problem that i have is that i do not know what the script does and how it 
works. 
PS: How can i get rid of this? 


[PHP] Installing GD library

2004-05-07 Thread Phpu
Hi,
I've downloaded the GD library. Can someone tell me how do i install it on a windows 
system?
I found in internet a few articles but  i don't quite understand.
Thanks 


[PHP] Gd library not found

2004-05-08 Thread Phpu
Hi,
Where can i get the gd library for windows. I've googled but i can't find it.
Thanks


[PHP] It opens the file instead downloading

2004-05-05 Thread Phpu
Hi,
I have this script:

$filename=plenar.mid;
$file_to_download=files/plenar123.mid;  
  
$user_agent = strtolower ($_SERVER["HTTP_USER_AGENT"]);
header( "Content-type: application/force-download" );
if ((is_integer (strpos($user_agent, "msie"))) && (is_integer (strpos($user_agent, 
"win" {
  header( "Content-Disposition: filename=".$filename);
} else {
  header( "Content-Disposition: attachment; filename=".$filename);
}
header( "Content-Description: File Transfert");
@readfile($file_to_download);

Instead downloading the file the scripy oppens it.
I wanna save the file to disk not open it. How should i do ?
Thanks


[PHP] It opens the file instead downloading

2004-05-05 Thread Phpu
Hi,
I have this script taken form php.net

$filename=plenar.mid;
$file_to_download=files/plenar123.mid;  
  
$user_agent = strtolower ($_SERVER["HTTP_USER_AGENT"]);
header( "Content-type: application/force-download" );
if ((is_integer (strpos($user_agent, "msie"))) && (is_integer (strpos($user_agent, 
"win" {
  header( "Content-Disposition: filename=".$filename);
} else {
  header( "Content-Disposition: attachment; filename=".$filename);
}
header( "Content-Description: File Transfert");
@readfile($file_to_download);

Instead downloading the file the script opens it.
I wanna save the file to disk not open it. How should i do it?
Thanks


[PHP] XML problem

2004-05-18 Thread Phpu
Hi,
I know that this is not an "xml list" but maybe you could help me.
I'm looking for a good tutorial in xml or a list with most of the xml tags. I've 
googled for it but i can't find anything.
Could someone send me a link to that kind of tutorial?

Thanks for your reply !!!
Stefan


[PHP] Remember username and password

2004-06-01 Thread Phpu
Hi,

How can i make a registration form that will remember my username and password every 
time i login from the same computer?
I think i should set a cookie but i don't know how.

Thanks


[PHP] SELECT

2004-06-02 Thread Phpu
Hi,

Is there any way  to select all entries in the database except one entry or tho 
entries?

Thanks


[PHP] Sending email with php

2004-06-16 Thread Phpu
Hi,
How can i send email in php usig the smtp server? I'm looking for a tutorial or a good 
script.

Thanks



[PHP] Problems with arrays

2004-06-17 Thread Phpu
Hi,

I have this array:

$array = array(element1, element2, element3, element4)

I want to list all elements of this array, so i used:

  foreach ($array as $index => $element) {
$InputString = "$element";
 echo "$InputString";
   }

but this code lists the elements like this: element1 element2 element3 element4

How can i list my elements like this: 
element1
element2
element3
element4


Thanks


Re: [PHP] Problems with arrays

2004-06-17 Thread Phpu
 I've tried this but it is not working ...

Thanks anyway
- Original Message -
From: "Oliver Hankeln" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 17, 2004 4:04 PM
Subject: Re: [PHP] Problems with arrays


> Phpu wrote:
>
> > Hi,
> >
> > I have this array:
> >
> > $array = array(element1, element2, element3, element4)
> >
> > I want to list all elements of this array, so i used:
> >
> >   foreach ($array as $index => $element) {
> > $InputString = "$element";
> >  echo "$InputString";
> >}
> >
> > but this code lists the elements like this: element1 element2 element3
element4
> >
> > How can i list my elements like this:
> > element1
> > element2
> > element3
> > element4
>
> That's not a problem with arrays. This is one with outputting. You need
> to add a newline to your echo Statement. Either echo "$InputString\n";
> or echo "$InputString"; depending on wether you use html or plain
text.
>
> Oliver
>
> --
> 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] Problems with arrays

2004-06-17 Thread Phpu
I want the element of the array to be displayed in a  field



- Original Message -
From: "Steve Douville" <[EMAIL PROTECTED]>
To: "Phpu" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, June 17, 2004 4:12 PM
Subject: Re: [PHP] Problems with arrays


> What are you outputting? html, text, email body...??
> - Original Message -
> From: "Phpu" <[EMAIL PROTECTED]>
> To: "Oliver Hankeln" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Thursday, June 17, 2004 9:06 AM
> Subject: Re: [PHP] Problems with arrays
>
>
> > I've tried this but it is not working ...
> >
> > Thanks anyway
> > - Original Message -
> > From: "Oliver Hankeln" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, June 17, 2004 4:04 PM
> > Subject: Re: [PHP] Problems with arrays
> >
> >
> > > Phpu wrote:
> > >
> > > > Hi,
> > > >
> > > > I have this array:
> > > >
> > > > $array = array(element1, element2, element3, element4)
> > > >
> > > > I want to list all elements of this array, so i used:
> > > >
> > > >   foreach ($array as $index => $element) {
> > > > $InputString = "$element";
> > > >  echo "$InputString";
> > > >}
> > > >
> > > > but this code lists the elements like this: element1 element2
element3
> > element4
> > > >
> > > > How can i list my elements like this:
> > > > element1
> > > > element2
> > > > element3
> > > > element4
> > >
> > > That's not a problem with arrays. This is one with outputting. You
need
> > > to add a newline to your echo Statement. Either echo "$InputString\n";
> > > or echo "$InputString"; depending on wether you use html or plain
> > text.
> > >
> > > Oliver
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> >
> >
>

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



Re: [PHP] Problems with arrays

2004-06-17 Thread Phpu
Here is the code:


   
   $element) {
$InputString = "$element";
 echo "$InputString";
   }
 ?>
  


- Original Message -
From: "Steve Douville" <[EMAIL PROTECTED]>
To: "Phpu" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, June 17, 2004 4:23 PM
Subject: Re: [PHP] Problems with arrays


> Can you give us the code from  to ?
> - Original Message -
> From: "Phpu" <[EMAIL PROTECTED]>
> To: "Steve Douville" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Thursday, June 17, 2004 9:14 AM
> Subject: Re: [PHP] Problems with arrays
>
>
> > I want the element of the array to be displayed in a  field
> >
> >
> >
> > - Original Message -
> > From: "Steve Douville" <[EMAIL PROTECTED]>
> > To: "Phpu" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Thursday, June 17, 2004 4:12 PM
> > Subject: Re: [PHP] Problems with arrays
> >
> >
> > > What are you outputting? html, text, email body...??
> > > - Original Message -
> > > From: "Phpu" <[EMAIL PROTECTED]>
> > > To: "Oliver Hankeln" <[EMAIL PROTECTED]>
> > > Cc: <[EMAIL PROTECTED]>
> > > Sent: Thursday, June 17, 2004 9:06 AM
> > > Subject: Re: [PHP] Problems with arrays
> > >
> > >
> > > > I've tried this but it is not working ...
> > > >
> > > > Thanks anyway
> > > > - Original Message -
> > > > From: "Oliver Hankeln" <[EMAIL PROTECTED]>
> > > > To: <[EMAIL PROTECTED]>
> > > > Sent: Thursday, June 17, 2004 4:04 PM
> > > > Subject: Re: [PHP] Problems with arrays
> > > >
> > > >
> > > > > Phpu wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > I have this array:
> > > > > >
> > > > > > $array = array(element1, element2, element3, element4)
> > > > > >
> > > > > > I want to list all elements of this array, so i used:
> > > > > >
> > > > > >   foreach ($array as $index => $element) {
> > > > > > $InputString = "$element";
> > > > > >  echo "$InputString";
> > > > > >}
> > > > > >
> > > > > > but this code lists the elements like this: element1 element2
> > element3
> > > > element4
> > > > > >
> > > > > > How can i list my elements like this:
> > > > > > element1
> > > > > > element2
> > > > > > element3
> > > > > > element4
> > > > >
> > > > > That's not a problem with arrays. This is one with outputting. You
> > need
> > > > > to add a newline to your echo Statement. Either echo
"$InputString\n
> ";
> > > > > or echo "$InputString"; depending on wether you use html or
> plain
> > > > text.
> > > > >
> > > > > Oliver
> > > > >
> > > > > --
> > > > > PHP General Mailing List (http://www.php.net/)
> > > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> >
> >
>

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



[PHP] Php files with .html extension?

2004-10-25 Thread Phpu
Hi,

How can i do a php script with a html extensionsuch as 
http://www.blinds-wise.com/shop/p/blind/bid/1/venetian_blinds.html

Thanks


[PHP] Add spaces to a string

2004-10-28 Thread Phpu
How to add a specified number of spaces to a string  

I use this but won't work if  $spaces is less than the length of the $string 

$string = "bla bla bla";
$spaces = 5;
$string = str_pad($string, $spaces, " ");


Thanks in advance for your help

[PHP] Search a word in multiple tables

2004-11-05 Thread Phpu
Hi,
How can i search a specific word in 2 tables
I use this but it is not working

sql = "SELECT a.product_id, a.".select_language('product_name_en', 
'product_name_fr').", b.brand_name FROM products_accessories as a, brands as b 
 WHERE (a.".select_language('product_name_en', 'product_name_fr')." LIKE 
'%".$word."%'  OR b.brand_name LIKE '%".$word."%')";
$result= mysql_query($sql);

Thanks

[PHP] Newbie pattern question

2004-11-05 Thread Phpu
Hi,
I have this function

 function validate_name($name) {

  if(ereg("^[a-zA-Z0-9_]{2,30}$", $name)) {

   return true;

  } else {

   return false;

  }

 }

If i enter a name like John for exemple everything is ok but if i enter John Doe the 
function return false.

Where is the problem?

Thanks


[PHP] Saving thumbnails

2004-11-17 Thread Phpu
Hi,
I found a tutorial that creates thumbnails on the fly. The only problem is that 
i want to save those thumbnails on the server.

Could anyone help me?

Thanks

Re: [PHP] Saving thumbnails [SOLVED]

2004-11-17 Thread Phpu
I resolv the problem. Thanks anyway
- Original Message -
From: "Eakin, W" <[EMAIL PROTECTED]>
To: "Phpu" <[EMAIL PROTECTED]>
Sent: Wednesday, November 17, 2004 3:21 PM
Subject: Re: [PHP] Saving thumbnails


> Phpu wrote:
>
> >Hi,
> >I found a tutorial that creates thumbnails on the fly. The only problem
is that i want to save those thumbnails on the server.
> >
> >Could anyone help me?
> >
> >Thanks
> >
> >
> how does the script work? can you send me a link to the tutorial if it's
> on line? Recently I had to write something myself that might help you.
>

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



[PHP] Images problem

2004-11-17 Thread Phpu
If i have 2 images:

$im1 = imagecreate (100, 100); 
$white = ImageColorAllocate ($im1, 255, 255, 255);


$im2 = imagecreate (50, 50); 
$black = ImageColorAllocate ($im2, 0, 0, 0);


How can i put $im2 over $im1 and result one single image? Is there a function 
to do this?

Thank You

Re: [PHP] Images problem

2004-11-17 Thread Phpu
It's working  Thanks a lot


- Original Message - 
From: "Randy Rinehart" <[EMAIL PROTECTED]>
To: "Phpu" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, November 17, 2004 6:29 PM
Subject: Re: [PHP] Images problem


> I believe you can use imagecopymerged to do this.
> 
> http://us2.php.net/manual/en/function.imagecopymerge.php
> 
> please let me know if that helps.
> 
> Thanks
> 
> -randy rinehart
> 
> - Original Message - 
> From: "Phpu" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, November 17, 2004 10:05 AM
> Subject: [PHP] Images problem
> 
> 
> If i have 2 images:
> 
> $im1 = imagecreate (100, 100);
> $white = ImageColorAllocate ($im1, 255, 255, 255);
> 
> 
> $im2 = imagecreate (50, 50);
> $black = ImageColorAllocate ($im2, 0, 0, 0);
> 
> 
> How can i put $im2 over $im1 and result one single image? Is there a
> function to do this?
> 
> Thank You
> 
> 

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



[PHP] SELECT problem..Need urgent help !!!!

2004-11-29 Thread Phpu
Hi,

I have an array named $ex_array.

I want to search the database and find those ids that are different from the 
values in $ex_array.

I use this but didn't work

$sql = "SELECT product_id FROM products WHERE product_id <> '$ex_array' " ; 


Thanks for any help 

[PHP] Stupid question

2004-12-04 Thread Phpu
Hi,

If i have a php and mysql website...how many connections support mysql at one 
time ?

Thanks

[PHP] Magic quotes

2004-12-06 Thread Phpu
Hi,
If I have an sql interogation, for example:
$sql = "SELECT id, name FROM shop WHERE cat_id = $cat_id ";

For my server doesn't work...only if i put ... cat_id = '$cat_id'

I think i haven't set up apache..
What is the problem?

Thanks 


[suspicious - maybe spam] [PHP] [suspicious - maybe spam] SELECT probrem

2005-01-06 Thread Phpu
Hi,

I have an array, for ex: $products=array(1, 2,  5 , 7)

I want to select all products from the database that has the ids of products.
I use this but doesn't work:

$sql = '';
foreach($products AS $products_id){
if(strlen($sql)){ $sql .= ' OR '; }
$sql .= "product_id = '$products_id'";
}
  
$sql2 = "SELECT product_name FROM accessories WHERE " .$sql;

Please help me 

Thanks


[suspicious - maybe spam] [PHP] [suspicious - maybe spam] Categories and subcategories

2005-01-21 Thread Phpu
Hi,
I need to create multiple categories and subcategories using php and mysql. 
Something like that

- category 1
- subcat 1.1
- subcat 1.2
  - subcat 1.2.1
  - subcat 1.2.2
- category 2


Does anyone know a godd totorial how to create this in pahp and how to make the 
structure of the database?

Thanks in advance for your help