[PHP-DB] php to make form field for each column then update page.

2003-06-08 Thread Steve B.
Hi,
I have used asp2php to convert an asp site and the update page does not iterate the 
form contents.
This part saves me making a giant form by making it dynamically-

$dbrec=getrec($result);


";


...

I've spent the day looking around the net and haven't found it.
Mainly I don't know what to search for - mostly tried 'dynamic forms' in google...
Any help making update page iterate form contents and update db?
I'd like to know a way to do it without an update statement- by opening that record, 
setting the
fields then updating it. Do you know example of this?
Thanks
-Steve


__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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



[PHP-DB] fopen() question and auto update question

2003-06-08 Thread Tony S . Wu
has any of you have any problem with fopen() that it can't open some 
web page?
i am trying to use it to gather information from other web pages, but i 
am having problem with one particular website, macmall.com.
might anyone know what the problem is?
also, if there is no solution to this, i am going to have to abandon 
the idea by using fopen() to gather information.
can anyone suggest an alternative way, which won't cost me too much 
time to get to it?
there will be around 200 data to be updated each time.
thanks a lot.

Tony S. Wu
[EMAIL PROTECTED]
"The world doesn't give us hope - it gives us chance."
http://homepage.mac.com/tonyswu/tonyswu- My web page.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] ?? Login problems ??

2003-06-08 Thread JeRRy
Try again. Post the exact error you're getting (what
you're getting is
most likely just a Warning) and a _FEW_ lines around
where the error is
at. 

The exact error is:

Notice: Undefined variable: Username on line 86

With the given error it mucks up my username/password
form by putting incorrect html values in and around
the form.  So when I try and submit it it goes to a
dead page that does not exist.  (but on the linux
server it works fine.

The source I get when I view source from the borwse
is:

User
Name
Notice:  Undefined variable:  Username on line
86
>Password

and my core source for that error of the page is:

echo "";
echo "User Name";
echo "";
echo "";
echo "Password";
echo "";
echo "";
echo "";
echo "";
echo "";

Maybe my php server side is not right or something,
any suggestions?

Jerry


For the likely problem causing your "error" read the
manual page on
error reporting.

http://us2.php.net/error_reporting

---John W. Holmes...

Amazon Wishlist:
http://www.amazon.com/o/registry/3BEXC84AB3A5E

PHP Architect - A monthly magazine for PHP
Professionals. Get your copy
today. http://www.phparch.com/




http://mobile.yahoo.com.au - Yahoo! Mobile
- Check & compose your email via SMS on your Telstra or Vodafone mobile.

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



Re: [PHP-DB] Using fopen() for internet URL

2003-06-08 Thread Tony S . Wu
Thanks, i think i got the description mixed up :D

Tony S. Wu
[EMAIL PROTECTED]
"The world doesn't give us hope - it gives us chance."
http://homepage.mac.com/tonyswu/tonyswu- My web page.
On Sunday, June 8, 2003, at 04:29 PM, Tony S. Wu wrote:

I have an auto-update script to gather some information from other web 
pages to update information in my database.
And i use fopen() to open the URL.
as far as i know, the return result contains image, which i don't need.
so is there anyway to disable loading image when using fopen() with 
URL?
just want to speed things up a bit :P
thanks.

Tony S. Wu
[EMAIL PROTECTED]
"The world doesn't give us hope - it gives us chance."
http://homepage.mac.com/tonyswu/tonyswu- My web page.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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


Re: [PHP-DB] Removing cart items with hyperlink question

2003-06-08 Thread David Smith
Boa Constructor wrote:

The first line below works but the second one doesn't.  If $quantity were to
equal 0 then I want both of these to do exactly the same thing.
echo "";

echo "Remove Item";
 

Are you using POST or GET on the receiving end of the script? Also, try 
urlencoding the href like this:

echo "Remove Item";

And add this line prior to the echo:

$PHP_SELF = $_SERVER['PHP_SELF'];

In case regiester_globals is off (I hope it is).

--Dave

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


Re: [PHP-DB] Using fopen() for internet URL

2003-06-08 Thread David Smith
Tony S. Wu wrote:

I have an auto-update script to gather some information from other web 
pages to update information in my database.
And i use fopen() to open the URL.
as far as i know, the return result contains image, which i don't need.


If you call fopen()/fread() on a web page that contains an image, you 
will _not_ get the image in your result. You will only get the HTML text 
of the web-page.

For example:
$f = fopen( 'http://www.google.com/', 'r' );
$page = fread( $f, 2048 );
fclose( $f );
// $page will _not_ contain the Google image logo, but rather just the 
text of the HTML page.

--Dave



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


[PHP-DB] Using fopen() for internet URL

2003-06-08 Thread Tony S . Wu
I have an auto-update script to gather some information from other web 
pages to update information in my database.
And i use fopen() to open the URL.
as far as i know, the return result contains image, which i don't need.
so is there anyway to disable loading image when using fopen() with URL?
just want to speed things up a bit :P
thanks.

Tony S. Wu
[EMAIL PROTECTED]
"The world doesn't give us hope - it gives us chance."
http://homepage.mac.com/tonyswu/tonyswu- My web page.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Removing cart items with hyperlink question

2003-06-08 Thread Boa Constructor
Hey all, OK, I've made quite a bit of progress with my shopping cart and I'm
at the stage of removing items from it.  If I change the quantity to "0" and
click the submit button the item is removed.  However it isn't obvious how
to remove items so I want to put a link next to each item that says "Remove
Item".

The first line below works but the second one doesn't.  If $quantity were to
equal 0 then I want both of these to do exactly the same thing.



echo "";

echo "Remove Item";


Any ideas?


Cheers,

G :)


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



Re: [PHP-DB] PHP sort from .... best solution?

2003-06-08 Thread A. Lyse
Hi again!

Is it possibile to only show articles from a sertain month. say I want to
show all articles from June 2003 (2003 01/06 - 2003 31/06)... the variable
here is "publisert"

It should be enough info over to help me :)

Regards,
A. Lyse


"A. Lyse" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi!
>
> Thanks! But I got a problem with the code:
>
> The PHP file as it is with the code pasted into it will i'll past at the
end
> of this post. The problem is I get the error:
>
> Warning: Invalid argument supplied for foreach() in
> /home/amotor/www/list_ingresser_artikler.php on line 43
>
> If I put a // in front of line 32 the script feeds correct, but not
sorted.
> I think there is a very easy solution to this, but I dont know so mutch
PHP
> :( I'm reading though.
>
> Thanx alot for the help I got so far. I've learned alot!
>
> Regards,
> A. Lyse
>
> The PHP file
> 
>
>  //Dette er en mal for å lette implementering av pusyset til de enkelte
> sider.
> //Denne malen viser ingressene til de 50 siste artikler denne siden skal
ha.
> include "../lib/ingress.lib";
>
> $nettstedid=11; //Id til nettstedet. Dersom man ikke husker sin nettstedid
> finnes den i admindelen av pubsyset.
> $sprakid=1; //Språkid. 1=Norsk
> $offset=0; //Offset, dersom man ikke skal vise fra artikkel 0, men f.eks.
> fra artikkel 51.
> $offset3ingr=2; //Offset, dersom man ikke skal vise fra artikkel 0, men
> f.eks. fra artikkel 51.
> $offsetannet=1; //Offset, dersom man ikke skal vise fra artikkel 0, men
> f.eks. fra artikkel 51.
> $antall=50; //Hvor mange artikler skal vises
> $antallmotor=25; //Hvor mange artikler skal vises på motorsport
> $antallmotor3ingresser=3; //Hvor mange artikler skal vises videre på
> motorsport
> $antallmc=1; //Hvor mange artikler skal vises på MC
> $antallmc3ingresser=3; //Hvor mange artikler skal vises videre på MC
> $antallstyling=1; //Hvor mange artikler skal vises på MC
> $antallstyling3ingresser=3; //Hvor mange artikler skal vises videre på MC
> $typeid=0; //Hva slags ingresser skal vises? "0" viser alle typer.
> $i1 = hentIngresser($nettstedid,38,$sprakid,$offset,$antallmotor);
> $i2 = hentIngresser($nettstedid,39,$sprakid,$offset,$antallmotor);
>
>
>function obj_date_compare($a, $b) {
> return strcmp($a->publisertLang, $b->publisertLang);
>   }
>
>
>
>if($ingresser = array_merge($i1 ,$i2))
>
>{
> $ingresser = usort($ingresser, 'obj_date_compare');
>   listIngresser($ingresser);
>   }
>
>
> else
>  echo 'Det oppstod en feil ved henting av ingresser.';
>
>
>
> function listIngresser($ingresser){
>  foreach($ingresser as $i){
>
>   echo '
>   
> href="'.$i->artikkellink.'">  src="/bilder/design/lesmer.gif" width="61" height="19" align="right">
> href="'.$i->artikkellink.'">'.$i->overskrift.' 
>     ('.$i->publisert.')
>
>  
> 
> 
>  width="100" height="85" border="1" align="right">
> '.$i->ingress.'
>
>   
>   '
>;
>
>
>  }
> }
>
>
>
> ?>
>
>
> ** END PHP file ***
>
>



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



[PHP-DB] special character in filename

2003-06-08 Thread Ole Hornauer
hi,

since i got my mp3 code somewhat working (was my fault, sorry guys), i 
encountered another problem that i simply cant solve on my own.
im scanning mp3 files in a directory to put the data into a mysql 
database. 
everything works fine except that those files that have inverted commas 
(maybe also other special characters?) as part of the filename are being 
ignored by the script. i tried to use addslashes() but that didn't help 
either. i included a test (echo $dir.$file) to see what exactly would be 
inside the variables. but it looked ok.
could anybody give me a hint? i just dont get it.

here is my code. i included mphp3.php from http://res.crea-bmb.de/mphp3/ 
to scan for mp3 tags:

load($dir.$file);
$abfrage ="insert into mp3 (
  file,
  path,
  artist,
  title,
  album)
values (
 '$file',
 '$dir',
 '$info->v2_artist',
 '$info->v2_title',
 '$info->v2_album');";
mysql_query($abfrage);
}
}
@closedir($handle);
}
?>

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



RE: [PHP-DB] ?? Login problems ??

2003-06-08 Thread John W. Holmes
> I have this script that logs people into a website
> using cookies.  On my linux web server it works fine
> but when I downloaded the Windows version of mysql for
> my personal PC to do offline work I get an error with
> the identical file.
> 
> The error is on line 86 undefined username
> 
> But on my linux server I don't get it.  But with the
> error I can't test things offline.
> 
> I have included the file that is producing the error.
[way to many lines of code snipped]

Try again. Post the exact error you're getting (what you're getting is
most likely just a Warning) and a _FEW_ lines around where the error is
at. 

For the likely problem causing your "error" read the manual page on
error reporting.

http://us2.php.net/error_reporting

---John W. Holmes...

Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



[PHP-DB] PHP LDAP and Active Directory ...

2003-06-08 Thread Olivier FONTES
Hi all
I am new on this list...
I 've got a problem with ldap_connect ... when i try to connect on an 
Active Directory on WIN2k ... An error message say :
   Invalid LDAP Server ...
The LDAP Port on my server is open (389).
Is there anyone who had used php with active directory ...
(Config: Apache2.0.46, PHP4.3.2 on WIn2k)

Olivier FONTES France (LUNEVILLE)

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


[PHP-DB] Re: SQL Server connection error.

2003-06-08 Thread Thomas Zibolowski
Try using mssql

"Russell Roberts-Spears" <[EMAIL PROTECTED]> schrieb im
Newsbeitrag news:[EMAIL PROTECTED]
> Hi,
>
> I am new to PHP DB code and am currently struggling with the connection to
> SQL Server 2000. I am using ODBC and have created a System DSN with
> integrated NT security specifiying which DB etc. I have written the
> following code and posted it in the htdocs folder for Apache. (We are all
> running on Win2000 platforms, Web server is set apart from the DB server,
> but linked via LAN.
>
> PHP code:
>
>
> 
>   ADODB Test in PHP
> 
> 
>   
> // simple conection
>
>
> $cnx = odbc_connect('web', '', '');
> file://query
> $SQL_Exec_String =  "select * from TblClients";
> file://ejecucion query
> $cur= odbc_exec( $cnx, $SQL_Exec_String );
> echo  "DniNombre".
> "codigociudad\n";
>while( odbc_fetch_row( $cur ) ) {
>   $Title= odbc_result( $cur, 1 );
>   $Fname= odbc_result( $cur, 2 );
>   $Surname= odbc_result( $cur, 3 );
>   $Address1= odbc_result( $cur, 4 );
>echo "$Title$Fname".
> "$Surname$Address1\n";
>}
>echo  "";
>
> ?>
> 
> 
>
> 
>
>
> I then get back the following error:
>
>
>
> Warning: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Login
> failed for user 'PROTE\LATTITUDWEBSERV$'., SQL state 28000 in SQLConnect
in
> C:\Apache\Apache2\htdocs\DBtest.php on line 9
>
> Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource
in
> C:\Apache\Apache2\htdocs\DBtest.php on line 10
> DATA FROM SQL SERVER WITH PHP4 Cand_ID Password
>
> Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result
> resource in C:\Apache\Apache2\htdocs\DBtest.php on line 14
>
>
>
> Am at a loss as to why the error. Have created another DSN in same system
> which links in using VB to the same SQL Server using the same NT
integrated
> security and it is fine, so I am a little perplexed.
>
> Any help or pointers would be gratefully received
>
>
> Best regards
>
>
>
> Russell
>
> _
> Stay in touch with absent friends - get MSN Messenger
> http://www.msn.co.uk/messenger
>



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



[PHP-DB] korean characters out of ms sql

2003-06-08 Thread Thomas Zibolowski
I try to build a small webserver using php in cgi mode connecting to a mssql
database. It works allready with 11 different languages. But now I try to
read hangul (korean chars). Under IIS (same php config, same script, same
database) I got the right characters out of the database. Trying to use my
own webserver failded - means I get wrong characters out of the query.
Anyone a idea how it works??
Thanx in advance.



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



[PHP-DB] ?? Login problems ??

2003-06-08 Thread JeRRy
Hi,

I have this script that logs people into a website
using cookies.  On my linux web server it works fine
but when I downloaded the Windows version of mysql for
my personal PC to do offline work I get an error with
the identical file.

The error is on line 86 undefined username

But on my linux server I don't get it.  But with the
error I can't test things offline.  

I have included the file that is producing the error.

mailto:[EMAIL PROTECTED].\n";
exit;
  }

  $lim = mysql_num_rows( $dbq );

  if ($lim != 1) {

  $headers=1; 
  echo "Login
Page";
  echo "Invalid User ID or
Password. Please Try again";

  }

  if ($lim == 1) {

  $timer = md5(time());
  $sid = $Username . "+" . $timer;
  SetCookie("login",$sid,time()+3600); 
  $query = "update tipping set sid=\"$timer\" where
nickname=\"$Username\"";

  if( !($dbq = mysql_query( $query, $dblink))) {
echo "Unable to update database.  Please contact
mailto:[EMAIL PROTECTED].\n";
  exit;
  }

  header("Location: $redirect");
  exit;

}

if (isset($login)) {
  $headers=1;
  $sidarray = explode("+", "$login");
  $query = "select * from tipping where nickname =
\"$sidarray[0]\" and sid = \"$sidarray[1]\"";

  if ( !($dbq = mysql_query($query, $dblink))) {
echo "Unable to find database.  Please Contact mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED].\n";
exit;
  }

  if (mysql_num_rows( $dbq ) == 1) {
echo "Login
Page";
echo "You are already logged in as
$sidarray[0].";
echo "You may logon as another user or simply
begin using our services with your current
session.";
echo "Click http://www.tassiedemononline.org.au/tiplogin.php\";>Here
to return to our homepage.";
  }
}
if ($headers == 0) {
echo " ";
}
}

echo "";
echo "User Name";
echo "";
echo "";
echo "Password";
echo "";
echo "";
echo "";
echo "";
echo "";

?>


Any ideas?  

Thanks!

Jerry

http://mobile.yahoo.com.au - Yahoo! Mobile
- Check & compose your email via SMS on your Telstra or Vodafone mobile.

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