[PHP-DB] Creating Links in data output

2003-10-17 Thread Tonya
Hi :)  I am new to PHP and new to this mailing list, so I hope I am not asking 
something that you tire of answering :)

I am creating my first news posting application and I need a function to convert any 
URLS added to the news message into links.  I found this snippet:

function insert_links($newstext) {
$ret = eregi_replace( "([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])", 
"\\1://\\2\\3", $newstext);

$ret = eregi_replace( "(([a-z0-9_]|\-|\.)+@([^[:space:]]*)([[:alnum:]-]))", "\\1", 
$ret);

return($ret);
}

I have added this snippet to my file, but it does not work -  The string $newstext 
still does not include links.  I have tried to echo $ret, which returns nothing, and 
echo $newstext, which returns my text message, but without links.

Does anyone have any other snippets that might work for this?  Please be very 'layman' 
in your response - I have only been working with PHP for a couple of weeks and this is 
my first language to learn (other than HTML).

Thanks in advance!!

Summer


[PHP-DB] sybase and php

2003-10-17 Thread Pedro A. Rodriguez Nurse

Hi, a need a problem.

When I try to connect a my DB Sybase from PHP, I have this error.:

Warning: sybase_connect(): Sybase: Server message: Changed database context to 
'INTERNACIONAL_CDR'. (severity 10, procedure N/A) in 
E:\WWWRoot\internacionalonline\adodb\adodb-sybase.inc.php on line 86


What happened here? .. I have Win2000 Server ...

I hope you can help me.

Thanks,

Pedro

Re: [PHP-DB] Re: [PHP] $_POST in MySQL query issue...

2003-10-17 Thread Jon Kriek
Since this was posted in php.general and php.db, I only ended up correcting
myself to the orginal poster and to php.general.

$table= 'elements';
$Name = mysql_escape_string($_POST['elementName']);
$sql = "INSERT INTO $table SET Name= '$Name'";

>> waste of variable space, and makes what you are doing less readable

I disagree, but that is ok, that is allowed =)

-- 
Jon Kriek
http://phpfreaks.com

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



[PHP-DB] disable History

2003-10-17 Thread open-mind
How can I "disable" the use of History(Temporary Internet Files) in a page ? (and 
don't tell me: it's easy: Tools->internet options->settings ...;-) ... from script 
(htm ?, js ?, php ?) I want to do this ..)

PS: I have a script witch generate jpegs (cuts from a larger one) and sometimes in 
browser I see older pictures ...
If I go to: Tools->internet options->settings-> chk for new versions every visit to 
the page   everything works just fine

[PHP-DB] faster imagecreatefromjpeg

2003-10-17 Thread Georgescu Vlad
i need to replace the using of "imagecreatefromjpeg($jpgpath)" with
something more faster

PS: the image to load has: 198 MB (208,603,887 bytes)


---
Xnet scaneaza automat toate mesajele impotriva virusilor folosind RAV AntiVirus.
Xnet automatically scans all messages for viruses using RAV AntiVirus.

Nota: RAV AntiVirus poate sa nu detecteze toti virusii noi sau toate variantele lor.
Va rugam sa luati in considerare ca exista un risc de fiecare data cand deschideti
fisiere atasate si ca MobiFon nu este responsabila pentru nici un prejudiciu cauzat
de virusi.

Disclaimer: RAV AntiVirus may not be able to detect all new viruses and variants.
Please be aware that there is a risk involved whenever opening e-mail attachments
to your computer and that MobiFon is not responsible for any damages caused by
viruses.

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



[PHP-DB] Re: faster imagecreatefromjpeg

2003-10-17 Thread open-mind
 i need to replace the using of "imagecreatefromjpeg($jpgpath)" with
something more faster

PS: the image to load has: 198 MB (208,603,887 bytes)

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



[PHP-DB] disable History

2003-10-17 Thread open-mind
How can I "disable" the use of History(Temporary Internet Files) in a page ? (and 
don't tell me: it's easy: Tools->internet options->settings ...;-) ... from script 
(htm ?, js ?, php ?) I want to do this ..)

PS: I have a script witch generate jpegs (cuts from a larger one) and sometimes in 
browser I see older pictures ...
If I go to: Tools->internet options->settings-> chk for new versions every visit to 
the page   everything works just fine


Re: [PHP-DB] faster imagecreatefromjpeg

2003-10-17 Thread mike karthauser
on 17/10/03 3:57 pm, Georgescu Vlad at [EMAIL PROTECTED] wrote:

> i need to replace the using of "imagecreatefromjpeg($jpgpath)" with
> something more faster
> 
> PS: the image to load has: 198 MB (208,603,887 bytes)


Why not resize the image using photoshop first? Any app resizing 200Mb
images are going to take ages.
-- 
Mike Karthauser 
Managing Director - Brightstorm Ltd

Email   >> [EMAIL PROTECTED]
Web >> http://www.brightstorm.co.uk
Tel >> 0117 9426653 (office)
   07939 252144 (mobile)

Snailmail   >> Unit 8, 14 King Square,
   Bristol BS2 8JJ

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



[PHP-DB] ODBTP - ODBC - FOXPRO.

2003-10-17 Thread Ricardo C. Fernandez de C.
Hi all, 

After reading your emails I installed ODBTP so I could access my ODBC
server from my linux box, but i'm still getting some errors, this is my
code:



(the first IP is the IP of my ODBTP/ODBC server).

And this is the Error i get:
(part is in spanish, i'm sorry for it)

Warning: [S1000][1][Microsoft][ODBC Visual FoxPro Driver]Fox Error 1
[IM006][0][Microsoft][Administrador de controladores ODBC] Error de
SQLSetConnectAttr del controlador in
/var/www/telefonia/registro/prueba_odbtp.php on line 2

(It says something like Error of SQLSetConnectAttr of the device in
/var/www/telefonia/registro/prueba_odbtp.php on line 2)

Any idea how to fix this? 

Thanks for the help,

-- 
Ricardo C. Fernández de C.
Fundabit - Min. de Educación, Cultura y Deporte.
Caracas/Venezuela

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



Re: [PHP-DB] faster imagecreatefromjpeg

2003-10-17 Thread Georgescu Vlad
The image is a satellite picture (width="11448" height="16624"). Resizing is
not on option.
I want to make a site in witch the user can "pan" (navigate) this image.
I don't want to resize. I want to cut the picture. I hope this will take
less time/resources.

Any ideas ?

- Original Message -
From: "mike karthauser" <[EMAIL PROTECTED]>
To: "Georgescu Vlad" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, October 17, 2003 6:18 PM
Subject: Re: [PHP-DB] faster imagecreatefromjpeg


> on 17/10/03 3:57 pm, Georgescu Vlad at [EMAIL PROTECTED] wrote:
>
> > i need to replace the using of "imagecreatefromjpeg($jpgpath)" with
> > something more faster
> >
> > PS: the image to load has: 198 MB (208,603,887 bytes)
>
>
> Why not resize the image using photoshop first? Any app resizing 200Mb
> images are going to take ages.
> --
> Mike Karthauser
> Managing Director - Brightstorm Ltd
>
> Email   >> [EMAIL PROTECTED]
> Web >> http://www.brightstorm.co.uk
> Tel >> 0117 9426653 (office)
>07939 252144 (mobile)
>
> Snailmail   >> Unit 8, 14 King Square,
>Bristol BS2 8JJ
>
>
> ---
> Xnet scaneaza automat toate mesajele impotriva virusilor folosind RAV
AntiVirus.
> Xnet automatically scans all messages for viruses using RAV AntiVirus.
>
> Nota: RAV AntiVirus poate sa nu detecteze toti virusii noi sau toate
variantele lor.
> Va rugam sa luati in considerare ca exista un risc de fiecare data cand
deschideti
> fisiere atasate si ca MobiFon nu este responsabila pentru nici un
prejudiciu cauzat
> de virusi.
>
> Disclaimer: RAV AntiVirus may not be able to detect all new viruses and
variants.
> Please be aware that there is a risk involved whenever opening e-mail
attachments
> to your computer and that MobiFon is not responsible for any damages
caused by
> viruses.
>


---
Xnet scaneaza automat toate mesajele impotriva virusilor folosind RAV AntiVirus.
Xnet automatically scans all messages for viruses using RAV AntiVirus.

Nota: RAV AntiVirus poate sa nu detecteze toti virusii noi sau toate variantele lor.
Va rugam sa luati in considerare ca exista un risc de fiecare data cand deschideti
fisiere atasate si ca MobiFon nu este responsabila pentru nici un prejudiciu cauzat
de virusi.

Disclaimer: RAV AntiVirus may not be able to detect all new viruses and variants.
Please be aware that there is a risk involved whenever opening e-mail attachments
to your computer and that MobiFon is not responsible for any damages caused by
viruses.

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



RE: [PHP-DB] faster imagecreatefromjpeg

2003-10-17 Thread Griffiths, Daniel
you said it yourself, cut the image up into lots of parts first in photoshop or 
whatever, keep at track of the grid refs that go with which bit of the image and only 
show the part or parts of the image that you need at anyone time.

-Original Message-
From: Georgescu Vlad [mailto:[EMAIL PROTECTED]
Sent: 17 October 2003 16:50
To: [EMAIL PROTECTED]; mike karthauser
Subject: Re: [PHP-DB] faster imagecreatefromjpeg


The image is a satellite picture (width="11448" height="16624"). Resizing is
not on option.
I want to make a site in witch the user can "pan" (navigate) this image.
I don't want to resize. I want to cut the picture. I hope this will take
less time/resources.

Any ideas ?

- Original Message -
From: "mike karthauser" <[EMAIL PROTECTED]>
To: "Georgescu Vlad" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, October 17, 2003 6:18 PM
Subject: Re: [PHP-DB] faster imagecreatefromjpeg


> on 17/10/03 3:57 pm, Georgescu Vlad at [EMAIL PROTECTED] wrote:
>
> > i need to replace the using of "imagecreatefromjpeg($jpgpath)" with
> > something more faster
> >
> > PS: the image to load has: 198 MB (208,603,887 bytes)
>
>
> Why not resize the image using photoshop first? Any app resizing 200Mb
> images are going to take ages.
> --
> Mike Karthauser
> Managing Director - Brightstorm Ltd
>
> Email   >> [EMAIL PROTECTED]
> Web >> http://www.brightstorm.co.uk
> Tel >> 0117 9426653 (office)
>07939 252144 (mobile)
>
> Snailmail   >> Unit 8, 14 King Square,
>Bristol BS2 8JJ
>
>
> ---
> Xnet scaneaza automat toate mesajele impotriva virusilor folosind RAV
AntiVirus.
> Xnet automatically scans all messages for viruses using RAV AntiVirus.
>
> Nota: RAV AntiVirus poate sa nu detecteze toti virusii noi sau toate
variantele lor.
> Va rugam sa luati in considerare ca exista un risc de fiecare data cand
deschideti
> fisiere atasate si ca MobiFon nu este responsabila pentru nici un
prejudiciu cauzat
> de virusi.
>
> Disclaimer: RAV AntiVirus may not be able to detect all new viruses and
variants.
> Please be aware that there is a risk involved whenever opening e-mail
attachments
> to your computer and that MobiFon is not responsible for any damages
caused by
> viruses.
>



---

Xnet scaneaza automat toate mesajele impotriva virusilor folosind RAV AntiVirus.

Xnet automatically scans all messages for viruses using RAV AntiVirus.



Nota: RAV AntiVirus poate sa nu detecteze toti virusii noi sau toate variantele lor.

Va rugam sa luati in considerare ca exista un risc de fiecare data cand deschideti

fisiere atasate si ca MobiFon nu este responsabila pentru nici un prejudiciu cauzat

de virusi.



Disclaimer: RAV AntiVirus may not be able to detect all new viruses and variants.

Please be aware that there is a risk involved whenever opening e-mail attachments

to your computer and that MobiFon is not responsible for any damages caused by

viruses.


-- 
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: Acces Microsoft access database in shared mode

2003-10-17 Thread Marco Montesines
Hi Jeroen,

If you're going to update the file...the database will be locked...
but if your just going to view it...it should be fine

"Jeroen Verhoeven" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I try to acces an access database from a PHP script runnig on an NT
machine
> with php 4 and IIS.
>
> When the database is opent by an other program, i can't acces the
> database.from PHP.
> I think it has to do with the mode.
> Can someone help me with some information on opening an access database in
> shared mode.
>
> Best regards.
> Jeroen Verhoeven

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



[PHP-DB] Re: disable History

2003-10-17 Thread Gabriel Peugnet
Check the Header() function in the manual:

// Tels to the browser the page has caducated and forces to reload..
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

// Avoids cahce. It seams it's what you want.
header("Cache-Control: no-cache, must-revalidate");

Gabriel.


"Open-Mind" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
How can I "disable" the use of History(Temporary Internet Files) in a page ?
(and don't tell me: it's easy: Tools->internet options->settings ...;-) ...
from script (htm ?, js ?, php ?) I want to do this ..)

PS: I have a script witch generate jpegs (cuts from a larger one) and
sometimes in browser I see older pictures ...
If I go to: Tools->internet options->settings-> chk for new versions every
visit to the page   everything works just fine

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



[PHP-DB] ORA-01704: string literal too long AND PHP/PEAR

2003-10-17 Thread Roger Spears
 Ok all of you Oracle experts out there, I've had one heck of a day 
wrestling with this oracle stuff.  My experience with Oracle is turning 
into a greek tragedy.

I'm using PHP/PEAR to execute my queries on an oracle table. I'm trying 
to store very long pieces of text into a CLOB field. Currently I'm 
getting a string too long error.

I've googled to find that there are certain limits when inserting into a 
table. The CLOB datafield may hold 4 gigs of text, but you may only 
insert 4000 bytes at a time. Or at least that's how I understand it.

Anyone got a work around for this?

I've tried:
OCIBindByName($sql,":fieldName",&$myVariable, -1);
But I'm not sure I'm using it correctly with PEAR.  In my code, I have 
my sql statement, then I do the OCIBindByName() call, then I do my insert. 

But, this gets me:
ocibindbyname(): supplied argument is not a valid OCI8-Statement resource
Which is an actual PHP/PEAR errorI think...

Anyone out there have any work around suggestions? I really dont want to 
parse the insert statement into pieces each being less then 4000 bytes.

Thanks,
R


[PHP-DB] What is this Mealer Deamon message?

2003-10-17 Thread Roger Spears
I sent a post earlier..and got this in reply...

Hi. This is the qmail-send program at pb1.pair.com.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.
<[EMAIL PROTECTED]>:
This message is looping: it already has my Delivered-To line. (#5.4.6)
WTF is this?  WTF does it mean? 

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


[PHP-DB] Best way to show multiple pages reports from database

2003-10-17 Thread Dejan Milenkovic
I'm not fammiliar with internal MySQL architecture and exactly how things
work but I was wondering what is the most effcient way of spliting reports
over multiple pages. Is there a preformance difference between these two
codes, specialy if there are some complex conditions and joins that should
be done to get result.

$page=1; // this is set via GET or POST
$items_per_page=10;
$sql="SELECT COUNT(*) FROM table";
$result=mysql_query($sql)
$number_of_items=mysql_numrows($result);
$start=($page-1)*$items_per_page;
$sql="SELECT * FROM table LIMIT $start, $items_per_page";
$result=mysql_query($sql)
while ($row=mysql_fetch_assoc($result)) {
 // here goes output
}

$page=1; // this is set via GET or POST
$items_per_page=10;
$sql="SELECT * FROM table";
$result=mysql_query($sql)
$number_of_items=mysql_numrows($result);
$start=($page-1)*$items_per_page;
mysql_data_seek($result, $start);
for ($i=0; $i<$items_per_page; $i++) {
 $row=mysql_fetch_assoc($result)
 // here goes output
}

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



Re: [PHP-DB] ODBTP - ODBC - FOXPRO.

2003-10-17 Thread Robert Twitty
Setting SourceDB=c:\telefonia\; instead of
SourceDB="c:\telefonia\CDTCTL01.DBF"; solved the problem.

-- bob

> Warning: [S1000][1][Microsoft][ODBC Visual FoxPro Driver]Fox Error 1
> [IM006][0][Microsoft][Administrador de controladores ODBC] Error de
> SQLSetConnectAttr del controlador in
> /var/www/telefonia/registro/prueba_odbtp.php on line 2
>
>  $link = odbtp_connect('172.16.4.106','Driver={Microsoft Visual FoxPro
> Driver};SourceDB="c:\telefonia\CDTCTL01.DBF";SourceType=DBF');
> ?>
>
> thanks for the help, and thanks for the program is a great software, i
> hope i can make it work with FoxPro :)
>
> c'ya!

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



[PHP-DB] MySQL Query not working via PHP

2003-10-17 Thread Sean Smitz
I have a query that works in MySQL but when I try to execute it in PHP I
encounter the following error:

//Generated by the script
Couldn't execute query!

// Generated by MySQL
MySQL reports: You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use near
'FROM cadet, cadet_phone WHERE cadet.ssn = cadet_phone.ssn AND (

//Query outputted by the script
Query was: SELECT cadet.rank, cadet.lname, cadet.fname, cadet.mname,
cadet.address1, cadet.address2, cadet.city, cadet.state, cadet.zipcode,
cadet.email, cadet.guardian1, cadet.relation1, cadet.guardian2,
cadet.realtion2, cadet.photo, FROM cadet, cadet_phone WHERE cadet.ssn =
cadet_phone.ssn AND (cadet.lname = "Smith" AND cadet.fname = "John" AND
cadet.mname = "Doe")

Attached is the entire page. Any help is appreciated.

Sean Smitz


begin 666 test0.1.php
M/#]P:' -"B @:68H([EMAIL PROTECTED]&),:6YK(#T@;7ES<6Q?8V]N;F5C="@B;&]C86QH
M;W-T(BP@(FAT='!D(BP@(B(I*2D-"B @>PT*(" @('!R:6YT*")&86EL960@
M=&[EMAIL PROTECTED];F5C="!T;R!D871A8F%S92$\8G(^7&XB*3L-"B @("!P&ET*"D[#0H@('T-"B @#0H@("11=65R>2 ]
M(")314Q%0U0@(B N#0H@(" @(F-A9&5T+G)A;FLL(&-A9&5T+FQN86UE+"!C
M861E="YF;[EMAIL PROTECTED];6YA;64L("(@[EMAIL PROTECTED](" @(")C861E="YA9&1R
M97-S,[EMAIL PROTECTED]3PO8CX\+W1D/EQN(BD[#0H@(" @<')I;G0H(CQT
M9"!B9V-O;&]R/5PB(V-C8V-C8UPB/CQB/E-T871E/"]B/CPO=&0^7&XB*3L-
M"B @("!P7!E
M/"]B/CPO=&0^7&XB*3L-"B @("!P7-Q;%]F971C:%]AR1D8E)O=ULG9FYA;64G77T\+W1D/EQN(BD[#0H@
M(" @("!PR1D8E)O=ULG861DR1D8E)O=ULG9W5AR1D8E)O=ULGR1D8E)O=ULG<&AO;F5?;G5M)UU]/"]T9#Y<;B(I.PT*(" @(" @
M<')I;G0H(CQT9#Y[)&1B4F]W6R=T>7!E)UU]/"]T9#Y<;B(I.PT*(" @(" @
M<')I;G0H(CQT9#Y[)&1B4F]W6R=C;VYT86-T)UU]/"]T9#Y<;B(I.PT*(" @
M('!R:6YT*"(\+W1R/EQN(BD[#0H@('T-"@T*("!Phttp://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] MySQL Query not working via PHP

2003-10-17 Thread Matthew Moldvan, Jr.
I would say try single quotes instead of double quotes ... let me know if
that works ...

Regards,
Matt.

- Original Message - 
From: "Sean Smitz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 17, 2003 4:32 PM
Subject: [PHP-DB] MySQL Query not working via PHP


> I have a query that works in MySQL but when I try to execute it in PHP I
> encounter the following error:
>
> //Generated by the script
> Couldn't execute query!
>
> // Generated by MySQL
> MySQL reports: You have an error in your SQL syntax. Check the manual that
> corresponds to your MySQL server version for the right syntax to use near
> 'FROM cadet, cadet_phone WHERE cadet.ssn = cadet_phone.ssn AND (
>
> //Query outputted by the script
> Query was: SELECT cadet.rank, cadet.lname, cadet.fname, cadet.mname,
> cadet.address1, cadet.address2, cadet.city, cadet.state, cadet.zipcode,
> cadet.email, cadet.guardian1, cadet.relation1, cadet.guardian2,
> cadet.realtion2, cadet.photo, FROM cadet, cadet_phone WHERE cadet.ssn =
> cadet_phone.ssn AND (cadet.lname = "Smith" AND cadet.fname = "John" AND
> cadet.mname = "Doe")
>
> Attached is the entire page. Any help is appreciated.
>
> Sean Smitz
>
>
>
> -- 
> 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] Multiple forms and multiple submissions

2003-10-17 Thread Tonya
PHP 4.3.3 and MYSQL:

I am using a multipage member registration system because all of the information is 
too long to put on one page.  Some example code edited for brevity:

Form regone with hidden field value "personal"
Form regtwo with hidden field value "computer"
Form regthree with hidden field value "habits"
Form regfour with hidden field value "comms"
Form regfive with hidden field value "misc"

switch ($hidden)
{
case "personal":
-Check for existing users with same login name and require new login name if 
applicable
-Check that all required fields are filled and return to form if not
-Check eregs of all fields and format variables
 session_register('varone','vartwo','varthree',...);
 include ("includes/regtwo.inc");
 break;
case "computer":
-Check eregs of all fields and format variables 
 session_register('varone','vartwo','varthree',...);
 include ("includes/regthree.inc");
 break;
 case "habits":
  -Check eregs of all fields and format variables 
 session_register('varone','vartwo','varthree',...);
 include ("includes/regfour.inc");
 break;
case "comms":
  -Check eregs of all fields and format variables 
 session_register('varone','vartwo','varthree',...);
 include ("includes/regfive.inc");
 break;
 case "misc":
-Check eregs of all fields and format variables 
// Prevent Double Submission upon refresh
  $checksub=mysql_query("Select * FROM mempersonal WHERE uniquevar='$uniquevar'");
  $rowcheck=mysql_num_rows($checksub);
   if ($rowcheck>0){
   $message="You are already entered into the member database.  You cannot refresh 
this page.";
   include('includes/message.inc');
   }else{
// Insert info into mempersonal  
$addtosql1="INSERT INTO mempersonal (varone,vartwo,varthree...) VALUES 
('$varone','$vartwo','$varthree',...)
  $final1=mysql_query($addtosql1);
// Insert info into memcomputer
  $addtosql2="INSERT INTO memcomputer (varone,vartwo,varthree...) VALUES 
('$varone','$vartwo','$varthree',...)
  $final2=mysql_query($addtosql2);
// Insert info into memhabits
  $addtosql3="INSERT INTO memhabits (varone,vartwo,varthree...) VALUES 
('$varone','$vartwo','$varthree',...)
   $final3=mysql_query($addtosql3);
// Insert info into memcomms
  $addtosql4="INSERT INTO memcomms (varone,vartwo,varthree...) VALUES 
('$varone','$vartwo','$varthree',...)
  $final4=mysql_query($addtosql4);
// Insert info into memmisc
  $addtosql5="INSERT INTO memmisc (varone,vartwo,varthree...) VALUES 
('$varone','$vartwo','$varthree',...)
  $final5=mysql_query($addtosql5);
  
$message="Hello $memberhandle! Your Registration is complete and an activation email 
has been sent to you.  Please
  follow the instructions to activate your account. ";
include('includes/message.inc');
session_unset();
session_destroy();
  break;
 }

Now, all of this works just dandy, inserts all the information to my database and 
returns the 'Registration Complete' message.  However, the code I added to prevent 
double submission:

// Prevent Double Submission upon refresh
  $checksub=mysql_query("Select * FROM mempersonal WHERE uniquevar='$uniquevar'");
  $rowcheck=mysql_num_rows($checksub);
   if ($rowcheck>0){
   $message="You are already entered into the member database.  You cannot refresh 
this page.";
   include('includes/message.inc');
   }else{
   Add Everything to database
   }
will allow the user to refresh and add a new row to the database ONCE - but only 
submitting variables from the LAST form to the LAST table (memmisc).  The other tables 
from the previous forms are empty.  Then, if the user tries to refresh AGAIN, the 'You 
are already entered' message appears.  
 
Any ideas on how I can fix this??
 
BTW, my coding is rudimentary - I have only been coding two weeks :)
 
Tonya
  


[PHP-DB] RE: [PHP-WIN] Re: $_POST in MySQL query issue...

2003-10-17 Thread Socheat
Dear all ,

Could anyone help me to use crypt() function on window system ? , I want
to use all libraries that currently not support  in PHP like crypt(), but I
want to use it.How could i make it work?



-Original Message-
From: Lang Sharpe [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 16, 2003 6:45 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: [PHP-WIN] Re: $_POST in MySQL query issue...


> $sql="insert into $table set Name = '$_POST["elementName"]'";

The problem with this is that you need to use curly braces around the
variable being substituted in the string. Also use single quotes around the
array index.

$sql="insert into $table set Name = '{$_POST['elementName']}'";

See the manual.. (Variable parsing section)
http://php.net/manual/en/language.types.string.php

Lang

Adam Reiswig wrote:

> Greetings to all.  I am trying for the life of me to place a $_POST[]
> variable in my MySQL query.  I am running the latest stable versions of
> PHP, MySQL and Apache 2 on my Win2kPro machine.  My register_globals are
> set to off in my php.ini.  My code I am attempting create is basically
> as follows:
>
> $table="elements";
> $sql="insert into $table set Name = '$elementName'";
>
> This works with register_globals set to on.  But, I want to be able to
> turn that off.  My code then, I am guessing, be something as follows:
>
> $table="elements";
> $sql="insert into $table set Name = '$_POST["elementName"]'";
>
> Unfortunately this and every other combination I can think of,
> combinations of quotes that is, does not work.  I believe the source of
> the problem is the quotes within quotes within quotes. I also tried:
>
> $sql='insert into $table set Name = '.$_POST["elementName"];
>or
> $sql="insert into $table set Name = ".$_POST['elementName'];
>
> and several other variations.
>
> Can anyone give me some pointers to inserting $_POST[] statements inside
> of query statements?  I am sure there must be a way but I have spent a
> lot of time on this and am really stumped here.  Thanks for any help.
>
> -Adam Reiswig
>
> PS if anything here is not clear to you, please let me know and I'll
> clarify as I can.  Thanks again.

--
PHP Windows 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