Re: [PHP] Check Boxes and updating records. (HELP ME....)

2002-02-02 Thread Yogesh

Hi! I've developed something like this recently, i'll explain to you how
i proceeded, maybe that'll help you to solve your problem :-)

Here goes:
I have the following tables:
1. users (primary key: user_id)
2. categories (primary key: category_id)

Now, the users may be in different categories, i.e. there is a many-to-many
relationship between users and categories, thus i create the table
user_category which contains the following fields:
1.user_id
2.category_id

Now, for the part where i display the users for modification, i first query
my table users, to display all my users

$all = "select * from users";
$result = mysql_query($all) or die(mysql_error());
while ($row = mysql_fetch_array($result))
{
// i have a link on each user, e.g.
echo '";
}

}


This should do the trick!
You can try it and modify it to suit your needs. :-)
Now you can check new values and post your form to process the modification.

If that still doesn't work, please let me know, and i'll give you the
solution on Monday cos my stuffs are on my pc at work :-)

Regards,

Yogesh Mahadnac,
Web Developer,
Sohonet Information Technology Ltd,
49, Maurel Lane,
Charles Lees Street,
Curepipe,
Mauritius.
Tel : +230 6704066
Fax: +230 6700511


-- 
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]




[PHP] Date

2002-03-08 Thread Yogesh

Hi! can someone please tell me how to get the current date? Well, the thing is, i 
want to manage a subscription, so, in my database, i have a field called 
date_registered which will be assigned to the date that any user registers... so, i 
have to capture that date value which can vary depending on when a user registers.

So, let's say $date1 will be assigned to that value.


Now, how can i perform addition with the date so that i mail that user 3 months after 
the date he registered that his registration has expired?

Therefore, i'll be having 2 dates

$date1 = "the date the user registers";
$date2 = $date1 + 3months


can someone please help me with that?

Thanks and regards,
Yogesh Mahadnac



[PHP] Array from one form to other?

2011-02-19 Thread Yogesh
Hello,

I have two forms. One form helps read an input file into an array. And the
other form needs this array as an input.
I am able to read the input file into an array, but how do I pass it over to
the other form.

Both forms have PHP file as 'action'.

Please help. Thanks

- Yogesh


Re: [PHP] Array from one form to other?

2011-02-19 Thread Yogesh
POST





On Sat, Feb 19, 2011 at 9:44 PM, Daniel Brown  wrote:

> On Sat, Feb 19, 2011 at 19:38, Yogesh  wrote:
> > Hello,
> >
> > I have two forms. One form helps read an input file into an array. And
> the
> > other form needs this array as an input.
> > I am able to read the input file into an array, but how do I pass it over
> to
> > the other form.
> >
> > Both forms have PHP file as 'action'.
>
> What's the method?  GET or POST?
>
> --
> 
> Network Infrastructure Manager
> Documentation, Webmaster Teams
> http://www.php.net/
>


Re: [PHP] Array from one form to other?

2011-02-20 Thread Yogesh
Hi Tamara,


I don't entirely understand this; Dan Brown gave you solution to use curl to
>> pass the array to the second "form" (do you mean script here?). That would
>> certainly work, but I'm wondering if it wouldn't be more secure to spool out
>> the array to a file from the first script after it has processed it, and
>> then read it in to the second script when it starts. This assumes the two
>> scripts are running on the same server, of course. The second script could
>> be called after the first script finishes by using a header redirect. I'm
>> curious about people's thought on the security and efficacy of different
>> ways of sharing data between scripts when you're not using sessions.
>
>
>
I am quite new to PHP. (I am having trouble to understand how HTML, PHP and
Javascript work together). Right now I just wanted to get the job done. But
if you can suggest me a more efficient way to do it, I will definitely look
into it.

Thanks,

-Yogesh


[PHP] SMS

2002-01-14 Thread Yogesh Mahadnac

Hi everyone! I'd be grateful if someone could please tell me a link where I can 
find a good tutorial on how to develop a SMS tool with PHP, or if somebody has already 
developed something like it, or if there are any experts around, please give me some 
information about it.

Thanks and regards,
Yogesh Mahadnac.



[PHP] Search Engine

2002-01-15 Thread Yogesh Mahadnac

Hi all! I want to develop a search engine in PHP for a portal that I'm working on 
at the moment, and I'd be glad if someone could please show me how to do it, or if 
anyone knows of a link where i can find a tutorial for that.
Thanks and regards,
Yogesh Mahadnac



[PHP] Help wih select boxes pls

2001-12-07 Thread Yogesh Mahadnac

Hi! I'm trying to make dynamically related select boxes (e.g. i have a 'State' 
select box, which, when i select an item in it, it automatically refreshes the select 
box 'Cities' containing a list of cities in that particular chosen state) 

Anyone can help me with this please?

Thanks



[PHP] HELP TO VALIDATE CHECKBOXES

2001-12-21 Thread Yogesh Mahadnac

  Hi! I'm having some problems with checkboxes at the moment, and i'd be glad if you 
could help me solve it... i'll give a brief explanation of the situation first so that 
you can understand what i'm talking about :-)

  I have the tables 'User' (containing userid,etc), 'Category' (containing 
category_id) and the table User_Category (user)id and category_id) since i have a 
many-to-many relationship between user and category

  Now, when i add a new user, i display a list of the category names, with a checkbox 
next to each, so that the user can check more than 1 category

  Now, the problem: let's say i want to modify a particular user i thus have a 
link on the user, e.g.

'.$row["name"].'


  Now, on modify.php, i want to display all the values that the user posted initially 
(lastname, firstname, username, password, etc...)
Here i also want to display all the category names with a checkbox next to each (this 
is easy!)

$sql = "SELECT * FROM category";
$result = mysql_query($sql);

// (this is referenced as LOOP1 below)
while ($row = mysql_fetch_array($result))
{
 echo $row["name"];
 echo '';
}



 Now, to get the values of category_id that the user previously selected, i just need 
to do 

$qry = "SELECT category_id FROM user_category WHERE user_id='$id'";
$result2 = mysql_query($qry);

// for example, i have 8 records in my table category, therefore i'll have 8 
checkboxes with id values 1, 2...8
// now assume that, when filling his form, the user clicked the checkboxes with id 
values 1, 2, 3, 4, 5 only

NOW ==>>> THE PROBLEM: (finally we reach there!!!) :-)

HOW do i modify LOOP1 so that i loop the second query $qry to validate which value of 
category_id in each checkbox corresponds to the values returned by my query $qry, and 
i check ONLY THOSE checkboxes, and leave the other checkboxes as unchecked?

I'd be grateful if you could help
Thanks and regards,
Yog.