Merry Christmas everybody.
I am using MS Windows 98 with Apache and following an example in Julie
Meloni's PHP - Fast and Easy (Chapter 10) in which she describes file
uploading using PHP on page 168-174.
She has two files:
1) an html form to receive the input from the user for the file to be
To all,
The following is a file upload question using PHP.
I am able to upload a file to my server with the following script. (see
below)
It's in two parts - the first is a html form and the second is the php
script which takes the variable $img1_name.
However, I'd like to check if, in fact,
Using the script below, I was able to connect to a database named contacts
for
output.
*However*, when I insert a [username] and [password] in place of the ,
I get:
Couldn't connect to the database - eventhough I am able to connect to
mysql.
How do I go about replacing the and to insert a
Craig,
I tried the following.
I was able to connect to mysql but not to the database contacts.
TR
...
HTML
BODY
?
define(DATABASE_HOST, localhost);
define(DATABASE_USER, johndoe);
define(DATABASE_PASSWORD, abc);
define(DATABASE_NAME,
Using MS Windows 98, Apache, PHP and mySQL.
I've installed Apache on my hard drive to test a database driven website
using PHP and mySQL.
Could somebody lead me through the steps if I want to continue using the
mySQL database and PHP when the site goes live and the files are uploaded
and
Sorry if my original question was confusing.
This is what I would like to accomplish:
I am currently developing a database on my website using mysql which is on
my harddrive.
I have installed Apache as well and I am using PHP.
My database is functioning fine on localhost.
I would like to find
Miguel,
Thanks for the reply.
.
MySQL has a command-line tool called 'mysqldump' which will output a text
file containing all the table creates and inserts necessary to recreate
the database.
O.K.
Now I have a .txt file of my sql statement.
Cyberskydive wrote in message:
Since you didnt make it clear, do you even have MySql and php on your
server? Are you looking to just move your data or looking to get php
mysql
installed on the server as well? (SERVER = production site, not localhost)
...
Yes. I have
The code that follows is from Welling and Thomson's book on PHP and mysql
(page 372)
I've tried it on Apache/ MS Windows 98 / PHP and I get the following line:
No quote available.
Questions...
1. Why can't I retrieve the present stock quote?
2. What is the variable
$quote
represent in the
Is there any way to retrieve data (for example - the text *within* a table)
from another URL so that only the text appears and not the html (tables,
cells, colors, etc.)
Below is a script which opens and reads a URL and then outputs the complete
URL.
I am just looking for the text output.
Thank you Jason.
I'm still trying to figure out how to implement the strip_tags() function on
the script below so that the output of the URL is straight text.
Please advise if you get a chance.
TR
.
html
head
titleRetrieving text from a
Thanks Miguel!
TR
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Newbie question.
I understand that one can open a page off an existing website to extract
text data using a PHP script by using the fopen and fread functions.
And by using the strip_tags() function, one can extract data without the
html markup as a literal string.
Here's my question...
Let's
Trying to test the function strtok()
I thought that the following script would output:
t
o
n
y
but I get
tony
Thanking all in advance.
Tony Ritter
.
?
$name=tony;
$token=strtok($name, );
echo $token.br;
while ($token!=)
$token=strtok( );
Thank you.
The output is
t
o
n
y
One thing...the server seem to keep running after the output to the browser
like it's going through an indefinate loop.
Any throughts?
TR
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I want to make sure about the syntax using mysql and PHP.
Here is the line of code:
$query=SELECT * FROM books WHERE . $searchtype. LIKE '% .$searchterm.
%' ;
.
Am I correct that the reason for the single quote within the expression
above is that:
Chris,
Maybe I didn't make myself clear...
LIKE '%// Beginning of double quote and then beginning single quote
beacuse it is the beginning of a string which then ends before the variable
$searchterm.
..
Is the reason that the is a
Many thanks Chris.
Tony
---
[This E-mail scanned for viruses by IAS, an Archiventure Company]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I have a question about the PHP function file_exists():
This is taken from a textbook entitled PHP Professional Projects by
Wilfred, Gupta, Bhatnagar (Premier Press 2002 - ISBN1-931841-53-5) on page
261 under the chapter titled Handling Files.
The authors write...
Consider the following code
In the following script, if the user types in Mike O'Hara in the name
textbox the final output is:
Mike O\'Hara
I am using the urlencode() and urldecode() functions.
If anybody can offer a suggestion how to lose the slash I would greatly
appreciate it.
Thanking all in advance.
Tony Ritter
To all,
On a bulletin board (non-usenet) within a website, is it possible to change
the color or size of the type - or add a link from a word that the user has
posted?
For example, John Doe posts:
Man, it's hot out here today!
Where John changes the default font color - which is black - of the
Using Apache / Windows 98 / PHP / mySQL
The following script is from Julie Meloni's book PHP Essentials
(PrimaTech) on page 138.
I've copied the script from her site and tried to run it and get the
following:
Internal Server Error
The server encountered an internal error or misconfiguration
Thanks for the reply Warren.
It says...
[Mon Aug 26 20:46:13 2002] [error] [client 127.0.0.1] malformed header from
script. Bad header=HTTP/1.0 401 Unauthorized: c:/php4/php.exe
...
- Original Message -
From: Vail, Warren [EMAIL PROTECTED]
To: 'Anthony Ritter
In my
phpinfo()
I get:
php version 4.0.0
Server_APICGI
..
Is this why it is not working?
If so, how does one install PHP as a module?
Please advise.
Thank you.
TR
...
Warren Vail wrote in message:
Load Module PHP4_Module c:/Apache/php/sapi/php4apache.dll // insert this
line
# blahblah2
..
- Original Message -
From: Farianto Kurniawan [EMAIL PROTECTED]
To: Anthony Ritter [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Monday, August 26
I'm trying to take a certain string from a USGS site that gives real time
water levels and water heights for a certain location and insert it into a
table using php.
I'd like to open and read some of the lines in the USGS table - but not all.
The output from the script - which doesn't have the
I'm having difficulty understanding what the array does or refers to in the
eregi() function using php.
Listing below are returned strings with
[0]
[1]
[2]
..
?
$fp =fopen(C:\\TextFiles\\Test.htm,r);
$content = fread($fp,10);
eregi(b(.*)hr
Thank you.
TR
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I get the following line when trying to use the crypt() function in php
..
Fatal error: Call to undefined function: crypt() in c:\program files\apache
group\apache\htdocs\handleform1.php on line 16
However, when I
I'm reading J.Meloni's tutorial on page 119 in Fast and Easy and she is
explaining using the PHP mail function.
There are two scripts for this example...
One is the .html file which lays out the form with input boxes, a textarea
box and a submit button.
It is:
HTML
HEAD
TITLE Simple Feedback
Thank you!
It works fine.
Regards,
Tony
--
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-mail: [EMAIL PROTECTED]
Is there any way to add an *additional* e-mail address - a cc - besides the
one that is already in the $to variable below using the following PHP
script?
Thanking all in advance.
Tony Ritter
..
?
$msg=This e-mail is being sent from www site\n;
Hi,
Thanks to all that helped me out yesterday.
I'm using PHP with Apache on a MS Windows 98 box.
I would like to include a cc to another e-mail adresss when sending an
e-mail.
In addition I would like to *receive* and *also have the cc person receive*
this e-mail as well.
Right now, I am
I'm using Windows 98 with Apache, mysql and PHP.
I'm in the process of learning PHP and would like to find a few tutorials on
PHP/mysql bulletin boards.
I know that there are a few that you can download but I am trying to find a
tutorial that will let me anylaze the syntax and logic of the code
A search of Google came up with more than a few PHP/mysql bulletin boards.
I'd like to get one or two basic PHP/mysql BB's which a few users on this NG
like so that I can try to analyze the code.
TR
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL
I'm trying to pass a variable from a form text box into a php file
(Tony1.php).
Then, I'd like to click on a link in the Tony1.php page and get the
Tony2.php page to load with the original variable -$lname - printed on the
next page (Tony2.php).
The Tony2.php loads when I click the link but the
noy2.php script? Please make sure in Tony2.php $name
is printed but not $lname.
Alex
- Original Message -
From: Anthony Ritter [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, December 07, 2001 12:01 AM
Subject: [PHP] Trying to pass a variable throug
Hi,
I'm using MS Win 98 and my ISP has PHP installed on a MS server.
I'd like to display a HTML form box on my site for users to type in a
message utilizing the PHP mail() function.
I've tested this using Apache on my drive with a html form and a php script
to receive the data and it works fine
- Original Message -
From: DL Neil [EMAIL PROTECTED]
To: Anthony Ritter [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Friday, December 06, 2002 8:47 AM
Subject: Re: [PHP] mail function() with MS
Hi Anthony...{snipped]
.
Thank you DL.
Qusetion: 1:
What would
I'm using MS Win98 and Apache and getting the following after submitting the
mail form:
..
Warning: Failed to Connect in c:\program files\apache
group\apache\htdocs\send_simpleform.php on line 14
The html and php scripts follow along with my php.ini settings.
Any help would
to connect.
Please advise.
I'm using MS OE5.
Thank you.
TR
..
- Original Message -
From: DL Neil [EMAIL PROTECTED]
To: Anthony Ritter [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Friday, December 06, 2002 10:37 AM
Subject: Re: [PHP] mail
Gentlemen,
Thank you for your assistance.
The PHP mail scripts were taken from Julie Meloni's book on PHP called Fast
and East on pp. 116-117. (PrimaTech).
In fact, she writes:
If you're using PHP4 on Windows, look for the following lines in your
php.ini file:
[mail function]
SMTP =; for
DL,
Sorry to be a pain... but using either:
the address of my outgoing mail server
or
localhost
still gives me:
Warning: Failed to Connect in c:\program files\apache
group\apache\htdocs\send_simpleform.php on line 14
Thanks again for your time.
TR
--
PHP General Mailing List
To all who assisted me today.
I finally managed to get the mail () funtion to work.
Thank you and happy holidays to you all...
TR
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jason Wong wrote:
Would you mind disclosing what you did to make it work? Those searching
the
archives in generations to come would appreciate what the conclusion was.
.
Sure.
1. I put it the _correct _name of my ISP's mailserver.
No more errros.
However...that sent out the
Using MS Win 98 / Apache Server:
I'm trying to test a form box using the php mail() function.
All is well when I fill in the text boxes and hit submit.
I receive the e-mail.
The form action in the html page is:
FORM ACTION=http://localhost/getform.php; METHOD=POST
_Now_
when I copy both of
Marco Tabini [EMAIL PROTECTED] wrote in message:
Best guess, your local server has register_globals on and your ISP
doesn't. However, without seeing your code it's going to be difficult to
tell for sure! :-)
Marco
Thanks for the reply
Marco Tabini [EMAIL PROTECTED] wrote in message:
Hey Anthony--
It's definitely a register_globals problem. Your ISP has turned it off
because it's generally considered a significant security risk.
The best way to solve it is to use the superglobal $_POST to access your
post data. In your
Off topic but I hope somebody can help.
Using MS Win98 / mySQL.
I'm trying to use LOAD DATA INFILE and coming up empty.
My text file is named:
test.txt
..
and is stored in C:\TextFiles
on the command line I type:
..
mysql LOAD
Marco Tabini [EMAIL PROTECTED] wrote in message:
I'm not sure how MySQL works under Windows, but you should either use
double backslashes (\\) instead of single backslashes or use forward
slashes (/) instead. MySQL is trying to escape your string.
Cheers,
Marco
I'm running the following sql query which outputs a repeat value for each
field in the html cell box.
Like this:
..
3.3 3.3 78 78 2002-06-11 2002-06-11
...
which is not what I would like.
I was trying to get:
.
3.3 78 2002-06-11
The following script is found in Matt Zandstra's book on PHP (Sams) on page
160.
He's explaining forms with PHP and has hard coded a value - 42.
He also is explaining a hidden fleld where the user can submit the number
and each time the user hits submit in the formbox, the counter will register
Michael J. Pawlowsky wrote in message:
This also works with the ternary operator...
.
No dice Michael.
I treid both your scripts.
The formbox comes up.
I enter a number.
I hit submit.
The box clears out the entered number without any
Hi Mike,
I tried the first script you posted on the NG.
This is what happens when I copy and paste your script:
The formbox appears.
I insert a number.
I click submit.
The number reverts back to 0.
The URL script that you sent me works fine.
I'm using MS Win 98/ Apache / PHP 4
Please advise
Hi,
I'm testing the following form on:
MS Win98 / IE 5.5 / PHP 4.0 / Apache and it works fine.
However...when I publish the
.php file
and the
data.txt file
on the ISP's MS IIS server, I get undeclared variables and indexes when the
form page loads.
The script follows.
Any help would be
Thanks.
Any ideas after looking at the code why I'm having difficulty publishing the
file to a MS IIS server with undeclared indexes and variables if it works on
Apache server?
TR
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Using MS Win98 / php 4:
Any ideas on how I can change my permssion settings on a file called
data.txt so it can be read to and written to or do I have to take that up
with my ISP.
I get the following after I submit a form:
Warning: fopen(data.txt, a+) - Permission denied in
Lars,
I use Win98 and Apache to test the .php script.
My ISP has IIS.
TR
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
The following script is from Kevin Yank's book on page 59-60. (Sitepoint)
I'd like to get some clarification about the line: (almost next to last line
in the script)
...
echo(pa href='$PHP_SELF?addjoke=1'Add a Joke!/a/p);
He has a link called Add a Joke!.
Newbie question and OT. Sorry.
I am able to conncet to a mysql server with the following call to
mysql_connect().
$connect=@mysql_connect(,,);
There are no parameters in the function call.
Why can I connect if there are no parameters?
However, if I give mysqladmin the password of:
Working on:
Win 98 / mysql 3.23.55 / php 4
I installed mysql 3.23.55 and wanted to check the user table in the mysql
db.
The query was:
SELECT User FROM user WHERE host='localhost';
The output was:
xx
user |
xx
||
||
root
John W. Holmes wrote in message :
Because a default install of MySQL includes an anonymous user, one with
no username or password. There is also a root user with no password.
Read the MySQL manual on Installation and the GRANT command on how to
fix this.
---John W. Holmes...
Chris Shiflett wrote in message:
Your query returns two rows because you have two rows in
the database that match the condition:
host='localhost'
--
Chris
..
Chris,
I was under the impression that the mysql database had as default user when
installed:
I am trying to access a page published on a server - and then using an
anchor - to jump to a specific paragraph on that page.
For instance, if using asp, I could write:
www.thesite.com/thepage.asp?go=here
where here -the value - in the string query would be marked up as:
Ivo:
Why not use :
www.thesite.com/thepage.asp#here
.
Thank you Ivo.
I don't usually use asp but was wondering if the word go in asp like:
www.thesite.com/thepage.asp?go=here
is a _reserved_ word in .asp which acts like the symbol # - serving as
the
anchor.
And if
Using eregi_replace(), is there a way to take out a piece of a sentence -
which has spaces - and then return the new sentence?
For example, to return the new sentence:
hello I must be going
from the original sentence:
blah blah blah hello I must be going blah blah.
I tried:
Messju Mohr [EMAIL PROTECTED] writes:
you mean
$newtext= ereg_replace(.*?(hello.*going).*,\\1,$text);
??
..
Thank you but I get:
Warning: REG_BADRPT: in c:\apache\htdocs\string.php on line 3
Using:
.
?
$text=blah blah blah hello I must be
However, this works using:
preg_replace()
.
?
$text=blah blah blah hello I must be going blah blah;
$newtext= preg_replace(!.*?(hello.*going).*!,$1,$text);
echo $newtext;
?
Thank you all.
Is there a way I can be sure of the syntax?
!.*?(hello.*going).*!,
In the following snippet, I'm trying to open and read a URL into the
variable $contents.
I'd like to use preg_replace() to return only part of that string beginning
with say - regional and ending with new - but I get the complete URL string
returned.
Thank you for any assistance.
Tony Ritter
Curt Zirzow wrote in message:
This exact thing was talked about earlier today, with the subject
'Using eregi_replace()'.
Right.
However, I've tried using the following code in which the text from the URL
is printed out completely and then I change the variable from
Curt Zirzow writes:
I did some testing you can see the code and results here:
http://zirzow.dyndns.org/html/php/tests/preg/parse_doc.php
..
Thanks Curt.
I checked it out and I still pick up the following lines which I was looking
to delete on the pattern match.
They are:
The following function is from Larry Ullman's PHP and mySQL on page 217 -
script 6.8 - in which there is a connection to a mySQL database using PHP.
My question is that I'm not sure of the global variable $dbc.
If I am to understand...this made up function escape_data() will receive a
piece of
Larry E . Ullman [EMAIL PROTECTED] wrote in message:
The mysql_real_escape_string() requires a connection to the database.
The connection identifier is defined in another script so it's brought
in using the global statement.
Hope that helps,
Larry
.
Ford, Mike [LSS] [EMAIL PROTECTED] writes:
You have a conceptual misconception. In effect, you need to read that
query
as:
select ft.topic_id, ft.topic_title
from ( forum_posts as fp
left join forum_topics as ft
on fp.topic_id = ft.topic_id
)
Thanks Jackson.
I appreciate the assistance.
Am I on the right track?
Best...
TR
..
// this is the form
html
body
form action=post method=process.php
p
Your e-mail address:br
input type=text name=namebr
input type=text name=emailbr
input type=submit name=submit
The following code is From Julie Meloni's textbook - PHP, mySQL and Apache
(SAMS) on page 305-307 / Listing 14.5:
It's the last script of a discussion forum which is comprised of four php
files and one html file.
The script can be seen at:
http://www.thickbook.com
Chapter 14 off the zipfile.
[EMAIL PROTECTED]
wrote in message:
Hi Folks,
I am currently learning php and Mysql a scripting language and DB i just
feel
in love with. I am currently having problem in opening file to put data
collected from clients when the purchase from an online shop. The scripts
is as
follows.
where
Ford, Mike [LSS] [EMAIL PROTECTED] writes:
You have a conceptual misconception. In effect, you need to read that
query
as:
select ft.topic_id, ft.topic_title
from ( forum_posts as fp
left join forum_topics as ft
on fp.topic_id = ft.topic_id
)
Hi,
I'm trying to find a script that does the following:
1. A user is presented with a form with a textbox for their e-mail address.
2. The user types in their e-mail addrees and submits the form.
3. A note is then sent from that server if their e-mail address , in fact,
exists.
3. If the e-mail
Jennifer Goodie [EMAIL PROTECTED] writes:
You didn't switch the aliases around, you just switched the join order.
This will provide unexpected results. In order to understand it, you
should
read up on left joins.
http://www.mysql.com/doc/en/JOIN.html
Thank you.
Jennifer Goodie [EMAIL PROTECTED] writes:
They don't. ft is aliased to forum_topics.
That's right.
ft is aliased to the forum_topics table.
The query reads:
...
$verify = select ft.topic_id, ft.topic_title from forum_posts as fp left
join forum_topics as ft on
This is what I receive via e-mail after I click submit using the following
code. As you can see - the html attribute a href= shows up and the whole
string in linked. All I was looking for is a link to the URL and the word -
Click - to be underlined showing the link.
Additionally, the value (as
The following code snippet outputs a table from a mySQL database.
In version 1, I am able to get alternating background cell colors. However,
the output gives me the same post five times.
In version 2, I am able to receive five separate posts - which is what I'm
looking for - but I'd like to
You also asked a very, very common question, i.e. how to alternate colors
in
table rows... there are a ton of websites/tutorials out there that explain
ways to do this.
---John Holmes...
Apologies for the lengthy code.
I've tried using a few
Message -
From: John W. Holmes [EMAIL PROTECTED]
To: Anthony Ritter [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, August 19, 2003 9:59 PM
Subject: Re: [PHP] mysql output
Anthony Ritter wrote:
You also asked a very, very common question, i.e. how to alternate
colors
in
table
Hi,
I'm trying to filter a word - in this case - called badword1 - to be
replaced
with asterisks.
Listed below is my .html form and .php receiving script.
I've also added the same script which gets a hardcoded string.
In the first example, the output still shows the original message _without_
Was able to get this to filter:
.
?
}
$guestbook = stripslashes($message);
$this_is_the_message=$guestbook;
$dirty_words = array(badword1,badword2,badword3);
$message = $this_is_the_message;
foreach ($dirty_words as $word){
$message = str_replace($word, , $message);
}
When calling up a page on my web with the extension of .php, I presently get
the following notice. (please see below)
Before yesterday, I had been able to load any .php page on my web.
The ISP which hosts this web is on NT.
Please advise.
Thank you.
Tony Ritter
Burhan Khalid wrote in message:
You need to edit the php.ini file (or if this is hosted, have your host
change the php.ini file).
The setting you want is : force-cgi-redirect
You need to change this to false (0) for it to work on IIS.
IIRC, it says something along those lines in the
Using MS Win98 / PHP /Apache
I'm getting a undefined function error - crypt()
The following scripts were taken from Larry Ullman's book on PHP on page
60-61.
Any advice would be helpful.
Thank you.
Tony Ritter
..
//ullmanform.html
!DOCTYPE HTML
Greg wrote in message:
I believe you need to have mcrypt installed.
-Greg
.
Not sure what mcrypt is.
Please advise.
In Ullman's textbook, it says that decrypt() and encrypt(0 fuctions will not
work if PHP is not installed as a module.
However, in his example in the
My guiding season begins in April.
Anybody out there know where I can purchase a nice mysql dolphin t-shirt?
Thank you.
TR
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jason Wong wrote in message:
Try the mysql website or the mysql list?
.
Yep. I went to the mysql site and they didn't have any promo material like
t-shirts, visors, etc.
My news server doesn't have any mysql newsgroups. SQL - yes - but not
mysql.
There was a shop
Greetings...
The following is the _third_ part of a script found in Julie Meloni's book
PHP Essentials on page 118.
The script dynmically generates a form box of field names, field types and
field sizes for a mysql table depending on what the user chooses.
My question is about syntax or logic in
This is what I was getting at.
The following is correct mysql syntax in which a comma must be added after
each field - except for the last field - in this case price:
i.e.,
.
CREATE TABLE chairs(
id int(5),
item varchar(50),
desc text,
price float
);
.
Many thanks Jason.
TR
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I'd like to use (with permission) .jpg files from a webcam from another URL.
Once that URL is opened and read via PHP as a file into my site is it
possible to resize that image? It measures 640 x 480 pixels and I would
like to reduce the image size by 25%.
Thank you.
Tony Ritter
--
PHP
Using MS Win 98 / PHP 4 and Apache.
I tried running the following script but got an undefined call to:
ImageCreate()
The following copy is located in my php.ini file...one of which is:
..
;extension=php_gd.dll
..
I tried uncommenting this line to no avail.
What is
--
Steve Magruder wrote in message :
To reduce its display size in an img tag, specify 640 * .75 for the width
(assuming 640 is for width) and 480 * .75 for the height. If you actually
want to reduce the size of the image, then look at PHP's image-related
functions (and the GD library).
In my php.ini file, this is what it looks like:
...
extension_dir = C:\php4\extensions\; directory in which the loadable
extensions (modules) reside
extension=php_gd.dll
Many thanks,
TR
--
PHP General Mailing List
1 - 100 of 170 matches
Mail list logo