[PHP] Page Rederection Problems

2003-03-13 Thread Kelly Protsko
Basically what I am doing is having a post  call a page with the
following code to email the form contents. 
I want the page to redirect back to the page it was sent from after the
mail has been sent.   The top mailing part works fine but when I put the
header redirect in at the bottom I get an error on my post saying the
page doesn't exist anymore. 
Any idea what would be causing this?
 
 
$formcontent =  $_POST[content];
 $toaddress = [EMAIL PROTECTED];
 $subjectline = $_POST[subject];
 $headers = From: $_POST[email];
 mail( $toaddress, $subjectline, $formcontent, $headers);
 
header(location: http://www.website.com http://www.website.com/ );
 
Thanks 
 
Kelly


RE: [PHP] php and mysql

2003-02-20 Thread Kelly Protsko
I'm not sure what you mean by cut the records at 1/4, if you mean only
bringing back 1/4 of the rows you could use the LIMIT clause in your sql
statement and give it a number of rows you want brought back.  

To sort alphabetically just use the order by command in SQL

So your query would look like this
SELECT * from Table order by column_name Limit 100

This will bring back 100 rows that are order by the column you specify.

Kelly

-Original Message-
From: Tyler Durdin [mailto:[EMAIL PROTECTED]] 
Sent: February 20, 2003 10:45 AM
To: [EMAIL PROTECTED]
Subject: [PHP] php and mysql

When using a php script to pull recorda from a db how can I cut the
records 
at 1/4 of the total and arrange them alaphabetically according to a
certain 
field? Thanks in advance.





_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus


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



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




RE: [PHP] simple ereg question

2003-02-20 Thread Kelly Protsko
Did you try this syntax yet?
The  with the ^ and $search matching beginning and end
I tested out the code myself and it worked fine.
http://www.theoutersphere.com/testing/testnumbers.php  


//here is the exact code that I used

echo $_POST[vari] .br;
  if (eregi('^[0-9]+$',$_POST[vari]) || $_POST[vari] == null)
  {
   echo  continue This is a valid number;
  }
   else
 {
   die(Non-numeric data entered in grass entry field(s).);
 }


Kelly
-Original Message-
From: Robert E. Harvey, M.D. [mailto:[EMAIL PROTECTED]] 
Sent: February 20, 2003 12:34 PM
To: php; Robert Harvey
Subject: [PHP] simple ereg question

Hello folks,

I'd like to verify input data transferred from a form and make sure it 
is numeric data or null before my program executes.  I am using this 
syntax, which doesn't work:

for ($i=1;$i=3;$i++)
{
  if (ereg('[0-9]+','$_POST[gamt_$i]'))
 {
   continue;
 }
  else
{
  die(Non-numeric data entered in grass entry field(s).);
}
}

No matter what I put in the fields, the program dies and I get the death

message.  What can I do to fix this?

TIA

Bob Harvey


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




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




RE: [PHP] string manipulation

2003-02-20 Thread Kelly Protsko
Use strrpos() which will find the last occurrence of something in a
string then  just use substr() to pull everything from that point on in
the string.

Kelly
-Original Message-
From: Gregory Heinrichs [mailto:[EMAIL PROTECTED]] 
Sent: February 20, 2003 5:13 PM
To: [EMAIL PROTECTED]
Subject: [PHP] string manipulation

little help please, looking for correct functions to use to search for
the
last occurrence of a character in a string and truncate everything in
front of it including the searched for character.



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




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




RE: [PHP] file not opening in internet explorer

2003-02-19 Thread Kelly Protsko
You may also need world execute on the file before it will work.  I've
had this problem myself with certain files and they would only show up
once I had world execute on them. rw-r-r-x

IF you are looking for a good tutorial there is an awesome book PHP and
MySQL web development by welling and Thomson. 

You can also try my website out, it only has some basics on it right
now, I haven't had any time lately to write any more information but I
will shortly. 
www.theouterphere.com

Kelly

-Original Message-
From: DIKSHA NEEL [mailto:[EMAIL PROTECTED]] 
Sent: February 19, 2003 12:27 AM
To: [EMAIL PROTECTED]
Subject: [PHP] file not opening in internet explorer

hi all,


$fp = fopen(\bdoi_change\sundar.html, w);

i am able to write to this file through my php page
filecheck.php and even am able to read the written contents.

but when i enter http://192.168.0.1/bdoi_change/sundar.html
in my internet explorer address bar, it says the page cannot
be displayed.
the file permissions are rw-r-r

thanks in advance,

regards,
diksha.






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




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




RE: [PHP] excluding same field values in mysql

2003-02-19 Thread Kelly Protsko
If you only want one email do a select distinct email that way only one
email address will be brought back from you query.

$query=mysql_query(select company, Email from members);

$query = mysql_query(select company, distinct(Email) from members);

if you want a good book for this check out MySQL by Paul DuBois. 

-Original Message-
From: Sunfire [mailto:[EMAIL PROTECTED]] 
Sent: February 19, 2003 6:23 PM
To: [EMAIL PROTECTED]
Subject: [PHP] excluding same field values in mysql

hi
im making a mailing system for a company. i have to find all email
addresses
in a table and send email to all of them. the problem comes in when more
than 1 company has the same email address (owned by same person). what i
have to do is if more than 1 company has the same email address only use
one
of them that are the same for the email not all of them..
example:
company1 email: [EMAIL PROTECTED]
company2 email: [EMAIL PROTECTED]

in the example above i want to only use one of those addresses since
they
would end up getting 2 emails and that wouldnt look right..

code i have so far is:
?php
//connect to db stuff here
$query=mysql_query(select company, Email from members);
while($mail=mysql_fetch_array($query)){
mail($mail[Email], $subject, $message, from: $sender);
echo mail was sent to: $mail[company]br;
}
echo a href=\main.php\go back to main menu/a;
?

works fine except only using an email address 1 time if more than one of
the
same email..


anybody have any ideas how to fix this?

tnx



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003


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




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




RE: [PHP] Simple ereg question

2003-02-19 Thread Kelly Protsko
You had it pretty close  but try and make a few minor changes to it I've
tested the function below and it works for what you are trying to do. I
am not sure of a way to test for the null with eregi other than putting
and or statement in.  

if (eregi('^[0-9]+$', $_POST[gamt_$i]) || $_POST[gamt_$i] == null){

}

Kelly

-Original Message-
From: Robert E. Harvey, M.D. [mailto:[EMAIL PROTECTED]] 
Sent: February 19, 2003 6:54 PM
To: php
Subject: [PHP] Simple ereg question

Hello folks,

I'd like to verify input data transferred from a form and make sure it 
is numeric data or null before my program executes.  I am using this 
syntax, which doesn't work:

for ($i=1;$i=3;$i++)
{
   if (ereg('[0-9]+','$_POST[gamt_$i]'))
  {
continue;
  }
   else
 {
   die(Non-numeric data entered in grass entry field(s).);
 }
}

No matter what I put in the fields, the program dies and I get the death

message.  What can I do to fix this?

TIA

Bob Harvey


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




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




RE: [PHP] PHP fileperms

2003-02-18 Thread Kelly Protsko
Here is how the numbers work for file permissions.

644 = rw-r--r--

0 --- no access 
1 --x execute 
2 -w- write 
3 -wx write and execute 
4 r-- read 
5 r-x read and execute 
6 rw- read and write 
7 rwx read write execute

-Original Message-
From: DIKSHA NEEL [mailto:[EMAIL PROTECTED]] 
Sent: February 18, 2003 11:30 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP fileperms

HI ALL,

i am getting the result as 644 when i execute the following
command.
can anyone please tell me what file permission does 644
stand for and what should i do to make my file readable?

$filename = '\bdoi_change\sundar.html';

printf(%o,(fileperms(\bdoi_change\andar.html)  0777));


regards,
diksha.


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




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