Re: [PHP-DB] MySQLi

2014-09-15 Thread Jasper Kips


 Op 15 sep. 2014 om 01:08 heeft Karl DeSaulniers k...@designdrumm.com het 
 volgende geschreven:
 
 Procedural php. Haven't had a chance to learn OOP. Would love to though. : /
 I think I may be moling it a bit too. Guess I was hoping for an easy fix, 
 don't judge me.. :P
 Thanks for all your responses everyone. 
 
 Best,
 
 Karl DeSaulniers
 Design Drumm
 http://designdrumm.com
 
 
 
 On Sep 14, 2014, at 2:48 AM, Lester Caine les...@lsces.co.uk wrote:
 
 On 14/09/14 04:57, Karl DeSaulniers wrote:
 Awesome, thanks for the link. I know even less about PDO then I do regular 
 MySQL however.
 I am hoping MySQLi isn't too far off a shoot. Just need to sit down with it 
 all and figure out a path.
 
 PDO is still a bit of a grey area. It was intended to make changes
 between database engines more transparent, and MySQL to MySQLi is
 essentially just a different front end both targeting MySQL. The problem
 is that it only ever did half the job, trying to make the data returned
 'transparent' while ignoring the SQL. Aziz's approach is one way of
 going, but just like the e_strict problems with PHP itself, it's the
 subtle changes to the language used which cause problems when
 'translating' from one to the other. It will depend on the style of
 MySQL you are using currently as to how easy it is to 'translate'. My
 own database is Firebird which has SQL functions that have yet to appear
 in MySQL, some of those are exposed in MySQLi so you can ignore them
 when upgrading but it is always those fringe cases that take the most
 time to resolve? :(
 
 -- 
 Lester Caine - G8HFL
 
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

Problem with easy fixes is that they lead to tremendous problems. Best is to 
take the more difficult road, it'll be way quicker.
Yup off topic I know

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



Re: [PHP-DB] www-data file

2014-08-26 Thread Jasper Kips
What are you trying to achieve? Or to put it more clearly, why do you need the 
filw owner to be ethan?

Jasper

Verstuurd vanaf mijn iPad

 Op 26 aug. 2014 om 06:20 heeft Ethan Rosenberg 
 erosenb...@hygeiabiomedical.com het volgende geschreven:
 
 Dear list -
 
 When I use  fopen, the  file owner and group are both www-data.
 
 How can I ensure that the owner and group will be ethan?
 
 TIA
 
 Ethan
 
 
 
 -- 
 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



[PHP-DB] File Mime Type Function

2004-09-23 Thread Jasper Howard
I've looked around for a while, does anyone know of a PHP function
already built in to the install that gets the Mime type of a file on
the server?

thanks,

-- 

Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
---

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



Re: [PHP-DB] File Mime Type Function

2004-09-23 Thread Jasper Howard
cool, that's what I was looking at doing, I was just wondering if
there was anything native to php 4.3.8.


On Thu, 23 Sep 2004 11:59:41 -0500, Matt M. [EMAIL PROTECTED] wrote:
  I've looked around for a while, does anyone know of a PHP function
  already built in to the install that gets the Mime type of a file on
  the server?
 
 you might try this
 
 http://pear.php.net/package/MIME_Type/
 



-- 

Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
---

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



Re: [PHP-DB] Passing URL parameters, how to hide

2004-09-21 Thread jasper
the encryption is random, there is no algorithm to break it, I'm not going
to argue against any of the other problems with this system, but no one is
going to be able to break this algorithm, its 14 characters of lowercase and
upper case letters and numbers, in random order.


--
Jasper Howard :: Database Administration
Velocity7
1.530.470.9292
http://www.Velocity7.com/
--
- Original Message - 
From: Stuart Felenstein [EMAIL PROTECTED]
To: Jasper Howard [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, September 21, 2004 1:03 AM
Subject: Re: [PHP-DB] Passing URL parameters, how to hide


 Up front it sounds like a good option.  However, my
 first thought is, entering another encrypted id just
 puts me back to the same problem.  How easy would it
 be for someone to break the encryption algorithm ?  My
 guess is that it would be easy.

 Stuart
 --- Jasper Howard [EMAIL PROTECTED] wrote:

  When I created a business management script for the
  business I work for, it
  was important that ids in url's were encrypted. What
  I did was create a code
  for each item that needed one. My encryption table
  fields looked something
  like: enc_id, encryption, table, id where enc_id was
  the unique identifier
  in this table, encryption was the 14 character code,
  table was the table
  that the encrypted data was stored in, and id was
  the id of the encrypted
  data. That was you can pass the 14 digit code in the
  html, then when you
  need to use it in a php script you can just make a
  function that returns the
  data from the database from the encryption code. For
  extra security (since
  someone could just remember the encryption code) I
  added a cron job script
  that changed the encryptions every midnight. If
  anyone thinks something like
  this would work for them, some thing to remember is
  that you need to make
  sure that when you add an item to the encryption
  table in the db that each
  code is unique.
 
  -- 
 
 
 
 --
  Jasper Howard :: Database Administration
  ApexEleven Web Design
  1.530.559.0107
  http://www.ApexEleven.com/
 
 --
  Stuart Felenstein [EMAIL PROTECTED] wrote in
  message
 
 news:[EMAIL PROTECTED]
   I'm restarting this post.  I thought I was out of
  the
   woods, but not.
   Here situation, in most of my update forms which
   involve 1 record, passing a session variable ,
  usually
   the users ID is enough. No URL param passing.
  
   Not so in two update forms I have where there are
   multiple records for each user.  If I pass a
  session
   variable it only brings up the first record.  So
   unless I am missing something, I must pass the
  record
   ID via a URL parameter.  That works just great,
  but
   the problems lies in the fact, that all anyone
  would
   need to do is change recordID=1 to recordID=2 and
  they
   can see someone elses record, which is supposed to
   confidential.
  
   Now I've looked at sights like Monster, Amazon,
  Ebay,
   and tried changing the recordID in the URL area,
  but
   it either ignores my change or kicked back an
  invalid
   ID.
   This is even if I remove the other ID's from the
  line.
  
  
   So, I'm sure this has been dealt with more, I
  don't
   have the foggiest clue yet though how I can
  implement
   something that either hides, or prevents a user
  from
   going through records in the database by changing
  the
   id number.
  
   Appreciate any suggestions or ideas.
  
   Thank you,
   Stuart
  
  
  
  
  
   --- Stuart Felenstein [EMAIL PROTECTED] wrote:
  
Turned out hiding the id wasn't necessary as
  the
awaiting update page can grab the session ID.
I wasn't thinking. Sorry
Stuart
--- John Holmes [EMAIL PROTECTED]
  wrote:
   
 Stuart Felenstein wrote:
  I'm still confused over one aspect of URL
 parameters.
  As far as a form passing data back to the
server,
 I
  understand about get, post and replace.
 
  Here is my problem.
  I have an update form.  User is logged in to
  the
  system and needs to update whatever
  information.
  Right now I'm including in the link the
  user's
ID,
 so
  when they arrive at the update page, their
record
 will
  be displayed.
  The problem is all one has to do is change
  the
ID
  number in the URL parameter in the update
  page
and
 you
  can go to someone else's record.
 
  How do programmers generally get around this
  ? I
 must
  be missing something.

 How do you identify the user once they are
  logged
 in? There should be
 some way to relate the logged in user to valid
 records they can see.
 Then, if they request an invalid record, you
  can
 show them an error

Re: [PHP-DB] Passing URL parameters, how to hide

2004-09-21 Thread Jasper Howard
Ok guys, I think you're beating a dead horse, the idea is understood,
and there are quite a few ways to do what is needed, there have been
like 30 posts on this...


On Tue, 21 Sep 2004 14:12:43 -0400, John Holmes
[EMAIL PROTECTED] wrote:
 From: Stuart Felenstein [EMAIL PROTECTED]
 
  I still want to pass the id's through hidden.
 
  So the html in the first form looks like this:
 
  input name=hiddenField type=hidden
  value=recordID
  input name=hiddenField type=hidden value=user
  id/td
 
  Form is set to post.
 
 Why would you pass UserID in the form when you turn around and pull it from
 the session in your code? It's a waste.
 
 Also, with the above, if I were to change UserID to 5 (assuming that a valid
 userID) and recordID to 20 (assuming that's a valid recordID that userID 5
 has access to), would I be able to see the record? I shouldn't be...
 
 ---John Holmes... 
 
 
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 



-- 

Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
---

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



[PHP-DB] Re: Finding the value of the COMMENT in a table column

2004-09-20 Thread Jasper Howard
don't you get that with the DEFINE `table` query?

-- 


--
Jasper Howard :: Database Administration
ApexEleven Web Design
1.530.559.0107
http://www.ApexEleven.com/
--
Ross Honniball [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi all,

 Anyone know how to access the optional COMMENT you can add to columns
 during table creation?

 eg.

 create table x (fldx char(1) COMMENT 'some comment', fldy char (1) COMMENT
 'another comment')

 I want to 'get' the COMMENT field.

 I know it should be in the manual, but I can't find it.

 Thanks ... Ross
 .
 . Ross Honniball. JCU Bookshop Cairns, Qld, Australia.
 .

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



Re: [PHP-DB] Passing URL parameters, how to hide

2004-09-20 Thread Jasper Howard
When I created a business management script for the business I work for, it
was important that ids in url's were encrypted. What I did was create a code
for each item that needed one. My encryption table fields looked something
like: enc_id, encryption, table, id where enc_id was the unique identifier
in this table, encryption was the 14 character code, table was the table
that the encrypted data was stored in, and id was the id of the encrypted
data. That was you can pass the 14 digit code in the html, then when you
need to use it in a php script you can just make a function that returns the
data from the database from the encryption code. For extra security (since
someone could just remember the encryption code) I added a cron job script
that changed the encryptions every midnight. If anyone thinks something like
this would work for them, some thing to remember is that you need to make
sure that when you add an item to the encryption table in the db that each
code is unique.

-- 


--
Jasper Howard :: Database Administration
ApexEleven Web Design
1.530.559.0107
http://www.ApexEleven.com/
--
Stuart Felenstein [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I'm restarting this post.  I thought I was out of the
 woods, but not.
 Here situation, in most of my update forms which
 involve 1 record, passing a session variable , usually
 the users ID is enough. No URL param passing.

 Not so in two update forms I have where there are
 multiple records for each user.  If I pass a session
 variable it only brings up the first record.  So
 unless I am missing something, I must pass the record
 ID via a URL parameter.  That works just great, but
 the problems lies in the fact, that all anyone would
 need to do is change recordID=1 to recordID=2 and they
 can see someone elses record, which is supposed to
 confidential.

 Now I've looked at sights like Monster, Amazon, Ebay,
 and tried changing the recordID in the URL area, but
 it either ignores my change or kicked back an invalid
 ID.
 This is even if I remove the other ID's from the line.


 So, I'm sure this has been dealt with more, I don't
 have the foggiest clue yet though how I can implement
 something that either hides, or prevents a user from
 going through records in the database by changing the
 id number.

 Appreciate any suggestions or ideas.

 Thank you,
 Stuart





 --- Stuart Felenstein [EMAIL PROTECTED] wrote:

  Turned out hiding the id wasn't necessary as the
  awaiting update page can grab the session ID.
  I wasn't thinking. Sorry
  Stuart
  --- John Holmes [EMAIL PROTECTED] wrote:
 
   Stuart Felenstein wrote:
I'm still confused over one aspect of URL
   parameters.
As far as a form passing data back to the
  server,
   I
understand about get, post and replace.
   
Here is my problem.
I have an update form.  User is logged in to the
system and needs to update whatever information.
Right now I'm including in the link the user's
  ID,
   so
when they arrive at the update page, their
  record
   will
be displayed.
The problem is all one has to do is change the
  ID
number in the URL parameter in the update page
  and
   you
can go to someone else's record.
   
How do programmers generally get around this ? I
   must
be missing something.
  
   How do you identify the user once they are logged
   in? There should be
   some way to relate the logged in user to valid
   records they can see.
   Then, if they request an invalid record, you can
   show them an error
   page. Hiding the ID isn't going to fix anything.
  
   -- 
  
   ---John Holmes...
  
   Amazon Wishlist:
   www.amazon.com/o/registry/3BEXC84AB3A5E/
  
   php|architect: The Magazine for PHP Professionals
  -
   www.phparch.com
  
  
  
 
  -- 
  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



[PHP-DB] Re: Using sessions to gather visitor information

2004-09-15 Thread Jasper Howard
the time difference is most likely becuase your server is in a different
time zone, or is at least set to a different time zone. When you run your
time calculations, you can add something like this:

$now = (time() - 18000);

that would give you the time on the server minus 5 hours. Now I don't know
the difference between time() and localtime() so I don't know how that will
affect the output.

-- 


--
Jasper Howard :: Database Administration
ApexEleven Web Design
1.530.559.0107
http://www.ApexEleven.com/
--
Vincent Jordan [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I am trying to track the users that visit one page on a site. I am having
a
 couple of problems. The time seems to be 5 hours off. I do not have any
 tables as of yet what I would like to do is only count an ip address as
one
 in a 24 hour period, if more than one visit then update visit count.I have
 played around with the time using date() and localtime().  Here is what I
 have sofar.



 ini_set('display_errors',1);

 error_reporting(E_ALL  ~E_NOTICE);

 session_start();

 $_SESSION['ip_address'] = $IP;

 $_SESSION['user_agent'] = $Browser;

 $_SESSION['host_name'] = $Host;

 $_SESSION['visit_time'] = $now;



 $now = localtime();

 $now = $now[2] . : . $now[1] . : . $now[0];

 $IP = getenv(REMOTE_ADDR);

 $Browser = $_SERVER['HTTP_USER_AGENT'];

 $Host = getHostByName($IP);



 I have not setup tables yet but I think I will use this:

 vid init(5) not null auto_incriment

 ip varchar(25) null

 agent varchar(100) null

 host varchar(100) null

 time varchar(10) nul

 visitcount int(100) null



 when a visitor loads the page I can run this



 mysql_query(SELECT ip, time FROM tablename where
ip=$_SESSION['ip_address']
 and time=$_SESSION['visit_time'])



 I would like to query if $_SESSION['ip_address'] has visited in less then
24
 hours then kill session and close mysql connection. If last visit was more
 than 24 hours update time and add +1 to visitcount. If new visit add to
 table.



 Once all done how can I properly clean up the session. I have tried the
 following bur get an error

 unset($_SESSION);

 session_destroy();

 I tried this with a link to another page and got this error:

 Warning: session_destroy(): Trying to destroy uninitialized session in
 /home/content/html/killtest.php on line 5

 I assume I forgot something.



 Any help would be appreciated.









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



[PHP-DB] Re: Passing variables from HTML to PHP

2004-08-31 Thread Jasper Howard
if the checkbox is checked then you'll get the value in the php script. If
globals are turned on then echo $foo; will work, otherwise you have to use
something like: echo $_POST['foo'];

its a good idea to write your scripts without dependency on globals being
turned on, its a security risk for it to be on.

-- 


--
Jasper Howard :: Database Administration
Velocity7
1.530.470.9292
http://www.Velocity7.com/
--
Philip Thompson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi all.

 This might be a simple answer, but I'm still not sure what the case is.
 Okay, so I have a form in my html that has some inputs. These each
 have a `name` and a `value` attribute to them, of course.

 I cannot seem to access the name/value pair in my php without using the
 $_POST method/variable names. Are you able to without $_POST? Example:

 ---
 html:
 input type=checkbox name=foo value=bar

 php:
 do this:
 echo foo =  . $foo; // foo = bar

 or this:
 echo foo =  . $_POST[foo]; // foo = bar
 ---

 So, should both of those php examples work the same?

 Thanks!
 ~Philip

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



[PHP-DB] Re: Installing PHP

2004-08-30 Thread Jasper Howard
kinda sounds like you haven't updated your apache (or whatever else you
might be using) config file, I inserted this bit of code at the top of my
apache config file:

ScriptAlias /php4/ c:/php4/
AddType application/x-httpd-php .php
Action application/x-httpd-php /php4/php.exe

if you copy this, make sure you edit file path's to look like yours

-- 


--
Jasper Howard :: Database Administration
Velocity7
1.530.470.9292
http://www.Velocity7.com/
--
Judy Picard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I believe I have an installation problem on my WinXP
 machine. I have some .htm files with PHP within in my
 localhost [wwwroot] directory.
 When I open the major one [I wrote but I think it's
 mostly correct] in IE6, I get an error on line 69
 [which is the end of my PHP.] When I open in IE6 a
 test file:
 **
 !doctype html public -//W3C//DTD HTML 4.0//EN
 html
 head
   titleUntitled web-page/title
 /head
 body
 ?php
 echo (My name is Judy.);
 ?
 /body
 /html
 **

 I get a blank page. When I view its source still
 within IE6, I can see all of the above including the
 PHP coding which is why I surmise that PHP isn't
 installed correctly.

 Developing the site online isn't practical. I need to
 make it work locally before uploading. Help!
 thanks,
 judy



 __
 Do you Yahoo!?
 Yahoo! Mail - 50x more storage than other providers!
 http://promotions.yahoo.com/new_mail

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



[PHP-DB] Re: PHP Array to Javascript?

2004-08-26 Thread Jasper Howard
depending on the size I guess you could run a foreach loop
ex.

$num = 0;
foreach ($ringb as $val) {
 print x[$num] = '$val';\n;
 $num += 1;
}

so it pretty much just cycles through your array and prints it out in
javascript form...

Chris Payne [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi there everyone,



 I set an array using the following in PHP:



 $ringb[$i]=$complex_area;

 $i++;



 It cycles through my DB and stores the info, my question is, how can I
 convert it to a value that can be read in Javascript?



 I'm stumped.



 Chris



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



[PHP-DB] Re: Help! WINXP/Apache2.0/PHP4.3.8 - Can't run PHP

2004-08-20 Thread Jasper Howard
yeah, sounds like you aren't setting anything in the apache config to pharse
the php script with the php engine.
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 When I have a html page with an embedded php method behind a button, when
I click the button I can't run the PHP, instead my browser pops up a dialog
box with a request a file download of my PHP script.

 Also, when I run a php in my browser either nothing happens or I get the
file load.

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



Re: [PHP-DB] Re: Help! WINXP/Apache2.0/PHP4.3.8 - Can't run PHP

2004-08-20 Thread Jasper Howard
ScriptAlias /php4/ c:/php4/
AddType application/x-httpd-php .php
Action application/x-httpd-php /php4/php.exe

does it look something like this?


[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Thanks Peter and Jasper. I changed the httpd.conf to make sure they point
to the proper Load module and add type and PHPInidir but still no luck.

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



[PHP-DB] Re: Checkboxes in a table

2004-08-20 Thread Jasper Howard
just set the checked value of the check boxes to something like, true, and
when you are going through the check boxes in the second script do something
like this:

$boxes = array();
$num = 0;
foreach ($_POST['checkboxe'] as $box) {
 if ($box == 'true') {
  $boxes[$num] = 'checked';
 } else {
  $boxes[$num] = 'unchecked';
 }
 $num += 1;
}

Now the array $boxes has the values for all the checkboxes, if they were
checked or not.

NOTES: This is just a quick script, I don't know if it'll work for you
perfectly, but you should always start at 0, not 1, so that the first value
in the array is not null.

anyway, hope this helps.


Miguel Guirao [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi!!

 I'm dinamically building a table, within a while cycle a build each row
 with it's columns.
 One of these columns contains a checkbox, so I have as many checkboxes
 as many rows.

 So, after hitting Submit I wanna know which checkboxes has been
 selected, I'm naming each of them  like this: checkbox[n], where n=1 is
 for the first row and so on.

 So, my question is, upon receiving all the variables in the second
 script, if I navigate thru each of the elements, I will see which one is
 selected and which one is not?
 Am I all right??

 Miguel Guirao
 Servicios Datacard
 www.SIASA.com.mx



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



[PHP-DB] Re: MAILING LIST

2004-08-17 Thread Jasper Howard
in order to send an email on your computer you have to have a sendmail
program, you can download one if you want. I've never tried it but you could
try using another server for your sendmail needs.
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
 Dear Friends,
 Mailing list isn't able to send email using local host.
 manipulated ini file didn't fix issue

 Any guidance, please.
 -
 Following is the error
 --
 Warning: mail(): Failed to connect to mailserver at localhost port 25,
 verify your SMTP and smtp_port setting in php.ini or use ini_set() in
 C:\HOME\doctorbush\sendmymail.php on line 44
 newsletter sent to: [EMAIL PROTECTED]

 Warning: mail(): Failed to connect to mailserver at localhost port 25,
 verify your SMTP and smtp_port setting in php.ini or use ini_set() in
 C:\HOME\doctorbush\sendmymail.php on line 44
 newsletter sent to: [EMAIL PROTECTED]

 Warning: mail(): Failed to connect to mailserver at localhost port 25,
 verify your SMTP and smtp_port setting in php.ini or use ini_set() in
 C:\HOME\doctorbush\sendmymail.php on line 44
 newsletter sent to: [EMAIL PROTECTED]


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