http://www.isi.edu/in-notes/rfc1034.txt
excerpted:
To simplify implementations, the total number of octets that represent a
domain name (i.e., the sum of all label octets and label lengths) is
limited to 255.
unless using one of the new extended names..., but I digress
Typically URL's work fin
Have you tried setting socket blocking?
Here's what I do...
var $connection=0;
$host = "pericles.ipaustralia.gov.au";
$port=23;
switch( $connection=fsockopen($host,$port) ) {
case -3:
return("-3 socket could not be created");
case -4:
return("-4 dns lookup on host '$host' fa
you may want to look at the curl functions as a start.
thats most of the functionality down already. otherwise you'll have to
parse raw data. not too hard, but can be painful to keep stateful info.
you'll also have to rewrite code when the interface changes, you'll probably
want to look at hot
I concur
Probably this will work
$result = mysql_query("UPDATE table SET value1='$value1',value2='$value2'
WHERE id=$id");
remember integers id=1 are not strings id='1'; not the same!
-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: December 5, 2001 11:37 AM
T
Webzip is ok too for downloading an entire site onto a local machine,
restructuring links, although the non registered version inserts javascript
& html code into every page header. Its nothing that a quick regex replaces
can't fix though ;)
www.webzip.com
-Original Message-
From: Phil
cron job.
Probably something along the lines of small php code interfacing with a db
with dates etc in, and another php script which checks the dates and emails
details on that day.
A Cron job which runs the script daily would probably do the job.
do a search in google for cron job
-Origina
Simple to do it in php, but i would think its better done in apache using
virtual host configuration.
do a google search for virtual host apache
-Original Message-
From: Ratfish [mailto:[EMAIL PROTECTED]]
Sent: October 2, 2001 10:25 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Simple Quest
Return into an array, then loop through the array or shuffle it (easier)?.
Note if you have nulls in DB, you will have to do something different.
n'est pas?
e.g. (untested)
mysql_fetch_array
-Original Message-
From: Matthew Delmarter [mailto:[EMAIL PROTECTED]]
Sent: S
You have a blank line before your mailto:[EMAIL PROTECTED]]
Sent: September 25, 2001 12:59 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] A simple PHP form not working
I did try that before too and here is what I got/get :
Warning: Failed to Connect in c:\Program Files\Apache
Group\Apache\htdocs/d
Another thing to check
Are your table(s) corrupted?
>From the MYSQL Manual
Typial typical symptoms for a corrupt table is:
You get the error Incorrect key file for table: '...'. Try to repair it
while selecting data from the table.
Queries doesn't find rows in the table or returns incomplete
For a start use
's
much easier to read
eg
$qry_1="select * from cust_info where username=\"$username\"";
should be
$qry_1="select * from cust_info where username='$username'";
this looks like a guilty line -
$qry_2="insert into cust_info (username,password,mother) values
("$username","$p
Not quite what you are looking for, but here are some Chinese sites on PHP
to look at, they also have forums in chinese
(?)
www.phpuser.com
www.phpx.com
www.php2000.com
www.phpease.com
www.chinaasp.com/php
??!
???
()
--
PHP General Mailing List (http://www.php.net/)
To unsubscri
It may not be a performance thing based on software in use, it could be
coding problems with the current software.
If you are having problems with 40 - 50 users, you may want to look at where
things are locking up. Table locking because of badly designed update
queries can freeze a good system b
How about limiting results?
eg
limit the return page value after a certain number (say 10) to every 5
pages, then 50 pages a la google.
Page
1 2 3 4 5 6 7 8 9 10 ..15 ..20 ..50 ..100
This can be done relatively easily
eg (untested)
for ($count=1;$count<=$pages;$count++) { // loop thru
ereg_replace or str_replace perhaps?
eg
$something= "this is a sentence";
$something = ereg_replace (" ","+", $something);
print $something;
-Original Message-
From: Egon Schmid [mailto:[EMAIL PROTECTED]]
Sent: September 14, 2001 2:20 PM
To: Alexander Skwar
Cc: murat; [EMAIL PROTECTE
2 queries is ok imho, but let the database do all the work ;)
The first query should be a select count (*) QUERY for a count.
The second query should be the actual QUERY.
Eg something cut 'n' pasted from some code of mine (not nice, but hey ;) )
--
$db = mysql_conne
Should be relatively easy.
Its going to take 2 steps.
Send out one of the images with a unique id per mailout, this could be the
users email address if you wanted to tie in the data per user (may be
illegal in some countries without users permission).
eg first mail
bla blah
next mail
bla
It still won't work though.
(unless show_source is javascript, which I doubt)
You can't embed php in html like that. HTML is for client side, and they
aren't running php in their browser. Browsers generally support javascript
or vbscript ECMA style scripting on client side.
If you wanted to sh
Create a file with the following.
test.php
open a browser and point at test.php
Look at the http variables section.
Now try adding some variables to it eg :
open the browser, and open a url like the following:
http://localhost/test.php?x=y&foo=bar
Now look at the PHP Variables section.
yo
You are casting microtimes results as an integer value. It isn't an integer
value, hence the 0.
>From the manual It returns the string the string "msec sec" where sec is
the current time measured in the number of seconds since the Unix Epoch
(0:00:00 January 1, 1970 GMT), and msec is the mic
it usually means the apache httpd wasn't found in /usr/bin
Some distributions throw things in wierd places
do a 'locate httpd' (quicker) or 'find \ -name httpd' (longer)
to find out where its situated
then configure paths accordingly.
Remember if you are going to use dso's apache must be compi
You're probably going to need a mime class - Manuel Lemos makes a good one,
then send as a mime attachment.
http://freshmeat.net/projects/mimemessageclass/
Some sample code below that I use (and a mime class).
Example.php
from = "$emailfrom";
$mymessage->to = "$emailto";
$mymessage->subject =
Some of us live in countries where these proxy servers are banned.
I cannot access anonymiser, safesurf or any of the other open proxies.
sometimes accessing cnn is useful, so I wrote some quick and very nasty code
to retrieve and view webpages - also encrypts the url as well - China
sometimes ba
The simple things...
Now I feel stupid.
Baaie dankie Rudolf.
(I'm an ex Capetownian now in Shanghai,China)
Note to self, read manual * C A R E F U L L Y *
-Original Message-
From: Rudolf Visagie [mailto:[EMAIL PROTECTED]]
Sent: August 24, 2001 1:43 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PR
I can't get session variables to work
I know this has been done to death in the past, but I've looked on php.net,
and google for a solution, have tried the suggestions, and seem to fix it.
My php session settings are as follows:
NameLocal Global settings
session.au
$search= urlencode ($search);
urlencode - have a look on the php site.
-Original Message-
From: Chris Aitken [mailto:[EMAIL PROTECTED]]
Sent: August 22, 2001 9:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Strings with Spaces in URLS
I have come up with a bit of a problem
I have a l
just a thought - \r\n?
try stripping out \r's as well. windows does \r\n (carriage return, line
feed) for text, unix only \n's
-Original Message-
From: Jens Schodt [mailto:[EMAIL PROTECTED]]
Sent: August 21, 2001 3:20 PM
To: 'Tyler Longren'
Cc: '[EMAIL PROTECTED]'
Subject: SV: [PHP]
Depends on what Chinese charset you want.
Simplified Chinese or Traditional.
GB or BIG5
Use a meta content type for the charset type
for simplified
for traditional
eg
Yahoo! China - NA?¢FOD1u
¦n¤F??
Lawrence.
-Original Message-
From: Maxim Maletsky [mailto:[EMAIL PROTECTED
you're startup files are typically in /etc/rc.d/init.d on redhat
be *very* careful though!
Create a script which starts whatever you need in there.
create a text file which starts apache.
eg pico startapache
#start apache
apachectl start
save file
chmod +x it to make it executable
do the
/ might be a correct path not a hack attempt. here's something normalizes a
directory for a given path passed to it.
eg /index.txt
eg ../../../ will get parsed out. such as in the
http://www.somesite.com?page=../../../../etc/passwd
Originally written for a directory browse script i use for a
Windows is a little stupid
try this from windows
start/run/command
echo > .htaccess
you now have a blank .htaccess file, copy it to wherever you need and edit
it with whatever contents you need.
-Original Message-
From: rm [mailto:[EMAIL PROTECTED]]
Sent: August 17, 2001 12:27 PM
To:
my 2 cents
Anyone with a clue doesn't use /etc/passwd anymore *shadow password file*,
so thats kind of depreciated...
Your php process should not be running as root - typically you will give
apache its own group, and apache + php will only be able to access files
which that group has permission
Most people do it like this
Specify the charset in the document.
e.g.
Simplified Chinese
Traditional Chinese
You can also specify the language type in the web server - have a look at
your apache settings.
Doing it via the charset= method is better though imho.
Note that the download fo
pass working directory [or] path to working directory.
PWD is a unix command
See man pwd for more details.
eg
http://campuscgi.princeton.edu/man?pwd#toc3
-Original Message-
From: Raphael Pirker [mailto:[EMAIL PROTECTED]]
Sent: August 15, 2001 2:49 PM
To: [EMAIL PROTECTED]
Subject: [P
Well,
It seems your web server is setup not to parse .html files as php
If you are running apache, then add configure it to correctly parse the
mailto:[EMAIL PROTECTED]]
Sent: August 15, 2001 11:20 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] to include php file into html file
Try
in your html file to include some php code in there
[1]Javascript is a rather sh*tty client side language, it doesn't parse php
very well.
[2]
Try this
works for me - try loading www.shanghaiguide.com/main/index.php3 - should
do time, and display a different image every time.
cheers,
lawrence.
-Original Message-
From: Karl Phillipson [mailto:[EMAIL PROTECTED]]
Sent: August 9, 2001 5:21 PM
To: '[EMAIL PROTECTED]'
Subjec
He's young. Impatience is a documented feature of the youth of today (hmmm,
am I old now ;( )
I've was helping him offlist with php/mysql yesterday - he seems to have it
installed now. All he needs to do now is learn php, and mysql, and
courtesy.
Shouldn't take more than another thousand or tw
Kyle,
Apache runs as a background program.
When you've installed apache, and php, you don't actually run them from the
commmand line.
What you have to do is open up a browser window, and point it to your
computer.
Open up Internet Explorer (you're running windows it looks like),
and type in
Oops, Correction - You'll need to run apache first, leave it running, and
then try the below.
not enough coffee today...
-Original Message-
From: Sheed, Lawrence -SHNGI -AG
Sent: August 2, 2001 5:51 PM
To: 'Kyle Smith'; [EMAIL PROTECTED]
Subject: RE: [PHP] <- BEING AN ASS CLICK HERE
items status to "Reserved".
When he buy he just tell how many and not which ones.
"Lawrence Sheed" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]
...
> Sounds like a strange request, what are you trying to do?
>
> I don
Sounds like a strange request, what are you trying to do?
I don't think you can do this directly in mysql, but you could build an
array of results in php.
eg something like (crappy code below)
//Grab results
$db = mysql_connect($db_domain, $db_user,$db_password);
mysql_select_db($db_databasenam
Bear in mind that you don't want to be doing queries like that generally.
Use count(*) to get the number of rows - using mysql_num_rows is slower.
eg
$query="select count(*) from tablename where cat='band'";
$result = mysql_query($query,$conn);
etc.
-Original Message-
From: David Robl
I presume you mean code layout
Its there to make code easier to read.
eg some silly code
for ($x=1;$x<100;$x++) {
while ($i<50) {
print $i;
}
}
This is more legible than
for ($x=1;$x<100;$x++) {
while ($i<50) {
print $i;
}
}
Indentation makes it easier to spot
Are you still having problems?
Things to try:
1. Try and open the url directly in a browser.
eg http://p.moreover.com/cgi-local/page?c=Music%20business%20news&o=xml
Does it return data (you may need to change the &o=xml to &o=html though).
Some countries (like the one I'm in China, have moreo
Set a flag
either cookie, or db based.
in your submit code, set the flag, fairly simple
if ($submitted) {
//error i've been posted already
}
else {
//do form submit stuff.
$submitted=1;
//SetCookie or session variable...
}
-Original Message-
From: Ashley M. Kirchner [mailto:[EMAIL PROTE
this would seem to be a php list, maybe you should look on a perl list for
a complete response, hmm?
Activestate make a reasonable perl interpreter for windows, have a look at
activestate.com for more details.
also try google and search for perl windows apache, maybe you can try
reading some of
To emulate a post you'll have to do something similar to the following
header "POST /index.php3 HTTP/1.1";
header "Host: $host";
header "Content-type: application/x-www-form-urlencoded" ;
header "Content-length: ". strlen ($data);
header "Connection: close\n\n"; //may only need one, can't remem
Probably necessary to have a customised browser or other solution - i
haven't seen any that explicitly interface to a gps device for lat/long
co-ords.
You cannot triangulate position using wap - the phone company does it by
triangulating the position of the cellphone
(Very simplified explanation
Its however you prefer it (or whatever is easier to type usually).
sprintf is usable, depends on if you have a c or perl background, and its
second nature.
For me, I use editplus on windows which gives color coding
(www.editplus.com), if I do
$query = "select abc,def,ghi from table1,table2". $a
Almost, but not quite. You also need to prepend a Header before any output
your data to tell the browser its content type.
Eg
-Original Message-
From: Mark Roedel [mailto:[EMAIL PROTECTED]]
Sent: July 26, 2001 12:02 AM
To: Clayton Dukes; Php-General
Subject: RE: [PHP] Syntax Eyes
>
how about
$location = addslashes($location);
$query = "select shoodID from shoots where location = '$location'";
or
$query = "select shoodID from shoots where location = '".
addslashes($location) ."'";
Both are \'clean\' :)
-Original Message-
From: Moriyoshi Koizumi [mailto:[EMAIL PRO
I'm of the opinion you cannot do this totally in PHP.
You are going to need some client side, and some server side software -
server side can be php of course.
Client side ie (gps/wap device)- One possibility - write a wap browser that
interfaces with your gps device and returns co-ords in heade
I use the following
Looks a bit unwieldy to call, but does everything I need.
eg, say I have a table called foo with ID, Name
print OptionCreate ("ID","returnID", "foo order by Name", "","Name");
will create me a drop down
print OptionCreate ("ID","returnID", "foo order by Name", "1","Name"
Feeling a little guilty for not being that helpful (rfc's aren't that easy
to use sometimes)
>From the top of my head
Two types of encoding based on the RFC
B (Base64)
Q (Quoted?)
so for funky foreign text, non ascii would be something like
$subject= base64_encode ($subject);
$subject= "=?I
Have a look at the internet - google is good for this
http://www.imc.org/mail-i18n.html#MIME
Internationalized text and names appear in both parts of Internet mail
messages: in the headers, and in the body of the message. RFC 2047 covers
how to use international characters in some parts of non-M
jumping in after the fact here, but sounds like a bad database design to me
have you thought about redoing the data a little.
eg adding a column x int, y int , iterating through the data, and extracting
the values into those columns.
using explode to split the original via the x would be a star
57 matches
Mail list logo