Quite right - variable names are most definitely case sensitive. Functions
are not.
CD
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, March 05, 2003 7:40 PM
Subject: RE: [PHP-WIN] $_Post doesn´t work
> I believe it's called
uary 24, 2003 6:50 AM
Subject: Re: [PHP-WIN] Configuration Trouble
> Hi guys
>
> Did you manage to fix this for simpleserver? I'm stuck! Thanks!
>
> --
> From: Cam Dunstan ([EMAIL PROTECTED])
> Date: 10/19/02
>
>
> Next message: Nino V: "[PHP-
Brennan
You should confine those sorts of comparisons to numbers if($num == 1000)
For strings, use strcmp()
if (strcmp($s1, $s2) ==0){echo "these strings are identical"; }
be aware that it is case sensitive.
- Original Message -
From: "Brennan Mann" <[EMAIL PROTECTED]>
To: <[EMAIL P
; I want to put the database on the server.
> They told me that I must do a Dump and then run some kind of script that I
> dont quite get it.
> The problem is that I don't know how to run/make the script.
>
> Thanks
>
> "Cam Dunstan" <[EMAIL PROTECTED]> escrev
Not sure if I fully understand your problem Rui but I would think your ISP
means an SQL statement type dump - that is, the data you have is put in the
form of a giant SQL statement - a collection of INSERT statements, one for
each record you want to insert. Perhaps this might need to be preceeded
There`s no such thing as a stupid question - unless of course we are trying
to dramatically reduce the number of posts on this list.
Jim, just echo the password before and after it gets inserted and
before/after comparison and you`ll soon see where you going wrong.
Echo - the greatest debugging
Davy
put this into a script and run it ...
$dbase = "somedatabase";// change this to suit !!
$db = mysql_connect("localhost", "root"); // change this also!!
mysql_select_db($dbase,$db);
$result = mysql_list_tables($dbase);
$rowcount = mysql_num_rows($result);
for ($j = 0; $j <
Yep, that`s better still - a nice succinct little one liner Jill.
I avoid the ereg_ function family like the plague myself but that`s my
problem, your solution is entirely correct.
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 01, 2003
Cybot, try this
function string_dryclean($dirtystring) {
$cleanstring = str_replace("\n", " ", $dirtystring);
$cleanstring = trim(str_replace("\t", " ", $cleanstring));
do {
$cleanstring = str_replace(" ", " ", $cleanstring);
} while (strpos($cleanstring, " ") > 0);
return $cleanstring;
}
Cybot, try this
function string_dryclean($dirtystring) {
$cleanstring = str_replace("\n", " ", $dirtystring);
$cleanstring = trim(str_replace("\t", " ", $cleanstring));
do {
$cleanstring = str_replace(" ", " ", $cleanstring);
} while (strpos($cleanstring, " ") > 0);
return $cleanstring;
}
check out str_replace()- you`ll find it in the "string functions"
section of the manual.
- Original Message -
From: "Bobo Wieland" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 30, 2003 6:26 PM
Subject: [PHP-WIN] Something like trim()
> Is there an easy way t
bobo
I doubt that the table will be too big myself given the limitations which
you will find in the mysql manual (far above your requirements). Spend a
bit of time and calculate the actual size of the table - while it sounds
huge you might be pleasantly surprised. A database of properties in a lo
Don`t think so Wade, the posted data would be sent only to whateverB dot
com.
Which domain was going to respond to the user by the way? since only one
can, the other is purely for the collection of data presumably - have a look
at fopen() and fsockopen() in the manual, a solution might come to mi
Only possible with javascript as far as I now wherein you do the calcs or
validation at the browser end. Other possibility is a java applet but PHP
being server side does not have any inherent ability beyond ordinary html
at the users end. nothing to stop you using php to generate the
aforementi
Yep - check out the mail() function which will do exactly that. If you are
developing on your own machine which may not be running a mail server,
configure php to use your ISP`s mail server.
- Original Message -
From: "Duncan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday,
I must be missing something here, but what IS all this chatter about
politeness, blaphemy and profanity all about pray tell and what has it got
to do with php? If someone is posting dirty ditties can they send again
because I missed them completely.
- Original Message -
From: "Per Lun
Conny,
This is not a solution to your kernal32 problem necessarily though I suspect
it might be by default, but try to upgrade to Win98 if you can, Second
Edition if possible. and run PHP in CGI mode. For development purposes
(but not production of course) this is the by far easiest platform to w
within a do while loop, check for a '>' with the strpos() function
if the next character isn`t a < or a & then you have found the spot to start
extracting from, otherwise...
jettison all of the string up to and including the found '>' with the
substr() function and repeat the process (loop) on the
Hm - I`ve had some suspicious problems with XP myself. In my paranoia I
thought it was muckrosoft`s first awkward attempt to screw up the rapidly
expanding php community - but I think it is some kind of weird caching
issue in the OS itself. Try setting the browser to the LEAST caching
possi
Wow! thanks fellas I really enjoyed that! except when Sean fired me! Hey
Sean can I get my Mars Bars and stuff out of my drawer or is it straight out
onto the street?
Nothing like the subject of auto increment to cause a few hot flushes hey
girls!! Proof indeed you have all had your moments wi
Amen to that - I really believe you are better off (if you have the freedom
to do so) changing autoincrement fields to an integer type and managing the
incrementing yourself. In addition to the problem Dash mentions there is
yet another "gotcha" - if you are ever faced with having to combine t
john,
Some time ago I sent via the list a lump of code that did this, but it was
fairly highly customised to my weird way of doing things.
You really should have a go at doing this yourself to suit your own style of
programming, however if you get stuck mail me back and I shall send you
something.
Welcome to the list Greg,
There are thousand ways - try converting the string to an array then looping
through the array with either a for() loop, a do-while or a foreach()
$my_array = explode(",", $mylist);
foreach ($my_array as $one_element) {
echo $one_element."";
}
- or -
$my_array =
I think AnalogX, (the makers of "Simple-Server") have already put out
something along those lines mate. Check their site. Such an app might be
handy for a while, but in the end you`ll probably revert back to Microsoft
Notepad, the world`s most popular php.ini file tool.
- Original Message
aidal
Maybe the array_walk() function is for you - but in general terms it is
perhaps better to have a crack at a clever SQL statement if you are pulling
stuff out of a database in any case. Look at nested SELECT statements and
the MAX() function. Or, if not that, creating a temporary table with
another gotcha with auto increment fields - you can`t combine contents of
two tables, each with their own auto incrementing fields which dis-allow
duplicates - oughta be a law against them.
do a query for the largest (max() function ) in an integer field, add one
and then INSERT new value. store
go to http://www.apache.org Rado Rad rasho matie, half the world runs on it,
you`ll never use IIS again.
- Original Message -
From: "Radovan Radic" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 7:05 AM
Subject: [PHP-WIN] Fast Web server
> Hi
>
> Can you
bit "off topic" here, this PHP-Windows list may not be
the right arena methinks.
- Original Message -
From: "Sandeep Murphy" <[EMAIL PROTECTED]>
To: "Leon" <[EMAIL PROTECTED]>; "Cam Dunstan" <[EMAIL PROTECTED]>
Cc: <[EMAIL PR
sands,
comma delimited text (or tab delimited) will do for all of them, unless the
dbase app does not have import facility, in which case you could structure
up the data into genereic dbase format yourself, its a fairly simple format,
a header with info about fieldnames, sizes and types, followed b
Franco,
I`m not so sure if unlink() can be relied on to work on a windoze server,
never actually tried it but have hazy recollections of some "windows only"
issue with it. Check the FAQs or manual.
- Original Message -
From: "Franco Pozzer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Jack,
here is another quick and dirty function to stick in your library, yet
another way to redirect from anywhere in your script
function redirect($url){
echo "window.location.replace(\"".$url."\")";
}
usage:
blah
blah
redirect("any_url");
exit;
>
> -Original Message-
> From: Jack K
Franco
Yes it is entirely possible to get PHP to work in CGI mode with NOTHING in
your windows or system directory. I often set up win machines with
everything under the C:\PHP directory including the php.ini file and all
DLLs, sessiondata and uploadtemp dirs and it works a treat and is a cleaner
DaMouse,
Here is a copy of a previous mail for a related problem, with filesizes and
a little arithmetic you should be able to adapt this to your needs
(Copy of mail to Darren)
Darren,
As others have said, PHP is not really the right tool for client side work
even if the client machine is also t
Darren,
As others have said, PHP is not really the right tool for client side work
even if the client machine is also the server. Having said that, the
general style of task you are trying to achieve is frequently tackled by the
use of Recursive functions - functions that call themselves from "wit
hey Joe,
You ought to try some of those tools for MySQL Dash recommends, there`s some
beauties amongst them, especially phpmyadmin. In the meantime, here is a
little script, quick and dirty that will let you look at a database and
generate some basic queries and forms for you.
Just copy and paste
You can`t Alvin - once you`ve joined the list, you`re not allowed to program
in any other language except PHP for the rest of your life.
Go here - http://www.php.net/unsub.php
> - Original Message -
> From: "Alvin Tan" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday,
zeus,
I notice you start your code with On Tue, 19 Nov 2002, zeus wrote:
>
> > Nope! i try that one too, but the parse error thing still exist
> >
> >
> > Howard, Robert P wrote:
> >
> > >change your else($submit) statement to else
> > >
--
PHP Windows Mailing List (http://www.php.net/)
T
quot; type errors it will almost
certainly be a permissions issue. Read back through the list for lots of
good advice from contributers on permissions and security issues in general
before you go "live".
cheers.
- Original Message -
From: "Kalle" <[EMAIL PROTECTED]&
Andreas,
Seems like you need to tell Apache to EXECUTE any php files asked for rather
than offer them up for download. Do this by editing your httpd.conf file
(C:\Program Files\Apache Group\Apache\conf\httpd.conf) as follows
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
A
A.J.
A.J.
Dash`s solution says it all - you certainly don`t need Winmysqladmin to
start and stop mySQL - I just have a couple of shortcuts to batch files to
start and stop apache and mysql on the desktop. You don`t need the "start"
command in fact though it does no harm.
stop mySQL with
cd
Rui,
There are a hundred ways of doing this, popup windows are often simple
client side javascript routines, but most often, serious passwording
involves the use of databases. So get yourself a copy of mySQL and start
by familiarlising yourself with that and PHPs unrivalled set of db
connection
Dean
A PHP APache mySQL combo works fine on a win98SE box, probably the least
troublesome of all. While win98 is not a serious or secure platform for
WWW or business intranet, for home development its quick and easy. Are you
saying your scripts don`t work at all or just won`t add records to mys
Hey Rob,
Its tough getting started, even with the manual at your side, but you will
make it. Lots of folk do fine with IIS but I suspect Apache is less
bothersome - one or two small additions to the config file and you are up
and away. If you change to Apache and still have problems, mail me for
Gary,
Have you tried putting the DLLs in the same directory as PHP.EXE itself?
(typically C:\PHP) On any win system from 98 to XP I always put them here
rather than the win or systems directories and never have a drama.
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]
Stephen
I use echo, but that is not to say there is anything wrong with using print.
I`ve never really appreciated the difference, guess it gets back to the very
first script one ever wrote when trying to learn the language - I still use
$result and $myrow and $sqlstatement to this day purely out
john,
creating script snippits on the fly is generally not much use in an echo
statement because echos just stream to the clients browser - nothing in that
stream is actually ever going to be "executed"
The various solutions offered by other list members are particularly
relevant to the
creatio
Ernest, your solution is quite correct, I write lots of scripts that "write
scripts" and it works fine. just concatenate little strings together
"<"."?"."php" and "?".">" pretty much as you suggested to Philipp.
If you have a really sick and twisted mind you can create functions that do
this in
dee,
Use the string function nl2br($myblahstring)
This converts ordinary linebreaks (newline chars) to html tags on the
fly when displaying text out of a database for instance.
In your example though with straight echos you have to expicitly echo
at end of each blah echo, no matter what browse
raheel,
Script wise you should have no dramas at all running them on unix box (or
linux). Just ftp them straight across and let em rip. the only changes
would be of course logging onto a different database server perhaps. Most
environments typically do not have session_autostart set to on (1) b
- Original Message -
From: "Michael Hazelden" <[EMAIL PROTECTED]>
To: "'Asendorf, John'" <[EMAIL PROTECTED]>; "Svensson, B.A.T. (HKG)"
<[EMAIL PROTECTED]>; "Php-Windows (E-mail)" <[EMAIL PROTECTED]>
Sent: Saturday, November 02, 2002 3:23 AM
Subject: RE: [PHP-WIN] Problem with php-script, p
raheel
The method Constantin suggests is a good solution for your problem, but also
have a thorough read of the manual under date functions, there is a lot of
additional useful info there with the use of several of the functions in
unison - for example...
$tomorrow = mktime (0,0,0,date("m") ,dat
Craig,
Do you really need an include file?? Why not a simple IF statement in the
same script that treats the form?
if(isset($missing) == false){
echo "Please go back to the form and fill out
the $missing field. Thank you "; } else {
// process the form data normally
}
otherwise, if missing.i
Jason,
I know there is no restriction on using
John,
Theres nothing to stop you doing aother query within then loop of the first
provided that you don`t send the result to the same result handle or the
same row array - in other words .
$result =mysql_query($sqlstatement);
while ($row = mysql_fetch_array($result)) {
// do stuff
mysql_sele
John,
By clients do you mean source code editors??
If so, there are plenty of good ones, I like Plaven Parvenov`s CR-Edit
myself - has line numbering and PHP syntax awareness (optionally), loads
reasonably quickly.
goto http://www.praven3.com/credit/
CD
- Original Message -
From: "Jo
Max,
I too have tried to get SimpleServer to work without success - it is the
cutest little server and would be great for adhoc work on other PCs. Apache
is the main game of course and I use it without drama all the time but your
mail has prompted me to dust off simpleserver again and have anothe
Bob,
To redirect I use a simple little function which doesn`t need URLEncode and
works thru Apache without drama although it is a bit of a "cheat" since it
is sending a small chunk of client side script...
function redirect($url){
echo "window.location.replace(\"".$url."\")";
}
(put this near t
David and Davy,
My two bobs worth - I like to use sessions myself usually, I suppose because
it means my scripts are controlling access rather than the server or the
operating system. With sessons you can store all sorts of variables such as
exactly what the user can do in a list of tasks rather
Madeliene,
A combination you might like to put to them which I think would work well -
PHP MySQL at the server with some Delphi or VB windows apps at the client
end for data entry. There are quite a few Delphi components out there
(many are free and open source) to connect to MySQL directly or y
Sven,
Noticed the semi colon in your query string - I don`t think you should be
including that. db says he uses it with no problems - but if you look up
mysql_query in the manual - it says "The query string should not end with a
semicolon."
Either that, or maybe you lose the database connection
Jezz toby!! you don`t give us much warning! 2 hours? I think by
the time I saw your email you had already been shafted - if not, do a quick
and dirty one by echoing some image tags - use some little coloured gifs or
jpegs and stretch them to the right length according to the values in
John,
are you SURE you have been using the semi colon without errors John??
Check your old code, I think you`ll find a semi colon definitely isn`t
allowed in any reasonably current version of mysql / PHP. You may be
thinking of queries that you enter into such utilities as mysql-Front or
mysqlAdm
db
Far as I know it would - without the quotes of course.
- Original Message -
From: "db" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, October 12, 2002 7:40 AM
Subject: [PHP-WIN] Re: passing variables part 2
> another roadblock: how would you pass a variable containing
db -
a small word of caution on using the ampersand to send variables within the
URL - it works just like Dash said it would but don`t try and send huge
lumps of data this way - there are limits (possibly a couple of hundred
bytes or so) to the length of the URL allowed. Limits you wouldn`t have
Dean,
try www.impchat.com for a very nifty little mail app for win98 called
HermMail - freeware.
Haven`t been there for a long while so can`t be certain it is still there -
worth a try.
Cam D
- Original Message -
From: "Dean Hayes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Satur
kieran, try this ...
$fieldresult = mysql_list_fields($some_database, $some_table);
$fieldcount = mysql_num_fields($fieldresult);
for ($my_counter = 0; $my_counter < $fieldcount; $my_counter++} {
$fieldsize = mysql_field_len($fieldresult, $my_counter);
echo "fieldsize = ".$fieldsize;
echo
Marlene
You need to convert the current date to a string of the form "yyy-mm-dd
hh:mm:ss" and write your query as follows
$datestring = date("Y-m-d H:i:s", $some_time_stamp_integer);
- or for this very day today
$datestring = date("Y-m-d H:i:s"); // returns today if no optional
timestamp gi
67 matches
Mail list logo