[PHP-DB] Concurrent rutines

2004-07-20 Thread Luis Morales
Hello,
Does any know how run many procedures concurrently over php. For example:
$init = ;
While (($t < $timeout ) and ($allresult == 0 ) ){
   $t =  - $init;
   launch{
   $r[1] = app1;
   $r[2] = app2;  
   $r[n] = appn;
  }
   $allresult = $r[1] && $r[2] && ... && $r[n];
}

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


Re: [PHP-DB] MySQL backup software

2004-10-27 Thread Luis Morales
Perry, Matthew (Fire Marshal's Office) wrote:
Does anyone know a free MySQL backup program to schedule regular backups?
 

Hi Mathew, i made an litle script to do that.
mysqlbk.pl
Desc: This script made and mysql rotative backup fron sunday to sunday
-
#!/usr/bin/env perl
use strict;
use File::Find ();
use POSIX qw(strftime);
use DBI;
my $day = strftime "%A", gmtime;
my $str = POSIX::strftime( "%A, %B %d, %Y", localtime(time));
my $path = "/home/lmorales/backup/mysql/".$day;
#print "Creando directorio ".$path."\n";
eval{
system("/bin/rm -r ".$path);
system("/bin/mkdir ".$path);
};
my $dbh = DBI->connect("DBI:mysql:database=mysql;host=localhost",
   "root", "yourpasswd",
   {'RaiseError' => 1});
my $sth = $dbh->prepare("show databases");
$sth->execute();
print "Respaldo diario: $str\n";
while (my $ref = $sth->fetchrow_hashref()){
 print "Creando Respaldo para Data Base :  $ref->{'Database'} \n";
 system("/usr/bin/mysqldump -uroot -pag10nus --lock-tables 
$ref->{'Database'} > ".$path."/$ref->{'Database'}.sql");
 system("/usr/bin/bzip2 -9 ".$path."/$ref->{'Database'}.sql");
}

$sth->finish();
$dbh->disconnect();
---
backup-db.sh
you can send script notification using:
#!/usr/bin/env sh
(
echo "To: Luis Morales <[EMAIL PROTECTED]>"
echo "From: system <[EMAIL PROTECTED]>"
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/home/lmorales/bin:
export PATH
echo "Subject: Respaldo diario de la BD::delahorro.com"
echo
/home/lmorales/bin/backup-db.pl
echo
) 2>&1 | /usr/lib/sendmail -t
exit 0
---
and finally add this entry to crontab:
0 1 * * * /backup-db.sh &> /dev/null
Good luck..!
regards,
Luis Morales
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] dbase and Debian

2005-03-23 Thread Luis Morales
Leo G. Divinagracia III wrote:

Ricardo Markiewicz wrote:

Unfortunately, I can't convert the dbf files to SQL tables, so, i need
dbase support in PHP :(
connect via ODBC, perhaps?  then ADOdb or PEAR it?
you can do that. why not try with an class from phpclasses.com. I 
use dbf to mysql or symilar to export dbf data base to mysql or any RDBM.

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


Re: [PHP-DB] Where are my form variables?

2005-05-04 Thread Luis Morales

The best way is made an var_dump of $_POST array vars:



Regards,

Luis Morales

Juffermans, Jos wrote:

>Hi,
>
>If you expect your variables to be generated automatically, you may find
>that newer versions of PHP have that disabled by default - because it's less
>secure.
>
>Try to read $_POST{"formfieldname"} to get your data...
>
>To quickly find out all the post data that you received:
>   print ""; print_r($_POST); print "";
>?>
>
>Jos
>
>-Original Message-
>From: MIGUEL ANTONIO GUIRAO AGUILAR
>[mailto:[EMAIL PROTECTED]
>Sent: 03 May 2005 07:41
>To: [email protected]
>Subject: [PHP-DB] Where are my form variables?
>
>
>Hi!!
>
>I created a form with five text boxes, method=post and action=myscript.php;
>but I can't see the variables at the target script, why?
>
>Do I need a special sintaxis for accesing the POST array?
>Regards,
>
>--
>MIGUEL GUIRAO AGUILERA
>
>  
>

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



Re: [PHP-DB] Need some help

2005-05-11 Thread Luis Morales
Why not use a sessions ?

once posted your process form, you can store the final results on
session vars and passing the results to other pages.

Take a look on www.php.net on session topic.

Regards,

Luis Morales


Murray @ PlanetThoughtful wrote:

>>Sorry but this isn't working.  The variable $ttl_price is a calculation in
>>my first script.  It stores the value of $Total_Price for all items.  I am
>>trying to pass that to a new page.  It isn't a form that I'm working with,
>>do I need to make it a form?  I would greatly appreciate any help you
>>could
>>offer.
>>
>>
>
>The $_POST[] superglobal is only available to a page directly following a
>page with a form on it, when the form's method set to 'POST'.
>
>Id $ttl_price a single value or an array?
>
>If you are not using a form, you could possibly pass the value on the query
>string, then use $_GET[] in your target page to retrieve the value from the
>query string. This doesn't require the presence of a form on your
>originating page.
>
>Otherwise, you could also use sessions to put the value into a session
>cookie and then retrieve it from the target page, using the $_SESSION
>superglobal.
>
>How are you moving from the page in which the calculation is done to the
>page in which you need the calculation? Ie, do you click on a button, a
>link, do you redirect to the page etc?
>
>Much warmth,
>
>Murray 
>
>  
>

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



Re: [PHP-DB] Connecting to MS Access DB in PHP, on Linux, Apache

2005-05-14 Thread Luis Morales
Sure!!!

Take a look on:

http://www.weberdev.com
http://odbtp.sourceforge.net/

My personal suggest is to use odbtp whith pear DB interface.

Regards,

Luis Morales





rob wrote:

> Anyone got any good websites or resources on how to connect to an
> access database and perform sql querrys etc, in Linux running apache?
>
> or if anyone has the connection strings required
>
> thanks in advance !!
>

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



Re: [PHP-DB] Moving data from one MySQL table to another

2005-05-19 Thread Luis Morales
Try do that whit phpmyadmin.

Regards,

Luis Morales


Bastien Koert wrote:

> if the archive tables structures are identical and no processing needs
> to be done, why not use a 'select into table where ' and use the ids
> of the records to choose the ones that move?
>
> Bastien
>
>> From: Jeffrey <[EMAIL PROTECTED]>
>> To: [email protected]
>> Subject: [PHP-DB] Moving data from one MySQL table to another
>> Date: Thu, 19 May 2005 15:19:48 +0200
>>
>> I'm working on a web application and one of the things I am doing is
>> creating an archiving function that would move older data to archive
>> tables in order to minimise the amount of data in the  active tables.
>> This so that the data that is being used more frequently can be
>> accessed faster by the users.
>>
>> My approach in building the archive function is:
>>
>> 1) SELECT query on the data
>> 2) mysql_fetch_array to put the data into an array
>> 3) INSERT subqueries to put the data into the archive tables.
>>
>> My concern is that in some cases, hundreds of rows of data would need
>> to be moved  - which could lead to awfully big arrays. However, the
>> archiving function is likely to be used infrequently - not more than
>> 1 or 2 times per week.
>>
>> This leads to two questions:
>>
>> 1) Could such a big array cause performance problems or worse?
>> 2) Is there a better way?
>>
>> Many thanks,
>>
>> Jeff
>>
>> -- 
>> 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] connection from Linux/Apache/PHP/Freetds to MSSQL

2005-06-15 Thread Luis Morales
Hi,

I have some experience with odbtp project. This project offer an better
api to connect MSSQL databases than freetds. 

Take an look on : http://odbtp.sourceforge.net/  you can also verify the
examples on this page: http://odbtp.sourceforge.net/examples.html

It's very easy to use.

Have a nice day,

Regards,

Luis Morales 

On Wed, 2005-06-15 at 23:02 +0200, Fülöp Tamás wrote:
> Freetds??

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



Re: [PHP-DB] PostgreSQL 7.2 - 8.0 replication issue

2005-06-27 Thread Luis Morales
Hi,

I write an litle procedure about migration from postgres 7x to 8x. 

this is the link:
http://fastonion.blogspot.com/2005/04/gentoo-migrando-postgres-7x-8.html

In Resume you must be do:

On current DB Server:
su - postgres
pg_dumpall > /tmp/db.out


On remote DB Server:
copy db.out to new location on new server
su - postgres 
psql -f db.out template1

Good Luck! 

Regards,

Luis Morales

On Mon, 2005-06-27 at 15:46 -0300, Martín Marqués wrote:
> El Lun 27 Jun 2005 15:31, Mark Galbreath escribió:
> > I have to upgrade a web app from PHP 4.3.11 with PostgreSQL 7.2 to PHP 
> > 5.0.4 
> with PostgreSQL 8.0.3.
> > 
> > Currently I have PHP4 (as Apache 2.54 mod on port 80) and PHP5 (default CGI 
> mode on port 8181) running concurrently on my DEV box.  I installed 
> PostgreSQL 8.0.3 on the DEV box as well.
> > 
> > On the PostgreSQL 7.2 server, I did a pg_dumpall > db.out and ftp'd db.out 
> to the PostgreSQL 8.0.3 (DEV) server.  When I attempt to pg_restore db.out, 
> the PostgreSQL archiver aborts with the error: "input file does not appear to 
> be a valid archive"
> 
> Never used pg_restore. I just do this:
> 
> $ psql -f db.out
> 
> Always worked for me.
> 
> -- 
> select 'mmarques' || '@' || 'unl.edu.ar' AS email;
> -
> Martín Marqués  |   Programador, DBA
> Centro de Telemática  | Administrador
>Universidad Nacional
> del Litoral
> -
> 

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



Re: [PHP-DB] screen resolution!

2006-02-06 Thread Luis Morales
Well,

you can do use auto resize if you use 0% over height and width table's
html tags.

eg.


  put your table content ---


Regards,

Luis Morales 

On Mon, 2006-02-06 at 09:28 -0800, Micah Stevens wrote:
> Yes, there is. It's called HTML.
> 
> You might think me daft, but HTML was actually created to allow the page to 
> adapt to screen size. The oldest technology on the block is actually the 
> thing to use in this situation, otherwise you're just creating extra work for 
> yourself. 
> 
> A simple example:
> 
>  - This works great, looks great, until you have a 
> 640x480 screen. Instead, try this:
> 
>   (this scales according to screen size)
> 
> or
> 
>  (this scales according to content size + screen size)
> 
> It really sounds like this is a problem with your web page design, not php or 
> Javascript. 
> 
> However, you could indeed do as others suggested and create multiple pages.. 
> That really sounds like more work than it's worth though. 
> 
> -Micah 
> 
> On Monday 06 February 2006 1:38 am, JeRRy wrote:
> > Yes I know this but there is no script that can re-write webpages on the
> > fly for certain resolutions?
> >
> >   Instead of re-doing each page for each res.?
> >
> >   With the technology these days I thought someone would of created
> > something like this, so you create a website than you put it through a
> > program that re-does the HTML for the resolutions you set and bingo the
> > results are spat out and you add it to the site and use a little script to
> > redirect depending on their set resolution.
> >
> >   Jerry
> >
> > PHP Superman <[EMAIL PROTECTED]> wrote:
> >   Or you can have a page which detects resolution by javascript and
> > redirects to another PHP page with the resolution data
> >
> >   On 2/4/06, Bastien Koert <[EMAIL PROTECTED]> wrote:
> > As the other poster mentioned you need JS to detect the screen widththe
> > usual approach is to use js to detect the screen res and the include the
> > appropriate CSS file to match the screen res.
> >
> > Bastien
> >
> > >From: JeRRy <[EMAIL PROTECTED]>
> > >To: [email protected]
> > >Subject: [PHP-DB] screen resolution!
> > >Date: Sun, 5 Feb 2006 02:44:19 +1100 (EST)
> > >
> > >Hi,
> > >
> > >   I have written a website in PHP using MYSQL.  But I have come accross
> > > an un-common problem.  Normally when I create a website it's done on a
> > > desktop PC.  But this time for the first time I did it on laptop meaning
> > > the screen resolution is different.
> > >
> > >   Is there any sort of script/code I can use to create another section of
> > >my site in a desired screen resolution without me having to do it all
> > >manually?
> > >
> > >   I know of many scripts online that I can DETERMINE visitors screen
> > >resolutions and recommend the correct one but don't know one that will
> > >adjust the website to suit that visitors screen resolution.  Am aware of
> > >scripts that redirect to another web page but that requires you to write
> > >the website again to cater for that.
> > >
> > >   Is there a quicker way/solution?
> > >
> > >   Thanks!
> > >
> > >   J
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
-- 
-
Luis Morales 
Consultor de Tecnologia
Cel: +(58)416-4242091
-
"Empieza por hacer lo necesario, luego lo que es posible... y de pronto
estarás haciendo lo imposible"
-

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



Re: [PHP-DB] handling of checkboxvalues

2006-02-11 Thread Luis Morales
Well, 

you can do this...


form.php 



form name='my_form' method='post' action='form.php'
ENCTYPE='multipart/form-data'

Re: [PHP-DB] handling of checkboxvalues

2006-02-13 Thread Luis Morales
umm,

ok... if you put your using echo: 

";
?>

Or over html :

"'>"

On this way both samples must be ok.....


Good luck

Luis Morales 


On Sun, 2006-02-12 at 10:33 +0100, Ruprecht Helms wrote:
> Luis Morales wrote:
> > Well, 
> >
> > you can do this...
> >
> >
> >
> > form name='my_form' method='post' action='form.php'
> > ENCTYPE='multipart/form-data'
> > 

Re: [PHP-DB] Issues with Oracle

2006-02-20 Thread Luis Morales
Creo q tu problema esta con la forma de conexion contra oracle, trata de
usar contexiones persistentes contra la base de datos. 

Te anexo una clase que desarrolle y estoy usando desde hace mas de 4
años, quizas te ayude. 


En tu servidor local instala el soporte a pear
http://pear.php.net/package/DB y luego ejecutas:

pear install DB

Con esto ya estaras listo para usar la clase. Te anexo un instructivo de
como usarla:

crear un pagina php:

--- index.php --

db_dbArray($MDB, $q)){
  var_dump($db->_db['data'][0]);
  echo "";
}else{
  echo $db->_db['debug'];
  echo "";
}

?>
----


Suerte,

Luis Morales



On Mon, 2006-02-20 at 15:22 -0400, ERNESTO PENALOZA wrote:
> php_info
-- 
---------
Luis Morales 
Consultor de Tecnologia
Cel: +(58)416-4242091
-
"Empieza por hacer lo necesario, luego lo que es posible... y de pronto
estarás haciendo lo imposible"
-


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

Re: [PHP-DB] Creating checkbox list.

2006-02-21 Thread Luis Morales
Hi,

first you need connect to the database y attach on this example a litle
extension class of Pear DB class. I suppose that your case use mysql
database.

this is an example: 

db_dbArray($DB, $q)){
   for($i=0;$i_db['data']);$i++){
 $checked = ($db->_db['data'][$i]['groups_id'] == $i) ? "checked" :
"";
 $out .= "{$db->_db['data'][$i]['groups_name']}";
   }
 }
 return $out;
}
?>








On Tue, 2006-02-21 at 20:52 -0500, Jeff Broomall wrote:
> Good evening.
> 
> I'm sure this is something easy so I'm hoping you can simply steer me to a 
> good source.
> 
> I simply need to create a Checkbox list using data from my "groups" table.
> 
> I have a table with two fields:
>  1)  groups_id
>  2)  groups_name
> 
> The data contained is simple:
> 
>  groups_id groups_name
>  --- 
>  1Group A
>  2Group B
>  3Group C
>  4Group D
> 
> I would like to dynamically create a checkbox selection similar to:
> 
> Group A
> Group B
> Group C
> Group D
> 
> So I need a script that'll take this information from the groups table
> and create the above.  Can you help?
> 
> As I look at this, I believe I'm going to need to create an array for my 
> final "report."  So I just added the [] after sel_group.
> 
> Thanks.
> 
> Ward 
> 
-- 
-
Luis Morales 
Consultor de Tecnologia
Cel: +(58)416-4242091
-
"Empieza por hacer lo necesario, luego lo que es posible... y de pronto
estarás haciendo lo imposible"
-


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

Re: [PHP-DB] Generate Report

2006-02-22 Thread Luis Morales
ok,

Let's go here..! 

--- generate_report.php --
 0){
  $wval = array ();
  foreach($_REQUEST['sel_group'] as $k => $v){
$wval[] = "groups_id='{$v}'";
  }
  
  //extract the columns 
  $scols = array ();
  if(count($_REQUEST['sel_cols]') > 0){
foreach($_REQUEST['sel_group'] as $k => $v){
  $scols[] = "{$v}";
}
 
//building query
$where = join(' AND ', $wval);
$sel_cols = join(',', $scols);
$query = "SELECT {$sel_cols} FROM tasks WHERE {$where}";
  }

}

//if $query is empty you can catch this case as an error because
there is not any group or selected columns

  break;

  default:
//reset your form
unset($_REQUEST);
}

?>


Generate Report





Select
Group(s)
Select Columns


Category One
Category Two




Group A
Group B
Group C
Group D



Column 
A
Column 
B
Column 
C
Column 
D
Column 
E
Column 
F


Column 
G
Column 
H
Column 
I
Column 
J
Column 
K
Column 
L











------ end generate_report.php --


Good Luck Buddy!!


Regards,

Luis Morales 

On Tue, 2006-02-21 at 23:06 -0500, Jeff Broomall wrote: 
> I thank those who promptly responded to my first inquiry on the list.
> 
> This second request is, I assume, a tad more challanging.
> 
> I need a "Generate Report" function that'll allow the user to select one or 
> more "groups" and what columns he would like to view.
> 
> For instance,
> 
> Generate Report
> 
> 
> 
> 
> 
> Select Group(s)
> Select Columns
> 
> 
> Category One
> Category Two
> 
> 
> 
> 
> Group A
> Group B
> Group C
> Group D
> 
> 
> 
> Column 
> A
> Column 
> B
> Column 
> C
> Column 
> D
> Column 
> E
> Column 
> F
> 
> 
> Column 
> G
> Column 
> H
> Column 
> I
> Column 
> J
> Column 
> K
> Column 
> L
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Let's say the user wants to view Group A and Group B AND view content from 
> the Coulmn A, Column B, Column D, and Column K.
> 
> So a checkmark would be placed within each box and the "Generate Report" 
> button would be "hit" to generate a report with titles situated 
> horizontally.
> 
> I'm assuming I'll need to create an array for both "sel_group" and 
> "sel_cols" and then, I believe it's "implode" them into string values??? Am 
> I thinking correctly???
> 
> I know this query won't work...but this is the direction I'm headed...
> 
> $query = "SELECT $sel_cols FROM tasks WHERE groups_id=$sel_groups";
> 
> IOW, the columns from the sel_cols array would go there, and the group 
> or groups would go after the WHERE statement.
> 
> Then I guess I would have to figure out the code for the echo.
> 
> Am I at least in the ballpark???
> 
> Thank you and good night.
> 
> Jeff
> 
-- 
-
Luis Morales 
Consultor de Tecnologia
Cel: +(58)416-4242091
-
"Empieza por hacer lo necesario, luego lo que es posible... y de pronto
estarás haciendo lo imposible"
-

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



Re: [PHP-DB] Tracking Site Version

2006-02-23 Thread Luis Morales
Yes!!

Subversion it's the best...

On Thu, 2006-02-23 at 13:05 -0800, Micah Stevens wrote:
> Subversion: http://subversion.tigris.org
> 
> 
> 
> On Thursday 23 February 2006 12:44 pm, Alex Major wrote:
> > Hi there,
> > I'm currently working on my website which is now live, and was wondering
> > how some of you more experienced web developers record site developments if
> > you do.
> > I'm thinking of perhaps creating a page on the site where I record the site
> > version, and changes made during the update. Just wondering if any of you
> > had a similar system, or if you had any suggestions for recording site
> > changes etc..
> >
> > Many thanks,
> > Alex.
> 
-- 
-
Luis Morales 
Consultor de Tecnologia
Cel: +(58)416-4242091
-
"Empieza por hacer lo necesario, luego lo que es posible... y de pronto
estarás haciendo lo imposible"
-

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



Re: [PHP-DB] PHP, MySQL and Apache

2006-02-27 Thread Luis Morales
Hi kinfe,

To connect to myql from php you only need build your php with mysql
support.

Now, for render vxml documents you are using apache o IIS ? 

I recommend LAMP (Linux+Apache+Myql+Php)

Regards,

Luis Morales 



On Mon, 2006-02-27 at 16:07 +0100, Kinfe Tadesse wrote:
> Hi all,
> 
> I intend to create a database to be accessed from a voice application. I 
> plan to use MySQL as a database engine and PHP as a scripting language to 
> generate dynamic VoiceXML documents. However, I have two questions I could 
> not get answers to:
>  1. Do I need to install Apache to work with MySQL and PHP? In other words, 
> can MySQL and PHP work together without Apache. Note: The database and the 
> application are on the same machine for the timebeing.
> 2. What database API should be used? I recently read about MyODBC. But many 
> standard books skip this part as if PHP and MySQL have something natural to 
> talk to eachother without requiring anything like ODBC, etc.
> 
> Your answers to these questions are highly appreciated!
> 
> Best regards,
> 
> Kinfe T. 
> 
-- 
-----
Luis Morales 
Consultor de Tecnologia
Cel: +(58)416-4242091
-
"Empieza por hacer lo necesario, luego lo que es posible... y de pronto
estarás haciendo lo imposible"
-

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



Re: [PHP-DB] Retricting Access to Menu Items

2006-03-07 Thread Luis Morales
Miguel,

Take this tips:

Before load your html main tags put:
.




.

Then try get the person array from another php page, using the same
schema for that.

Regards,

Luis Morales 


On Mon, 2006-03-06 at 21:32 -0800, MIGUEL ANTONIO GUIRAO AGUILAR wrote:
> 
> Now that you mention it!!
> 
> I tried to use sessions but without success, i did:
> 
> session_start();
> session_register(var);
> 
> but after log in as a different user, it keeps taking the data of the 
> previous user. If I close the browser window and reload the page and log in, 
> then it takes de current user
> 
> Maybe I'm not killing the previous session! session_unset();
> Do I need to propagate the Session ID on every page that use session_start()??
> Can I use session_id();?
> 
> Best Regards,
> Miguel Guirao
> 
> 
> - Mensaje original -
> De: Jeffrey <[EMAIL PROTECTED]>
> Fecha: Lunes, Marzo 6, 2006 7:37 ombr
> Asunto: Re: [PHP-DB] Retricting Access to Menu Items
> 
> > I've done this kind of thing with a number of web apps.
> > 
> > What I usually do is create a user table in MySQL with a user-name, 
> > password and access level, which has an integer value.
> > 
> > When a user logs in successfully, a session is created (see 
> > session_start() in php documentation), the access level is pulled 
> > from 
> > the user table and saved as a session variable. Then it is a simple 
> > matter of using bits of code like...
> > 
> > if ($_SESSION['access_level'] > 7){
> > echo "some stuff";
> > }
> > 
> > In your example, you will also want to check the user's access 
> > level on 
> > each restricted page - it is not enough to hide menu options. Users 
> > could simply type the URL in.
> > 
> > I hope that's clear.
> > 
> > Good luck,
> > 
> > Jeffrey
> > 
> > Jeff Broomall wrote:
> > > Good morning everyone.
> > > 
> > > I'm building a very simple content management site that tracks 
> > "tasks."> 
> > > The options available are:
> > >  1. Add Task
> > >  2. Edit Task
> > >  3. View Task
> > >  4. Print Task
> > > 
> > > I need to restrict some users to only View and Print and I'm 
> > trying to find a way to tell the page not to load the menu options 
> > (the text) for those not having access to the Add and Edit functions.
> > > 
> > > IOW, they would only see View and Print.
> > > 
> > > I have three basic users:
> > >  1. System Admin
> > >  2. Subject Matter Expert (SME)
> > >  3. Viewers
> > > 
> > > Obviously the System Admin and SME will have full access so it's 
> > the Viewers that are to have access to only View and Print.
> > > 
> > > I have a users table but haven't set it up for the distinction.  
> > What I was thinking was creating a field labeled users_group and 
> > assign a numeric value for each user using the numbering system above.
> > > 
> > > I have my page load the menu options:
> > > 
> > > Home
> > > View Tasks
> > > Edit Task
> > > Add Task
> > > 
> > > into here...
> > > 
> > > 
> > > 
> > >  > align="center">> 
> > >  ICAO Tasks — 
> > WAFS>   
> > >  
> > > 
> > >  Menu
> > >   <--The menu above 
> > inserted here.
> > > 
> > >  
> > >  
> > > 
> > > 
> > > How can I tell the system not to load the last two lines unless 
> > they are a System Admin or SME?
> > > 
> > > I read a chapter on Cookies/Sessions...but it wasn't that helpful 
> > for this case.
> > > 
> > > Can I setcookie('user_group', '3') and use that somehow???
> > > 
> > > Am I in the ballpark with this solution?
> > > 
> > > Thanks.
> > > 
> > > Jeff
> > 
> > -- 
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> > 
> 
> Este mensaje es exclusivamente para el uso de la persona o entidad a quien 
> esta dirigido; contiene informacion estrictamente confidencial y legalmente 
> protegida, cuya divulgacion es sancionada por la ley. Si el lector de este 
> mensaje no es a quien esta dirigido, ni se trata del emplead

Re: [PHP-DB] short text strings with apostrophes and forms

2006-04-20 Thread Luis Morales
Jeffry,

I suggest use htmlentities/html_entity_decode functions. For example to
update the db with values use:

$myCol = htmlentities($mycol_value);

Ej: query

$query = "update my_table set myCol='{$myCol}' where id = 'id_val'";

Now when your application restore the data from the db you can use:

$mycol_value = html_entity_decode ($myCol);


$mycol_value: is the value from html form
$myCol: is the name of your colum's table to update in your query.

Good luck,

Regards,

Luis Morales 


On Thu, 2006-04-20 at 17:56 +0200, Jeffrey wrote:
> I have an application which calls up some data from a MySQL table and 
> puts it into a web form for users to modify.
> 
> One of the cells holds a text string which is put into a text input 
> field. However, if that text string includes an apostrophe, all text 
> after the apostrophe disappears.
> 
> For example, if the test string from a database cell reads...
> 
> Fix the managers' cars by Tuesday
> 
> and that is saved in the variable $some_text, which is called up in a 
> form...
> 
> 
> 
> The text field on the web page will only contain...
> 
> Fix the managers
> 
> How can I get the text field to show the entire string?
> 
> Many thanks,
> 
> Jeffrey
> 
-- 
-
Luis Morales 
Consultor de Tecnologia
Cel: +(58)416-4242091
-
"Empieza por hacer lo necesario, luego lo que es posible... y de pronto
estarás haciendo lo imposible"
-

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