Re: [PHP] INSERT into mysql from dynamic drop down

2004-01-07 Thread Nitin Mehta

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, January 07, 2004 12:07 PM
Subject: [PHP] INSERT into mysql from dynamic drop down


>
> Hi all,
>
>Right now i would like to INSERT the values from a dynamic drop
down
> menu into mysql database but encountered some problem here. Values in the
drop
> down menu are retrieved from DB as follows:
>
> 
>
> 
> 
>
> $sql = mysql_query("SELECT DISTINCT tutor_name FROM tutor");
> while ($row = mysql_fetch_array($sql))
> {
>  print "" .$row["tutor_name"]. "";

change it to:
print "" .$row["tutor_name"].
"";

hope that helps

>  }
> $result = $db->query($sql);
>
> ?>
> 
>
> 
>
> --
-
>
> echo $_POST["tutor_name"];
>
> INSERT statement:
>
> $sql = "INSERT INTO class (class_code, tutor_name, edu_level,
timetable_day,
> timetable_time)
> VALUES
>
('$class_code','$tutor_name','$edu_level','$timetable_day','$timetable_time'
)";
>
> --
-
>
> I am trying to POST the values and then INSERT into DB but was not able to
do
> so(all other values eg. class_code, edu_level etc...was able to be
> INSERTED into DB but not "tutor_name". So, how do i insert values into DB
from
> a dynamic drop down and where have i gone wrong???Hope to get some help
real
> soon.=)
>
> All help are greatly appreciated. Thanks in advance.
>
>
> Regards,
> Irin.
>
> -- 
> 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] Very Simple one for u all :-)

2004-01-15 Thread Nitin Mehta
i dont c any shortcomings in the syntax, may b i'm sleepy myself
but isn't it working...


- Original Message - 
From: "Dave Carrera" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 15, 2004 12:53 PM
Subject: [PHP] Very Simple one for u all :-)


> Hi List,
>
> My brain needs a kick start this morning and I ask you this basic
question.
>
> How do I do a if statement asking if 1st var = a value OR 2nd var = value
>
> I have tried this
>
> If(($var == val) || ($var2 == val2)){
>
> Blah blah
> }
>
> I think this is a if var == val AND var2 == val2 then onwards but I need
OR,
> so one or the other.
>
> Sorry this is so basic but not had enough coffee to sort this out yet,
looks
> like a bad day for me ahead :-)
>
> Thank you in advance for any help.
>
> Dave C
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004
>
>
> -- 
> 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



[PHP] su idn't working from within php

2004-01-27 Thread Nitin Mehta
hi all

i was trying to execute some commands as an authorized user from within my php script 
with

exec ("su  -c \"sudo \" 2>&1;", $output);

but it gives me 

standard in must be a tty

how can i make it work? it runs perfectly at command prompt

I even tried to ssh, but the problem is where should i copy the rsa-key generated with 
keygen, as the scripts are run as apache/http user..

Plz help me out of this

Thanx in advance
Nitin

Re: [PHP] su idn't working from within php

2004-01-27 Thread Nitin Mehta
but how would i store keys for apache?

- Original Message - 
From: "Marek Kilimajer" <[EMAIL PROTECTED]>
To: "Nitin Mehta" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, January 27, 2004 4:03 PM
Subject: Re: [PHP] su idn't working from within php


> Why do you need su? Set up sudo for apache user.
>
> Nitin Mehta wrote:
> > hi all
> >
> > i was trying to execute some commands as an authorized user from within
my php script with
> >
> > exec ("su  -c \"sudo \" 2>&1;", $output);
> >
> > but it gives me
> >
> > standard in must be a tty
> >
> > how can i make it work? it runs perfectly at command prompt
> >
> > I even tried to ssh, but the problem is where should i copy the rsa-key
generated with keygen, as the scripts are run as apache/http user..
> >
> > Plz help me out of this
> >
> > Thanx in advance
> > Nitin
>
> -- 
> 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] Error

2004-02-20 Thread Nitin Mehta
May be the cause is, that you've specified some include file with
include('somefile');

but the file doesn't exist in /usr/share/php dir, which is the default path
for include (.inc) files to be saved.

Hope that helps
Nitin

- Original Message - 
From: "John Nichel" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Saturday, February 21, 2004 10:54 AM
Subject: Re: [PHP] Error


> Please don't reply directly to me (or other members of the list) unless
> asked to do so.  When you reply off-list, the messages do not get
> archived, and will not be searchable to those who may encounter the same
> problem.  Also, please don't post HTML formatted / multi-part messages.
>   Plain text is better for everyone.
>
> Tim Trimble wrote:
> 
> > This is the page I want to open, it is the admin program for php.  Right
> > now it is set to
> > low security "config"
> > http://web.dsde.net/phpadmin/index.php
>
> It does us no good to see the output of this.  We need to see the code
> which is causing the error.  Post the code contained within 'index.php'
>
> > The directory it's in is under the apache doc directory
> > '/var/www/html/phpadmin/index.php'
>
> What are the permissions on the directory and the file?  Can your
> webserver (which is probably running as nobody/nobody) read both the
> directory and the file?
>
> -- 
> By-Tor.com
> It's all about the Rush
> http://www.by-tor.com
>
> -- 
> 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] HELP PLEASE!

2004-02-20 Thread Nitin Mehta
look at the html code, this is no problem related to php, but the HTML.

Hope that helps
Nitin

- Original Message - 
From: "3mip1s4la/Nath/Pisanty" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 21, 2004 7:24 AM
Subject: [PHP] HELP PLEASE!


> this is my first post, so please bear with me.
> 
> I'm developing a Mayan Oracle based on PHP and MySQL. the program and
> database work perfectly, and do all I want them to. however, the thing
> has a graphical interface that I built using Macromedia Fireworks and
> Dreamweaver, with some images chaning along with other things, and
> this is the part that's faulty.
> 
> the program checks whether a form has been filled. if not, it displays
> the form. if it has, it then validates, and on a false shows the form
> again. on a true, it does lots of processing and MySQL checking, and
> then shows the output page.
> 
> both form pages along with the output page are included as different
> files to facilitate graphical edition. all the snippets of actual
> human language are included in another external file, to facilitate
> addition of languages.
> 
> the form pages are both one page, form.php, which distinguishes
> between first and second filling in case of invalid data. the output
> page is called canvas.php, and right now I have canvas.php as
> completely static, and canvas2.php with all the coding needed to
> display properly. the main program, 01.php, does not send the client
> any code in itself (just the included files in their entirety, alone).
> 
> THE PROBLEM: when I load the canvas.php page independently in
> Firefox/Mozilla/Netscape and Explorer it displays perfectly. the
> problem comes when I load this file through 01.php, and then it gets
> rumbled up. I've seen this on most computers with
> Firefox/Mozilla/netscape, and not on Explorer. what the hell? any hel
> would be welcome. 
> 
> I have http://200.39.201.43/hideout/project/final/01.php pointing to
> the static canvas.php and
> http://200.39.201.43/hideout/project/final/02.php pointing to the
> dynamic canvas2.php
> 
> if you can sort this out I'll be eternally grateful. I'll post the
> programs on request - they're quite large for mailing.
> 
> thanks in advance,
> 
> 3mip1s4la
> 
> The Official Dream Theater Site - http://www.dreamtheater.net/
> ___
> Get your own Web-based E-mail Service at http://www.zzn.com
> 
> -- 
> 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



[PHP] Please dont request for receipts

2004-02-23 Thread Nitin Mehta
Dear All,

I hereby request you all; please dont attach the request for receipts when submitting 
any queries or solutions to the list.

It's hell of a task, to send or deny these requests, for someone like me, who's 
subscribed to a number of lists like this one and many others.

Regards
Nitin

Re: [PHP] I have a problem In Mail Function

2004-03-15 Thread Nitin Mehta
this is the safest method, according to me at least.

second thing is: yahoo will tackle it as a spam if it has many recepients in
to or cc or bcc

Hope it helps

Nitin

- Original Message - 
From: "Ali Ashrafzadeh" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 15, 2004 7:07 PM
Subject: [PHP] I have a problem In Mail Function


Hi
In a web application I need to send mail for each members whith a different
content . mail message must be in HTML Format and 1256 code page
I call mail() functoin in a simple loop to send multiple mail message with
differrent content.

now I want know that is any body know better method to do it ??

but I have bigest problem when I send message to yahoo mail server ,yahoo
rout my message to bulk mail and I cant solve this problem please tell me if
you have know solution.

my send mail is come below:
function send_mail($to,$subject,$message){

  $headers  = "MIME-Version: 1.0\r\n";
  $headers .= "Content-type: text/html; charset=windows-1256\r\n";

  $headers .= "From: Me <[EMAIL PROTECTED]>\r\n";
  $headers .= "Return-path: Me <[EMAIL PROTECTED]>\r\n";
  $headers .= "Reply-To: Me <[EMAIL PROTECTED]>\r\n";
//  $headers .= "Bcc: $to \r\n";

  if (mail($to, $subject, $message, $headers))
print("$to Send Ok!");
  else
print("$to Send Problem!");
}

thanks

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



Re: [PHP] help with storing multiple values in session variables.

2004-03-15 Thread Nitin Mehta
Arer you using session_destroy(), where your script ends...

if it's not the case, try using cookies to destroy sessio after a period of
time.

Hope that helps..
Nitin

- Original Message - 
From: "Vimala S.P." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 15, 2004 5:25 PM
Subject: [PHP] help with storing multiple values in session variables.


>
> Hi,
>
> I have php configured to use sessions. I have a web-database
> application and have the following problem with sessions
>
>
> I fetch values from database and these values get passed
> across forms either with POST for submit opion OR GET with href.  Now i
> have problem passing unicode strings with href and GET. Embedding unicode
> values with get does not work out. I cannot use POST method here since  i
> navigate  with href. So i tried assiging the value to a SESSION variable.
> For the first time the application works, but if i refresh and try with a
> different href link, always the first assigned value only gets passed?
> What do i do to change the value of session variable in the same session?
>
> I cannot use global variables since, i have register globals off?
>
> Is there any way of passing unicode strings properly with href and get?
>
> I'm almost in completion where this problem croped? Any idea how to solve.
>
> -vimala/.
>
> -- 
> 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



[PHP] how to reset PHP_AUTH vars

2004-04-03 Thread Nitin Mehta
Hello all,

I'm facing this problem and tried many solutions with no success. How do I reset the 
value of PHP_AUTH_USER and PW. 

I've tried session_destroy(), but as I'm not starting any session at all, it's not 
worth.

I've tried using random value to include in header.

Now what should I do? 

Thanx in adv for any suggestion/help
Nitin

Re: [PHP] how to reset PHP_AUTH vars

2004-04-03 Thread Nitin Mehta
Hello,

Thanks for your reply. but what I'm looking for is, yes logoff the user, but
not making him/her click some link. I've this page and I want it to ask for
username & password whenever a user comes/comes back. Any suggestions?

Thanks anyway
Nitin

- Original Message - 
From: "Marek Kilimajer" <[EMAIL PROTECTED]>
To: "Nitin Mehta" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Saturday, April 03, 2004 3:54 PM
Subject: Re: [PHP] how to reset PHP_AUTH vars


> Nitin Mehta wrote:
> > Hello all,
> >
> > I'm facing this problem and tried many solutions with no success. How do
I reset the value of PHP_AUTH_USER and PW.
> >
> > I've tried session_destroy(), but as I'm not starting any session at
all, it's not worth.
> >
> > I've tried using random value to include in header.
> >
> > Now what should I do?
> >
> > Thanx in adv for any suggestion/help
> > Nitin
>
> Are you trying to logoff a user using http autheniation? Provide a
> logoff link in this form:
>
> http://nonexistentuser:[EMAIL PROTECTED]">Logoff
>
> This sets the login credentials in the browser to nonexisting user, so
> your code will return 401 response and the browser will ask the user for
> username and password again.
>
> I'm not sure if this method works in IE with the latest security patch
> installed. These should ignore username and password in links.
>

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



Re: [PHP] how to reset PHP_AUTH vars

2004-04-04 Thread Nitin Mehta
but it's not happening.

- Original Message - 
From: "Burhan Khalid" <[EMAIL PROTECTED]>
To: "Nitin Mehta" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, April 04, 2004 1:58 PM
Subject: Re: [PHP] how to reset PHP_AUTH vars


> Nitin Mehta wrote:
> > Hello,
> >
> > Thanks for your reply. but what I'm looking for is, yes logoff the user,
but
> > not making him/her click some link. I've this page and I want it to ask
for
> > username & password whenever a user comes/comes back. Any suggestions?
>
> I believe this is the default behavior, unless the user saves the
> credentials locally.
>

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