one simple way would be to make a duplicate, empty table and then do:
insert into newtable select distinct * from oldtable
then try adding a uniqueness constraint if you don't want duplicates in the
future
jason
> Hi,
> Is there a way to go through a table and remove all duplicate entries s
Go to http://www.mysql.com
You'll see a 'Search' field near the top left. Type the string:
Lost connection to MySQL
..into it. It brings up about 50 results
Also, load up
http://www.mysql.com/documentation/mysql/bychapter/manual_Problems.html#Prob
lems
jason
>
> > Any help appreciated - othe
I take advantage of a handy feature of apache that allows log data to be
piped to another program instead of written to a file - and pipe it's log
data directly to stdin of a small C program which does a tiny bit of parsing
before putting it into mysql.
Before I did it in C, I was just using a Ph
Is anyone else having trouble in 4.0.4 and 4.0.4pl1 with readfile when the
argument is a http request to a script that sends a location header?
eg:
server1 - test.php
http://server2/location.php"); ?>
server2 - location.php
http://some.other.url); ?>
Both Php 4.0.4 and 4.0.4pl1 return:
Warn
The thing that usually intrigues me is why people design their application
so that it needs to redirect to another page just so that they can attempt
to read the cookie back. Do they not already have the value of the cookie in
order to be able to set it? Why attempt to read it back straight away?
Any reason you don't include the contents of /index.htm into
/ministe1/index.htm with the appropriate welcome message instead of
redirecting, or even pass the site name in the query string of the Location:
URL if you're not wanting to rely on http_referer?
jason
> In this case, the value of the
See the mysql manual - there's a section that deals with date/time functions
already built into mysq that work perfectly with timestamps
http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#Fun
ctions
jason
- Original Message -
From: "Dallas Kropka" <[EMAIL PROTECTED
to change at all? The only thing that
would change is the content of the include()'d file that /index.htm, and the
minisite/index.htm include.
/index.htm
main_include.inc:
/minisite45/index.htm
- Original Message -
From: "Richard S. Crawford" <[
The online manual has some working examples
Also, using the socket funcs in Php isn't very different from using them in
C - try searching www.google.com if the examples in the manual aren't enough
jason
- Original Message -
From: "Boget, Chris" <[EMAIL PROTECTED]>
To: "Php (E-mail)" <[
> I have to ask, though, why would you want to run it as a cgi?
>
> Its slower as cgi and runs more security risks.
> I'd only run it as a cgi if that was my only choice.
It's probably less of a security risk when utilised via the cgi actually, at
least when using Apache as the webserver because
http://www.php.net/manual/en/function.extension-loaded.php
jason
- Original Message -
From: "Eric Peters" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 01, 2001 10:29 AM
Subject: [PHP] checking for a defined function
> how can I do something like
>
> if(!defined(cyb
Hi Tyler - did you check the date functions in the manual?
date() with the 'n' format let's you grab the month's ordinal from a unix
timestamp, and mktime() let's you easily create unix timestamps
$next_mon = date("n", mktime(0,0,0,date("m")+1));
jason
> Hello,
>
> How do I get the number of
Or install the cgi version and use it in conjunction with suExec alongside
the module version.
jason
- Original Message -
From: "Jon Snell" <[EMAIL PROTECTED]>
To: "php general" <[EMAIL PROTECTED]>
Sent: Thursday, March 08, 2001 9:44 AM
Subject: RE: [PHP] exec as another user
> It wou
Yes - see the network functions in the Php manual.
If you don't already know the protocol commands for the mail retrieval
protocol you want to use, see the relevant rfc.
jason
- Original Message -
From: "Filip Olsson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 12, 20
What request method is it then? I only know of HEAD and PUT other than GET
and POST
make a script that receives their request, and write
getenv("REQUEST_METHOD") to a file and look
I don't think socket functions will help you read it anyway, unless you
replace your httpd with an ever-running, lis
echo ++$x;
http://www.php.net/manual/en/language.operators.increment.php
> > Is there a php equivalent for the use of ` (I think) in Unix/Perl? So
for example echo "`$x++`" would first evaluate $x++ and then print the
resulting value.
> >
> > Euan Greig
> > Technical Consultant
> > BRANN DATA
http://www.php.net/manual/en/function.ip2long.php
> No! I can encode IP address to an Integer:
> 192.168.0.1 consider as: a.b.c.d
> and now the formula goes:
> a shl 24 + b shl 16 + c shl 8 + d
>
> but i was looking for something ready made
>
> -elias
> http://www.kameelah.org/eassoft
header("Location: http://your.dom/file");
- Original Message -
From: "Kishore" <[EMAIL PROTECTED]>
To: "phpgeneral" <[EMAIL PROTECTED]>
Sent: Saturday, April 21, 2001 11:28 PM
Subject: [PHP] redirection
> How to redirect to another page in php. Is there any inbuilt function
> availabl
> Hello everyone!
>
> I am trying to pass a variable in a url and can't seem to do it. The
problem is, the url is already being determined by a php "if" statement.
So, when I get to the part where I try to append the url I get parse errors.
What I would ideally like to do is generate the url usin
> I am using a form to test posting a variable. If my variable looks like this
> in script post_var.php3 :
>
> "stringinaaform"
>
> then it comes out like this in recieve.php3 :
>
> \"stringinaaform\"
>
> why? thanks in advance.
Did you check the manual? http://www.php.net/manual/en/configur
> I suppose when you have so few problems you get to nitpick..
>
> Guess my question is; why doesn't this work?
>
> if(sprintf("%01.2f",$Result[CurrentPrice]+$Result[Increment]) <=
sprintf("%01.2f",$BidAmt)) {
>
> when this works;
> if(0.30 <= 1.00) {
>
> I'll just settle with a workaround for now
> Thanks to everyone for the help - unfortunately my problem seems to be the
> function I'm using to do the redirecting. header() is supposed to be the
> first item passed. What I'm trying to do is use a line of code well down
> into the logic of my script to redirect the user to another page al
Why don't you just use the -b switch and do it in one hit?
- Original Message -
From: "YoBro" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 12, 2001 3:32 PM
Subject: [PHP] Simulate the Enter key in Unix with PHP
> Hello,
>
> I have been trying to get PHP to execute
> but sometimes I want something like this:
> session_start(); // for instance
> code code code
> if(something)
> print error message and terminate script;
> ?>
>
> sadasdsa
>
>
> what do I do in this case??? I've tried all kinds of programing
> techn
> the problem is, if I terminate the script on that condition the footer
> won't be displayed...
Instant fix - include "footer.inc"; exit;
Better fix: decide your logical layout before you proceed and arrange if/else
blocks accordingly so you don't need to terminate the script to avoid showing a
> $SERVER_NAME only gives me foober.com (since that is the servername), but not
> the alias someone typed in to get there ...
>
> --Joe
Give HTTP_HOST a go
Check here for more
http://www.php.net/manual/en/language.variables.predefined.php or use phpinfo()
to see exactly what you have available
j
foreach($GLOBALS as $key=>$val)
echo "$key=$val\n";
see the list() and each() functions in the manual for php3
- Original Message -
From: "Joseph Blythe" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 15, 2001 1:48 PM
Subject: [PHP] finding a variables name
> Hey
$variable = "http://";. $HTTP_HOST. $REQUEST_URI;
> Is there a way of capturing the entire url contianed in the location bar
> within a variable?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
In your web browser like you would any other web interface on your machine
jason
- Original Message -
From: "Chip" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, October 28, 2001 4:39 PM
Subject: [PHP] phpmyadmin is installed, now how to access it?
> I just installed the Fre
Or the single quotes around the table name in the sql string
> Your query is probably broken - do some error checking after your
> database call with mysql_error() and see what the problem is.
>
> Guess; the table name.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-
John, Jason didn't literally mean for you to search for the exact string
'' - he was telling you to look through the various types of
tags found in your httpd.conf file, such as
, etc etc
> There is no element in the httpd.conf. Is that where I should be
> looking?
> Warwick
>
>
> Jason Murra
Which addresses won't work?
- Original Message -
From: "Matthew Luchak" <[EMAIL PROTECTED]>
To: "Php-General (E-mail)" <[EMAIL PROTECTED]>
Sent: Thursday, November 01, 2001 2:04 AM
Subject: [PHP] defending PHP mail function
Recently I have had to defend the use of PHP in light of a n
> Really? No good at all, huh? I would think that would answer the
question
> right there if it was an SMTP problem or a problem that lies elsewhere.
If
> you take SMTP out of the equation, and the problem still occurs, then you
> know that's not the issue. If the problem does go away, then you
maybe in an associative array
jason
- Original Message -
From: "Daniel Harik" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, November 04, 2001 4:53 AM
Subject: [PHP] Passing many valaues to function
> Hello
>
> I need to pass about 15 values to function, what would be b
http://your.domain/path/to/file.html";); ?>
- Original Message -
From: "Martin Towell" <[EMAIL PROTECTED]>
To: "'Cam'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, December 07, 2001 3:23 PM
Subject: RE: [PHP] Redirect Function?!!
> how about include'ing the target page then e
Use fsockopen to send the data:
$host = "your.host";
$port = 80;
$postdata = "field1=value1&field2=value2&field3=value3";
if ($sp = fsockopen($host, $port)) {
fputs($sp,"POST /path/to/script.php HTTP/1.0\n");
fputs($sp,"Host: $host\n");
fputs($sp,"Content-type: application/x-www-form-urlen
> I was just doing this a while back and ran into problems when going to
443.
> Any ideas on that? A regular fsockopen failed because of the security
> needed.
>
> -Bob
Probably because you weren't following the SSL protocol
You'll find the curl functions useful for SSL posting - or even non SSL
Yes
> Hi all,
>
> Has anyone had any experience in using the QSI payments software with
> PHP4?
>
> Mark
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-
Yes - see the network and/or socket functions sections in the manual at
http://www.php.net
You might want to use the IRC RFC as a reference on the protocol
jason
> Hello PHP,
>
> Is there any ways to use php with irc?
>
> --
> Best regards,
--
PHP General Mailing List (http://www.php.ne
$fp = fopen("php://stdin", "r");
echo fgets($fp, 64);
fclose($fp);
- Original Message -
From: "enthalpy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 09, 2001 1:10 PM
Subject: [PHP] Asking for input from shell?
>
> anyone have sample code of how you can have a php
> > I want to use PHP4 sessions for authentication,
>
> Ok, stop right there. Sessions and authentication have nothing to do with
> each other. To create a secure authenticated site you should be using
> HTTP-based authentication over SSL. Sessions are simply for maintaining
> state across http
> I've done further investigation and it seems that if I go with the
approach
> of looking for a REMOTE_USER value, I'll have to do the following:
>
> Since Apache only fills out the REMOTE_USER if the file is in a protected
> directory, I have to make a symbolic link within a protected directory
I was under the impression it couldn't be done because it would require your
code control the end-user's web browser, no matter what the brand.
Can you please show us these sites?
- Original Message -
From: "Steve Haemelinck" <[EMAIL PROTECTED]>
To: "Brad S. Jackson (E-mail)" <[EMAIL PR
> > I am logging server activity to a MySQL database. Unfortunately, I
> > have yet found a way to log the number of bytes being transferred to a
> > visitor. The closest I've come to anything like that is
> > apache_lookup_uri() but I'm not sure it's meant to handle such a
> > thing. Does anyo
hopefully someone who knows what they're doing can reply to you, but in the
meantime this should get you going - it works for me:
$td = mcrypt_module_open(MCRYPT_TripleDES, "", MCRYPT_MODE_ECB,
"/usr/lib/mcrypt-modes");
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
mcrypt_gene
php -q
try php -h for other options - if that fails, there's always the manual -
http://www.php.net/manual
- Original Message -
From: "Nick Davies" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 20, 2001 8:06 PM
Subject: [PHP] php executable
>
> Is it possible to sur
- Original Message -
From: "ReDucTor" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 26, 2001 4:38 PM
Subject: [PHP] Thinking about going to ASP
> Just looking over the achives of the .net show(was msdn show), and with
.net
> its got some really great features..
>
> So
Just gave it a go, it hangs for ages connecting to my servers with many
databases, and takes ages to retrieve record sets that load much much faster
via the phpmyadmin html interface
phpmyadmin, although plenty buggy on certain actions, is far better to use
for me so far
- Original Message
> I use the PHP virtual() function to call a CGI script, and that works
> fine. But I need to prevent the CGI from being executed directly, in
> case someone tries to access its URL.
>
> Since HTTP_REFERER is unreliable, I was wondering how others have
> solved this problem ...
>
>
> Egan
move i
> Hello,
> I am trying to use the UPS Online Tools, the XML version. This requires
you
> POSTing an XML document to their Tools server, which is SSL enabled. I am
> having a problem getting this to connect in PHP (4.0.6) on my server
(Apache
> 1.3.20). In my scripts, I use
> $Socket = fsockope
if you're using apache, something along the lines of the following untested
directives should prevent anyone but the localhost (which is where your
virtual() calls should be coming from) from accessing the cgi's via http
order deny, allow
deny from all
allow from localhost
> Thanks for the ide
> I use mcrypt to encrypt passwords, I saw somewhere international users
had
> trouble with the high ascii. is the any functions that can convert the
high
> ascii to hex or something ?
>
> Thanks
>
> Randy
Have a squiz here:
http://www.php.net/manual/en/ref.strings.php
--
PHP General Mail
> We don't define any virtual hosts in httpd.conf; instead, we use a
> custom handler hooked into post-read-request. So I won't be able to
> define "/path/to/usr/cgi" in httpd.conf.
>
> But if that concept will work in user .htaccess files, it would be an
> improvement over my current techniques.
> Hi,
>
>I would like to know how to use the mailto function calling the
mail
> client and at the same time having the subject filled with something.
This is not a php question, it's html and easily answered by looking at a
html reference, but the answer is:
mailto:user@host?subject=The S
> After testing this I see that:
>
> Apache uses the IP address of the remote host to determine whether to
> allow or deny access.
>
> Even though PHP is running on localhost, and making a request via the
> virtual() function, Apache still knows the IP address of the remote
> host, and uses that.
> For example:
>
> HEAD /contact.php4 HTTP/1.0
>
> instead of
>
> GET /contact.php4 HTTP/1.0
>
>
>
>
> What does it mean?
>
> cheers,
>
> - seb
>From the http1.1 rfc (because it's a http-related thing, not php)
ftp://ftp.isi.edu/in-notes/rfc2616.txt
9.4 HEAD
The HEAD method is i
> Hi there,
>
> I need use sockets in my code, but PHP doesn't see function named
> 'socket'. Does any one have any expirience with PHP sockets ?
> Maybe name has changed ?
Did you --enable-sockets in your ./configure line ?
jason
--
PHP General Mailing List (http://www.php.net/)
To
> How can I send a command to remove it from the server within PHP?
>
> Thanks,
>
> Paul
You go to the online manual, browse to the Filesystem Functions section and
look up a function that removes files
http://www.php.net/manual/en/ref.filesystem.php
jason
--
PHP General Mailing List (http:
> But is there a way to make one of my root scripts run by sending it a
> command to do so from the DSO version of PHP like with system command
> or something like that. Or some roundabout way to make it think root is
> asking the script run.
>
> I hope you understand what I am asking.
There poss
> I was wondering if there is a way in PHP that you can determine the IP
> address? I am wondering because I am developing a simple web based
> program (in php) for use in a hospital setting and I want to do some
> checks to make sure that the program is not being run from a computer
> outside of
> Hi,
>
> I've been trying to figure this thing out for 3 hours now. Lets say we
have
> a variable $x. Now I need to assign $x with similar output that comes from
> an include function.
>
> For anyone who did not understand me --> Instead of the stupid include()
> function outputing the file conte
> I upgraded from PHP 4.0.5 <> 4.0.6 and since i get openbasedir errors all
> over the place when i try to upload a file through a php script
>
> is this a bug?
>
> Stefan de Wal
> dewal.nl
Stefan, did you check your open_basedir and/or error_reporting settings in
php.ini and apache config? What
> I drowing here and need a life-ring! I have a site relying heavily on
> e-mail registration, forums, etc. and mail() is broken in my php
> install. I've been using an smtp server other than sendmail, but
> based on recommendations I have removed that smtp server, removed php,
> installed sendm
> > Stefan, did you check your open_basedir and/or error_reporting settings
in
> > php.ini and apache config? What are the errors?
> >
> I did. No difference between the old php.ini and the new...the apache
config
> is also unchanged.
And the mentioned open basedir errors? What did they say?
>
> Right off the top of my head, you have three options that I can see:
>
> (1) Rewrite the code to avoid any output before the redirect.
I'd recommend this one myself
jason
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands
> # read the post from PayPal system and add 'cmd'
> read (STDIN, $query, $ENV{'CONTENT_LENGTH'});
> $query .= '&cmd=_notify-validate';
>
> # post back to PayPal system to validate
> use LWP::UserAgent;
> $ua = new LWP::UserAgent;
> $req = new HTTP::Request 'POST','https://www.paypal.com/cgi-bin/w
> $fp = fsockopen("www.paypal.com", 443, $errono, $errstr, 30);
> if (!$fp) {
> echo "$errstr ($errno)\n";
> } else {
> fputs ($fp, "GET https://www.paypal.com/cgi-bin/webscr
> HTTP/1.1\015\012");
> fputs ($fp, "HOST www.paypal.com\015\012");
> fputs ($fp, "Content-type:
applicati
> When sending out email is it possible to know if their email client
> program will be able to read a html email? If it can't read a html
> email then it would show a text email. I know it's conventional wisdom
> that this isn't possible but has anyone even heard of someone figuring
> this out?
> Hell0,
>
> I have a MySql database with 3 columns. The first column is "id" second
> is "name" and third is "value", I have two drop-down lists, with the
> first filled with an array from the column "name". I would like for the
> second drop-down list be changed according to the "value" of wha
> hi,
> how can i change variables that has two or more words to variables that
> has "+" instead of blanks in that variables.
> Like this: "word1 word2 word3" => "word1+word2+word3"
>
> thanks
http://www.php.net/manual/en/ref.url.php
jason
--
PHP General Mailing List (http://www.php
> How do I download a file with PHP? I have a few hundred .xml and .rdf
files
> that I want to download on a regular basis.
See the filesystem functions in the manual - fopen(), file(), etc
jason
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
Fo
I'm not even sure that the shell escape is even used in win32 perl - I think
it's done via a regular file association. I clearly remember setting it to
#!/some/fake/rubbish one time as a test and it still worked fine
I imagine the same would go for php.exe
jason
> Do you normally have #!perl.
> If I have a text file with all my sql statements (from like say mysqldump)
> what's the easiest way of passing them to mysql? I'm on RedHat6.2 with
mysql
> 3.22.32
>
> Thanks,
> -Jonathan
I'm not sure about the easiest way, but definitely an easy way would be to
simply do:
cat filename | mysql
http://www.modssl.org/docs/2.6/ssl_reference.html#ToC22
jason
- Original Message -
From: "Daniel Tryba" <[EMAIL PROTECTED]>
To: "Michael Conley" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, February 09, 2001 12:24 PM
Subject: Re: [PHP] Files only available via HTTPS
> On
Hi Tony
Did you happen to check the manual? :)
This will get you started:
./configure --with-your-required-options --enable-discard-path
- Original Message -
From: "Tony Bibbs" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 13, 2001 1:18 PM
Subject: [PHP] Using php
> Is there any reason why php is better than perl for shopping carts
> and/or product catalogs?
>
> Thanks,
> Jeff
It's hard to just come out and say that php is better than perl for shopping
carts because there's too many factors to take into consideration.
If you were a person who'd never use
You'll probably need to trigger the deletion of all expired carts with
something other than trying to guess when the user closes their browser.
Maybe a regular cronjob, or just do it inside your globally-included
function definition script so that any hit to the website can trigger it for
you, or
> If you're already using the CGI version of PHP, there isn't any
> disadvantage to using either it or perl scripts to do this clean-up. If
> you're running the Apache module version of PHP, you'll need to find a
> tool that can be invoked from the command prompt (such as perl) to do
> this for y
> When Jason says 'especially when your note using the cgi' he means the
> cgi version of PHP (I think) in preference to installing PHP as an
> apache module.
Almost, yes - I literally meant the 'common gateway interface', due to the
fact that the webserver spawns the requested script/program ou
> However, there's no necessity to have the cgi version if you already have
> the modular version. All that is needed is to call the appropriate script
> using a tool such as 'wget'. This can be done manually or from cron as
> appropriate.
>
> Billy
No there's not - I think that goes without sa
80 matches
Mail list logo