[PHP-DB] Re: Mail Header Redirect

2004-10-05 Thread Amit Arora
Please note that HTTP headers are case sensitive. You should use:
?php
function mailsent()
{
header(Location: http://www.justustwo.com/vals/thankyou.html;);
exit();
}
?
The 'L' of location should be in upper case.
Amit
www.digitalamit.com
Valerie wrote:
I have an email that is sent upon submission of a form.  I need to redirect to a 
confirmation page if email is sent successfully.  I thought the problem was that my 
email headers are already being sent, but when I removed them it still did not work.  
I need to bcc as well.
headers:
?php function mailsent(){header(location: 
http://www.justustwo.com/vals/thankyou.html;);exit();}
And mailing:
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: Passing url parameters

2004-10-02 Thread Amit Arora
You can set this to anything you want.
http://www.url.com?new_field=value
And you can get the value using the
$_GET['new_field']
Amit
www.digitalamit.com
Stuart Felenstein wrote:
I swear this is not a repeat of earlier post :)
When passing variables via URL, my understanding is
that the value passed is the database column name. 
What I don't understand is the name / label part.  It
seems like the only name I can use is the same name as
the value.

i.e. 
Database column: Myfield
Value: _get[Myfield]
Name: Myfield  (this is the one I want to change, so
my database column is not identified in the url)

This make sense ?
I hope this is not off topic.  If it is my apologies.
Stuart
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: newlines to BR tag

2004-10-02 Thread Amit Arora
You can use something like this ..
$new_str = preg_replace('/(\r\n){2,20}/', \r\n, $old_str);
Amit
www.digitalamit.com
Murat Biyikli wrote:
if there are unknown number of newlines repeating like (\r\n\r\n\r\n) in a
post var and if I want to change them to a SINGLE newline, what kind of an
iteration should be used? The message may like below in DB and as you see
the \r\n newline codes may repeat severaltimes and should be changed to only
one SINGLE newline and after read from DB it will be easily coverted to BR
tag by nl2br($foo) func.
KIRKUK, Iraq (AP)\r\n\r\n - Iraqi engineers have fixed most of the damage
caused by a sabotage attack earlier this month on the main pipeline that
carries Iraqi oil to Turkey, but the country is still depending on a network
of substitute lines to export crude, an official with the North Oil Co. said
Monday. \r\n\r\n\r\n\r\n The official said 75 percent of the work has been
done but few more days are needed for the 40-inch pipeline to be ready for
exports to the Turkish port of Ceyhan. \r\nThe pumping rate is still down to
250,000 barrels a day from the normal average of 400,000 barrels, the
official said on condition of anonymity. Exports will go back to normal when
the line is fixed, he said.
SHOULD BE CHANGED LIKE (all new lines to a single newline):
KIRKUK, Iraq (AP)\r\n - Iraqi engineers have fixed most of the damage caused
by a sabotage attack earlier this month on the main pipeline that carries
Iraqi oil to Turkey, but the country is still depending on a network of
substitute lines to export crude, an official with the North Oil Co. said
Monday. \r\n The official said 75 percent of the work has been done but few
more days are needed for the 40-inch pipeline to be ready for exports to the
Turkish port of Ceyhan. \r\nThe pumping rate is still down to 250,000
barrels a day from the normal average of 400,000 barrels, the official said
on condition of anonymity. Exports will go back to normal when the line is
fixed, he said.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: What is PHPBB?

2004-10-02 Thread Amit Arora
PHPBB is a bulletin board written in PHP. It very good and completely free.
http://www.phpbb.com
Amit
www.digitalamit.com
Lic. Daniel Alfredo Betancourt Reboso wrote:
Hi folks!!!:
Somebody wrote:

for example, the phpBB web app, multiple people log into the bulletin 
board.  but the account that is used to connect to the MYSQL (in this 
case) backend is a single account that is created when you first install 
phpBB.  phpBB then uses this account to do all the work needed and logs 
that into a table so you know who posted (or edit or deleted) what post 
on the forum.

All I wanna know is what is PHPBB?. Is it some PHP thing that deals with
Database directly or is it another PHP relese?
ThankĀ“s
Regards...
Daniel..
Please excuse my englsih grammar.


INFOSOL Webmail
http://webmail.gtm.sld.cu/imp/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: String handling

2004-10-02 Thread Amit Arora
Try using the intval() function
intval('1000'); // will result in 1000
intval('1000ABC');  // will result in 1000
Amit
www.digitalamit.com
Darryl wrote:
Hay,
 

Is there a way to make a string into an integer?
I have a value coming from a textbox and I want to check if the amount in it
is  1.
 

Thanks,
Darryl

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


[PHP-DB] Re: Reducing Strings to a certain length

2004-07-19 Thread Amit Arora
You can use the 'substr' function
$reduced_string = substr($str, 0, 60);
More info available at http://www.php.net/substr
Amit Arora
http://www.digitalamit.com
Cole Ashcraft wrote:
How would you reduce a string to a specified length? Say reduce 600 to
60 or abc to ab? Is there a PHP function for this? Will I have to write
my own code?
Cole

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


[PHP-DB] Re: Multi search function (help)

2004-06-22 Thread Amit Arora
In that case you can do something like this:
$s_where = '';
foreach (array('name', 'lastname', 'nickname') as $e)
{
   $s_where .= (!empty($s_where) ? ' AND ' : '' ) . (!empty($_REQUEST[$e]) ? 
$e='$_REQUEST[$e]' : '' );
}
$result = mysql_query(SELECT id, name , lastname , m_date from users  . (!empty($s_where) ? 
 WHERE  . $s_where : '' ))
 or die(mysql_error());
HTH!
Regards,
Amit
www.digitalamit.com
Nabil wrote:
thanks .. but my question is not for isset... i m thinking consider that i
have 10 search fields... if i have to do a combination then i need a day to
right the various SQL statements

David Robley [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Nabil wrote:

hi all
Is there a way to condition your search:
-I have a form for four text boxes for search my Mysql...
-I don't want to write 4 conditions and for SQL statements incase he
decided not to search with all keywords (fields)
- I have by example : name, lastname , nickname and phone  form...
I need a way to select my records even one or more field were null
(searching only on of the above)
because the following SQL will generate null result
$name=$_POST['naame'];
$lastname=$_POST['lastname'];
$nickname=$_POST['nickname'];
$m_date=$_POST['m_dateY'];
echo $name.$lastname.$nickname.$m_date;
$sql = mysql_query(SELECT id, name , lastname , m_date from users where
name like binary '%$name%' and lastname like binary '%$lastname%'  and
nickname like binary  '%$nickname%' and m_date= YEAR('$m_date')  order
by
id ASC ) or die(mysql_error());

Thanks in advanced
Use isset to test whether the POST values are set and only include in the
query if there is a value.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php