Re: [PHP-DB] Passing variables between html forms and updating sql table

2003-09-17 Thread Jason Wong
On Wednesday 17 September 2003 22:34, David wrote:

 I am putting together some pages where I will be able to update mysql
 database using php pages. I am having a problem with updating. I put a
 record into textboxes and when I press submit it passes the values to the
 next page. The problem I am having is updating the values. Here is my
 attempt

[snip]

And can you describe what this problem is? 

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
I learned to play guitar just to get the girls, and anyone who says they
didn't is just lyin'!
-- Willie Nelson
*/

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



Re: [PHP-DB] Passing variables between html forms and updating sql table

2003-09-17 Thread David
Dear Jason

Here is my original problem below as I am treated as spam. When it
reaches the next page, when the update query is run, it does not update
the database.

Regards

David
Anagram Systems
http://www.anagram-sys.co.uk/ http://www.web-planets.com/davec/techsitedb/

Dear all

I am putting together some pages where I will be able to update mysql
database using php pages. I am having a problem with updating. I put a
record into textboxes and when I press submit it passes the values to the
next page. The problem I am having is updating the values. Here is my
attempt

?php

  $MySQLLink = mysql_pconnect (davecp4, root, )
   or die(Could not attach to database. Please try later or contact
[EMAIL PROTECTED]);
   mysql_select_db($database_name, $MySQLLink) or die(ERROR--CAN'T CONNECT
TO DB);

   $result = mysql_query(SELECT * FROM .$table_name) or die(Error:  .
mysql_error());

   for($i = 1; $i  mysql_num_fields($result); $i++)
   {
$fieldname = mysql_field_name($result, $i);
$fieldname2 = $.$fieldname;
mysql_query(UPDATE $table_name SET $fieldname=$fieldname2 WHERE id
=$id);
echo $fieldname.br.$fieldname2.br;
  }


?

-- Kind Regards David Anagram Systems http://www.anagram-sys.co.uk/
http://www.web-planets.com/davec/techsitedb/




Jason Wong wrote:
 On Wednesday 17 September 2003 22:34, David wrote:
 
 
I am putting together some pages where I will be able to update mysql
database using php pages. I am having a problem with updating. I put a
record into textboxes and when I press submit it passes the values to the
next page. The problem I am having is updating the values. Here is my
attempt
 
 
 [snip]
 
 And can you describe what this problem is? 
 

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



Re: [PHP-DB] Passing variables between html forms and updating sql table

2003-09-17 Thread Jason Wong
On Wednesday 17 September 2003 23:42, David wrote:

 Here is my original problem below as I am treated as spam. When it
 reaches the next page, when the update query is run, it does not update
 the database.

*sigh*

Could you please describe *exactly* what happens. Eg does your error messages 
kick-in? Does the php error logs show anything? etc

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
I am two fools, I know, for loving, and for saying so.
-- John Donne
*/

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



Re: [PHP-DB] Passing variables between html forms and updating sql table

2003-09-17 Thread David
Dear Jason

I need a secure way of updating mysql on the website, phpadmin is not
secure enough

So I have created these pages in order:
A page to choose the databases
Next a page to choose the table
Next a list of the records in the table
Next to edit the page using textboxes and textareas
I pass the database name, table name, and the records to change to the
page with the problem.
The passed values have the same field name as the record in the database
e.g. id
The problem I can see is that I cannot access the passed variables, that
is why the update is failing , although I do not get any errors.

I am trying to access the passed variables with this line $fieldname2 =
$.$fieldname;

Does this make sense

David



?php

  $MySQLLink = mysql_pconnect (davecp4, root, )
   or die(Could not attach to database. Please try later or contact
[EMAIL PROTECTED]);
   mysql_select_db($database_name, $MySQLLink) or die(ERROR--CAN'T CONNECT
TO DB);

   $result = mysql_query(SELECT * FROM .$table_name) or die(Error:  .
mysql_error());

   for($i = 1; $i  mysql_num_fields($result); $i++)
   {
$fieldname = mysql_field_name($result, $i);
$fieldname2 = $.$fieldname;
mysql_query(UPDATE $table_name SET $fieldname=$fieldname2 WHERE id
=$id);
echo $fieldname.br.$fieldname2.br;
  }


?




Jason Wong wrote:
 On Wednesday 17 September 2003 23:42, David wrote:
 
 
Here is my original problem below as I am treated as spam. When it
reaches the next page, when the update query is run, it does not update
the database.
 
 
 *sigh*
 
 Could you please describe *exactly* what happens. Eg does your error messages 
 kick-in? Does the php error logs show anything? etc
 

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



Re: [PHP-DB] Passing variables between html forms and updating sql table

2003-09-17 Thread Jason Wong
On Thursday 18 September 2003 01:03, David wrote:

 I need a secure way of updating mysql on the website, phpadmin is not
 secure enough

Why is phpadmin not secure enough? Or to put it another way, what are you 
doing differently that makes it more secure than php admin? 

 So I have created these pages in order:
 A page to choose the databases
 Next a page to choose the table
 Next a list of the records in the table
 Next to edit the page using textboxes and textareas
 I pass the database name, table name, and the records to change to the
 page with the problem.
 The passed values have the same field name as the record in the database
 e.g. id
 The problem I can see is that I cannot access the passed variables, that
 is why the update is failing , 

Most likely register_globals (google or search archive or RTFM).

 although I do not get any errors.

Have you set the highest level of error reporting? And set it to display 
errors (or log to file)? 

 I am trying to access the passed variables with this line $fieldname2 =
 $.$fieldname;

Not sure what you're trying to do here but ...

 ?php

   $MySQLLink = mysql_pconnect (davecp4, root, )
or die(Could not attach to database. Please try later or contact
 [EMAIL PROTECTED]);
mysql_select_db($database_name, $MySQLLink) or die(ERROR--CAN'T CONNECT
 TO DB);

$result = mysql_query(SELECT * FROM .$table_name) or die(Error:  .
 mysql_error());

for($i = 1; $i  mysql_num_fields($result); $i++)
{
 $fieldname = mysql_field_name($result, $i);
 $fieldname2 = $.$fieldname;
 mysql_query(UPDATE $table_name SET $fieldname=$fieldname2 WHERE id
 =$id);
 echo $fieldname.br.$fieldname2.br;

... does the above echo display what you expected it to?


-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Every time I think I know where it's at, they move it.
*/

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



RE: [PHP-DB] Passing variables between html forms and updating sql table

2003-09-17 Thread Jennifer Goodie
 I need a secure way of updating mysql on the website, phpadmin is not
 secure enough
[snip]
   $MySQLLink = mysql_pconnect (davecp4, root, )
or die(Could not attach to database. Please try later or contact
 [EMAIL PROTECTED]);


Please tell me you just took the password out of that for posting purposes
and root isn't really set up without a password.  If root really doesn't
need a password, I'd say phpMyadmin is the least of your security concerns.

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



RE: [PHP-DB] passing variables

2002-12-09 Thread Edward Peloke
That's just it, for some reason the variable isn't being set.

Here is the code:
When the page loads, the form loads under
  if (!$login_clients and !$register_clients){

When I click the minus.gif image, I want the page to reload with the other
code but it still loads the form under
  if (!$login_clients and !$register_clients){

If I use isset it does the same thing.

Thanks!
Eddie


?
require(template_1.inc);
?

!-- If this page is opened from the template, then show the log-in
screen --
A HREF=login_clients.phpimg src=images\minus.gif
name=register_clients/a

? if (!$login_clients and !$register_clients){
?
 center
 form name=login method=post action=login_clients.php
  TABLE width=480 bgColor=black
  TBODY
  TR bgColor=#363636
   TDFONT face=arial color=#fffafa size=2BUser
Name:/B/font
   TDinput name=uname type=text id=uname/td/tr
  TR bgColor=#363636
   TDFONT face=arial color=#fffafa
size=2BPassword:/B/font
   TDinput name=pword type=password id=pword/td
  /tr
  /table
  INPUT type=image src=images/bidsubmit.gif border=0

/form
 /center
? }

?
!-- If the user clicks the 'Register' button, show this --
? if ($register_clients){

 ?
center
  form name=nclient method=post action=newclient.php
  TABLE width=480 bgColor=black
TR bgColor=#363636
  tdFONT face=arial color=#fffafa size=2strongFirst
Name:/strong/font/td
  tdinput name=fname type=text id=fname/td
/tr
tr
  td FONT face=arial color=#fffafa size=2strongLast Name:
/strong/font/td
  tdinput name=lname type=text id=lname/td
/tr
TR bgColor=#363636
  td FONT face=arial color=#fffafa
size=2strongAddress:/strong/font/td
  tdinput name=address type=text id=address/td
/tr
TR bgColor=#363636
  td FONT face=arial color=#fffafa size=2strongCity:
/strong/font/td
  tdinput name=city type=text id=city/td
/tr
TR bgColor=#363636
  TR bgColor=#363636
  td FONT face=arial color=#fffafa size=2strongState:
/strong/font/td
  tdinput name=state type=text id=state/td
/tr
TR bgColor=#363636
  TR bgColor=#363636
  td FONT face=arial color=#fffafa size=2strongZip
/strong/font/td
  tdinput name=zip type=text id=zip/td
/tr
TR bgColor=#363636

  td FONT face=arial color=#fffafa size=2strongTelephone
Number:/strong/font/td
  tdinput name=phone type=text id=phone/td
/tr
TR bgColor=#363636
  td FONT face=arial color=#fffafa size=2strongFax
Number:/strong/font/td
  tdinput name=fax type=text id=fax/td
/tr
TR bgColor=#363636
  td FONT face=arial color=#fffafa size=2stronge-mail
address:/strong/font/td
  tdinput name=email type=text id=email/td
/tr
TR bgColor=#363636
  td FONT face=arial color=#fffafa size=2strongConfirm
E-mail:/strong/font/td
  tdinput name=cemail type=text id=cemail/td
/tr
TR bgColor=#363636
  td FONT face=arial color=#fffafa
size=2strongUsername:/strong/font/td
  tdinput name=uname type=text id=uname/td
/tr
TR bgColor=#363636
  td FONT face=arial color=#fffafa
size=2strongPassword:/strong/font/td
  tdinput name=pword type=text id=pword/td
/tr
  /table
  INPUT type=image src=images/bidsubmit.gif border=0
/form
/center
?
}
?




?
require(template_2.inc);
?

-Original Message-
From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 10:09 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] passing variables


I think you want:

if (isset($variable)){}

 Ryan

-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 8:33 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] passing variables


Hello all,

I have a login/register screen for my php/mysql db.  When the page opens,
the user sees the log in screen but I have a button and reloads the same
page, hopefully with the register screen.  I know I can simply check to see
if a variable is set with

if ($variable){} .  This does not seem to work when I give an image a name
and link it to the same page.  The image is named register and it links back
to the same page, so the page loads, I click on the register image , the
page reloads but the variable is not set.


Any ideas?

Thanks,
Eddie


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


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


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




RE: [PHP-DB] passing variables

2002-12-09 Thread Ryan Jameson (USA)
You may need to look in the global array. The more recent versions of PHP default to 
register_globals off ... which means that form variables do not turn into individual 
variables, but they are still in their respective arrays $_SERVER,$_GET,$_POST ... 
depending on the method your using it will be in either get or post.

 Ryan



-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 9:03 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] passing variables


That's just it, for some reason the variable isn't being set.

Here is the code:
When the page loads, the form loads under
  if (!$login_clients and !$register_clients){

When I click the minus.gif image, I want the page to reload with the other
code but it still loads the form under
  if (!$login_clients and !$register_clients){

If I use isset it does the same thing.

Thanks!
Eddie


?
require(template_1.inc);
?

!-- If this page is opened from the template, then show the log-in
screen --
A HREF=login_clients.phpimg src=images\minus.gif
name=register_clients/a

? if (!$login_clients and !$register_clients){
?
 center
 form name=login method=post action=login_clients.php
  TABLE width=480 bgColor=black
  TBODY
  TR bgColor=#363636
   TDFONT face=arial color=#fffafa size=2BUser
Name:/B/font
   TDinput name=uname type=text id=uname/td/tr
  TR bgColor=#363636
   TDFONT face=arial color=#fffafa
size=2BPassword:/B/font
   TDinput name=pword type=password id=pword/td
  /tr
  /table
  INPUT type=image src=images/bidsubmit.gif border=0

/form
 /center
? }

?
!-- If the user clicks the 'Register' button, show this --
? if ($register_clients){

 ?
center
  form name=nclient method=post action=newclient.php
  TABLE width=480 bgColor=black
TR bgColor=#363636
  tdFONT face=arial color=#fffafa size=2strongFirst
Name:/strong/font/td
  tdinput name=fname type=text id=fname/td
/tr
tr
  td FONT face=arial color=#fffafa size=2strongLast Name:
/strong/font/td
  tdinput name=lname type=text id=lname/td
/tr
TR bgColor=#363636
  td FONT face=arial color=#fffafa
size=2strongAddress:/strong/font/td
  tdinput name=address type=text id=address/td
/tr
TR bgColor=#363636
  td FONT face=arial color=#fffafa size=2strongCity:
/strong/font/td
  tdinput name=city type=text id=city/td
/tr
TR bgColor=#363636
  TR bgColor=#363636
  td FONT face=arial color=#fffafa size=2strongState:
/strong/font/td
  tdinput name=state type=text id=state/td
/tr
TR bgColor=#363636
  TR bgColor=#363636
  td FONT face=arial color=#fffafa size=2strongZip
/strong/font/td
  tdinput name=zip type=text id=zip/td
/tr
TR bgColor=#363636

  td FONT face=arial color=#fffafa size=2strongTelephone
Number:/strong/font/td
  tdinput name=phone type=text id=phone/td
/tr
TR bgColor=#363636
  td FONT face=arial color=#fffafa size=2strongFax
Number:/strong/font/td
  tdinput name=fax type=text id=fax/td
/tr
TR bgColor=#363636
  td FONT face=arial color=#fffafa size=2stronge-mail
address:/strong/font/td
  tdinput name=email type=text id=email/td
/tr
TR bgColor=#363636
  td FONT face=arial color=#fffafa size=2strongConfirm
E-mail:/strong/font/td
  tdinput name=cemail type=text id=cemail/td
/tr
TR bgColor=#363636
  td FONT face=arial color=#fffafa
size=2strongUsername:/strong/font/td
  tdinput name=uname type=text id=uname/td
/tr
TR bgColor=#363636
  td FONT face=arial color=#fffafa
size=2strongPassword:/strong/font/td
  tdinput name=pword type=text id=pword/td
/tr
  /table
  INPUT type=image src=images/bidsubmit.gif border=0
/form
/center
?
}
?




?
require(template_2.inc);
?

-Original Message-
From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 10:09 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] passing variables


I think you want:

if (isset($variable)){}

 Ryan

-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 8:33 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] passing variables


Hello all,

I have a login/register screen for my php/mysql db.  When the page opens,
the user sees the log in screen but I have a button and reloads the same
page, hopefully with the register screen.  I know I can simply check to see
if a variable is set with

if ($variable){} .  This does not seem to work when I give an image a name
and link it to the same page.  The image is named register and it links back
to the same page, so the page loads, I click on the register image , the
page reloads but the variable is not set.


Any ideas?

Thanks,
Eddie


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

RE: [PHP-DB] passing variables

2002-12-09 Thread Jonathan
One of many possible things.

Dependent on the version of PHP you are using, you might have
register_globals set to off in your php.ini file, which is preferable.
In which case you'll have to use

If($_REQUEST['variable'])

Or

If(isset($_REQUEST['variable']))

Second possible is:

I've never really used an image within a link to submit a form.  What I
usually do is make the image a submit button, e.g.,input type=image
src=path to your image height=XX width=XX border=0 You could
name it or create a hidden field input type=hidden name=register
value=register

Then upon form submission (form action=? Echo $_SERVER['PHP_SELF']
?)
You would look for register

If(isset($_REQUEST['register']))
{
//whatever
}
hope one of them works.

-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]] 
Sent: Monday, December 09, 2002 9:33 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] passing variables

Hello all,

I have a login/register screen for my php/mysql db.  When the page
opens,
the user sees the log in screen but I have a button and reloads the same
page, hopefully with the register screen.  I know I can simply check to
see
if a variable is set with

if ($variable){} .  This does not seem to work when I give an image a
name
and link it to the same page.  The image is named register and it links
back
to the same page, so the page loads, I click on the register image , the
page reloads but the variable is not set.


Any ideas?

Thanks,
Eddie


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


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




RE: [PHP-DB] passing variables

2002-12-09 Thread Ryan Jameson (USA)
I missed the part where he was using an image. Without a value property, I don't see 
how it could pass anything at all

A note on my recent post, to emulate register_globals do this:

if (!empty($_SERVER))
  extract($_SERVER);
  
if (!empty($_GET)) {
extract($_GET);
} else if (!empty($HTTP_GET_VARS)) {
extract($HTTP_GET_VARS);
}

if (!empty($_POST)) {
extract($_POST);
} else if (!empty($HTTP_POST_VARS)) {
extract($HTTP_POST_VARS);
}


This registers all of the different arrays.

 Ryan

-Original Message-
From: Jonathan [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 8:40 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] passing variables


One of many possible things.

Dependent on the version of PHP you are using, you might have
register_globals set to off in your php.ini file, which is preferable.
In which case you'll have to use

If($_REQUEST['variable'])

Or

If(isset($_REQUEST['variable']))

Second possible is:

I've never really used an image within a link to submit a form.  What I
usually do is make the image a submit button, e.g.,input type=image
src=path to your image height=XX width=XX border=0 You could
name it or create a hidden field input type=hidden name=register
value=register

Then upon form submission (form action=? Echo $_SERVER['PHP_SELF']
?)
You would look for register

If(isset($_REQUEST['register']))
{
//whatever
}
hope one of them works.

-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]] 
Sent: Monday, December 09, 2002 9:33 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] passing variables

Hello all,

I have a login/register screen for my php/mysql db.  When the page
opens,
the user sees the log in screen but I have a button and reloads the same
page, hopefully with the register screen.  I know I can simply check to
see
if a variable is set with

if ($variable){} .  This does not seem to work when I give an image a
name
and link it to the same page.  The image is named register and it links
back
to the same page, so the page loads, I click on the register image , the
page reloads but the variable is not set.


Any ideas?

Thanks,
Eddie


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


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


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




Re: [PHP-DB] passing variables

2002-12-09 Thread Jason Wong
On Tuesday 10 December 2002 00:03, Edward Peloke wrote:
 That's just it, for some reason the variable isn't being set.

 Here is the code:
 When the page loads, the form loads under
   if (!$login_clients and !$register_clients){

 When I click the minus.gif image, I want the page to reload with the other
 code but it still loads the form under
   if (!$login_clients and !$register_clients){

 If I use isset it does the same thing.

Quickest solution, stick a phpinfo() in the first line your code to see 
exactly what is and isn't being set.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
Did you hear that there's a group of South American Indians that worship
the number zero?

Is nothing sacred?
*/


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




RE: [PHP-DB] passing variables

2002-12-09 Thread Hutchins, Richard
Eddie, whenever I start having problems with variables, I drop this code in:

begin code snip...
?
  // these lines format the output as HTML comments 
  // and call dump_array repeatedly

  echo \n!-- BEGIN VARIABLE DUMP --\n\n;

  echo !-- BEGIN GET VARS --\n;
  echo !-- .dump_array($HTTP_GET_VARS). --\n;

  echo !-- BEGIN POST VARS --\n;
  echo !-- .dump_array($HTTP_POST_VARS). --\n;

  echo !-- BEGIN SESSION VARS --\n;
  echo !-- .dump_array($HTTP_SESSION_VARS). --\n;

  echo !-- BEGIN COOKIE VARS --\n;
  echo !-- .dump_array($HTTP_COOKIE_VARS). --\n;

  echo \n!-- END VARIABLE DUMP --\n;

// dump_array() takes one array as a parameter
// It iterates through that array, creating a string
// to represent the array as a set

function dump_array($array)
{
  if(is_array($array))
  {
$size = count($array);
$string = ;
if($size)
{
  $count = 0;
  $string .= { ;
  // add each element's key and value to the string
  foreach($array as $var = $value)
  {
$string .= $var = '$value';
if($count++  ($size-1))  
{
  $string .= , ;
}
  }
  $string .=  };
}
return $string;
  }
  else 
  {
// if it is not an array, just return it
return $array;
  }
}
?
...end code snip

Actually, I have it as a separate file that I include when I need to.
Anyway, it'll list every single variable and array passed to the page along
with its value(s). 

It is entirely possible that your variable exists, but does not have a
value. In which case, your 

if ($register_clients){
//your HTML stuff here
}

code should evaluate to true because it exists, but doesn't have a value. As
Ryan suggested, the proper thing to do would be to use

if(isset($register_clients)){
//your HTML stuff here
}

That's all assuming you have register_globals set to on. Otherwise, you'll
have to switch to the $_REQUEST['register_clients'] notation (or $_POST or
$_GET, or etc.) if register_globals is set to off.

Either way, try using the code snippet and look at what your values are
actually set to (you'll have to view the source of the page into which you
place the snippet). That may give you some further insight into what's
happening with your script.

Hope this helps and that I haven't misinterpreted your post.

 -Original Message-
 From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 09, 2002 10:44 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] passing variables
 
 
 I missed the part where he was using an image. Without a 
 value property, I don't see how it could pass anything at all
 
 A note on my recent post, to emulate register_globals do this:
 
 if (!empty($_SERVER))
   extract($_SERVER);
   
 if (!empty($_GET)) {
 extract($_GET);
 } else if (!empty($HTTP_GET_VARS)) {
 extract($HTTP_GET_VARS);
 }
 
 if (!empty($_POST)) {
 extract($_POST);
 } else if (!empty($HTTP_POST_VARS)) {
 extract($HTTP_POST_VARS);
 }
 
 
 This registers all of the different arrays.
 
  Ryan
 
 -Original Message-
 From: Jonathan [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 09, 2002 8:40 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] passing variables
 
 
 One of many possible things.
 
 Dependent on the version of PHP you are using, you might have
 register_globals set to off in your php.ini file, which is preferable.
 In which case you'll have to use
 
 If($_REQUEST['variable'])
 
 Or
 
 If(isset($_REQUEST['variable']))
 
 Second possible is:
 
 I've never really used an image within a link to submit a 
 form.  What I
 usually do is make the image a submit button, e.g.,input type=image
 src=path to your image height=XX width=XX border=0 You could
 name it or create a hidden field input type=hidden name=register
 value=register
 
 Then upon form submission (form action=? Echo $_SERVER['PHP_SELF']
 ?)
 You would look for register
 
 If(isset($_REQUEST['register']))
 {
   //whatever
 }
 hope one of them works.
 
 -Original Message-
 From: Edward Peloke [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, December 09, 2002 9:33 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] passing variables
 
 Hello all,
 
 I have a login/register screen for my php/mysql db.  When the page
 opens,
 the user sees the log in screen but I have a button and 
 reloads the same
 page, hopefully with the register screen.  I know I can 
 simply check to
 see
 if a variable is set with
 
 if ($variable){} .  This does not seem to work when I give an image a
 name
 and link it to the same page.  The image is named register 
 and it links
 back
 to the same page, so the page loads, I click on the register 
 image , the
 page reloads but the variable is not set.
 
 
 Any ideas?
 
 Thanks,
 Eddie
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 -- 
 PHP Database Mailing List

RE: [PHP-DB] passing variables

2002-12-09 Thread Edward Peloke
Thanks for all the help everyone

-Original Message-
From: Hutchins, Richard [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 11:14 AM
To: [EMAIL PROTECTED]
Cc: '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] passing variables


Eddie, whenever I start having problems with variables, I drop this code in:

begin code snip...
?
  // these lines format the output as HTML comments
  // and call dump_array repeatedly

  echo \n!-- BEGIN VARIABLE DUMP --\n\n;

  echo !-- BEGIN GET VARS --\n;
  echo !-- .dump_array($HTTP_GET_VARS). --\n;

  echo !-- BEGIN POST VARS --\n;
  echo !-- .dump_array($HTTP_POST_VARS). --\n;

  echo !-- BEGIN SESSION VARS --\n;
  echo !-- .dump_array($HTTP_SESSION_VARS). --\n;

  echo !-- BEGIN COOKIE VARS --\n;
  echo !-- .dump_array($HTTP_COOKIE_VARS). --\n;

  echo \n!-- END VARIABLE DUMP --\n;

// dump_array() takes one array as a parameter
// It iterates through that array, creating a string
// to represent the array as a set

function dump_array($array)
{
  if(is_array($array))
  {
$size = count($array);
$string = ;
if($size)
{
  $count = 0;
  $string .= { ;
  // add each element's key and value to the string
  foreach($array as $var = $value)
  {
$string .= $var = '$value';
if($count++  ($size-1))
{
  $string .= , ;
}
  }
  $string .=  };
}
return $string;
  }
  else
  {
// if it is not an array, just return it
return $array;
  }
}
?
...end code snip

Actually, I have it as a separate file that I include when I need to.
Anyway, it'll list every single variable and array passed to the page along
with its value(s).

It is entirely possible that your variable exists, but does not have a
value. In which case, your

if ($register_clients){
//your HTML stuff here
}

code should evaluate to true because it exists, but doesn't have a value. As
Ryan suggested, the proper thing to do would be to use

if(isset($register_clients)){
//your HTML stuff here
}

That's all assuming you have register_globals set to on. Otherwise, you'll
have to switch to the $_REQUEST['register_clients'] notation (or $_POST or
$_GET, or etc.) if register_globals is set to off.

Either way, try using the code snippet and look at what your values are
actually set to (you'll have to view the source of the page into which you
place the snippet). That may give you some further insight into what's
happening with your script.

Hope this helps and that I haven't misinterpreted your post.

 -Original Message-
 From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 09, 2002 10:44 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] passing variables


 I missed the part where he was using an image. Without a
 value property, I don't see how it could pass anything at all

 A note on my recent post, to emulate register_globals do this:

 if (!empty($_SERVER))
   extract($_SERVER);

 if (!empty($_GET)) {
 extract($_GET);
 } else if (!empty($HTTP_GET_VARS)) {
 extract($HTTP_GET_VARS);
 }

 if (!empty($_POST)) {
 extract($_POST);
 } else if (!empty($HTTP_POST_VARS)) {
 extract($HTTP_POST_VARS);
 }


 This registers all of the different arrays.

  Ryan

 -Original Message-
 From: Jonathan [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 09, 2002 8:40 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] passing variables


 One of many possible things.

 Dependent on the version of PHP you are using, you might have
 register_globals set to off in your php.ini file, which is preferable.
 In which case you'll have to use

 If($_REQUEST['variable'])

 Or

 If(isset($_REQUEST['variable']))

 Second possible is:

 I've never really used an image within a link to submit a
 form.  What I
 usually do is make the image a submit button, e.g.,input type=image
 src=path to your image height=XX width=XX border=0 You could
 name it or create a hidden field input type=hidden name=register
 value=register

 Then upon form submission (form action=? Echo $_SERVER['PHP_SELF']
 ?)
 You would look for register

 If(isset($_REQUEST['register']))
 {
   //whatever
 }
 hope one of them works.

 -Original Message-
 From: Edward Peloke [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 09, 2002 9:33 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] passing variables

 Hello all,

 I have a login/register screen for my php/mysql db.  When the page
 opens,
 the user sees the log in screen but I have a button and
 reloads the same
 page, hopefully with the register screen.  I know I can
 simply check to
 see
 if a variable is set with

 if ($variable){} .  This does not seem to work when I give an image a
 name
 and link it to the same page.  The image is named register
 and it links
 back
 to the same page, so the page loads, I click on the register
 image , the
 page reloads but the variable is not set.


 Any ideas?

 Thanks,
 Eddie


 --
 PHP Database Mailing List (http://www.php.net

Re: [PHP-DB] passing variables

2002-12-09 Thread Adam Williams
www.php.net/isset

if !isset($var)
{
echo var is not set to anything;
}
else
{
echo var is set to $var;
}


On Mon, 9 Dec 2002, Edward Peloke wrote:

 Hello all,

 I have a login/register screen for my php/mysql db.  When the page opens,
 the user sees the log in screen but I have a button and reloads the same
 page, hopefully with the register screen.  I know I can simply check to see
 if a variable is set with

 if ($variable){} .  This does not seem to work when I give an image a name
 and link it to the same page.  The image is named register and it links back
 to the same page, so the page loads, I click on the register image , the
 page reloads but the variable is not set.


 Any ideas?

 Thanks,
 Eddie





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




RE: [PHP-DB] passing variables

2002-12-09 Thread Mark

--- Ryan Jameson (USA) [EMAIL PROTECTED] wrote:
 You are absolutely correct. However, the only value that security
 feature has is in the case that the program really cares which
 method the variable was received. I never have, and I doubt I ever
 will. I have had cases where I thought I'd be concerned with this
 but a rethink of the logic proved there was a better way. Even if I
 am concerned with such an issue I can always check the post array
 to make sure it is there.
 
 The decision to default to 'off' was a good one, but it only
 protects certain types of programmers from accidentally creating
 holes. I am a bit more deliberate, and see no security value in it
 for myself. Therefore my installations remain
 register_globals=on...
 
 If you'd like to pass your username and password on a query string
 be my guest, it'll work just fine. I don't recommend it though.
 

Actually, it's more than just checking for variables you expect.
Let's say you have a variable in your script that is set before user
data is parsed. Then you use extract() to pull all the variables out
of the superglobals. If someone attaches a variable to a GET with the
same name as a variable you've already set, then it will overwrite
your variable if you have register_globals on or simply extract() all
superglobals.

A **trivial** example:

?
$var1=Ryan;
// some set of PHP code
extract($HTTP_GET_VARS); // or $_GET
// more PHP code
echo Hello .$var1;
?

If I add ?var1=Mark to the URL for this page, It will respond with
Hello Mark, not Hello Ryan as expected. Obviously I've
oversimplified this. But I believe a big part of the the point of the
superglobals was to eliminate the ability for a malicious user to
overwrite values that the programmer didn't want to let them set.

I don't mean to get into a debate over the value of register_globals
being turned off. I do agree that for some it has value and for
others it doesn't. I don't think being deliberate is the only test
for whether there's use for it.

Mark

  Ryan
 
 -Original Message-
 From: Mark [mailto:[EMAIL PROTECTED]]
 Sent: Monday, December 09, 2002 10:51 AM
 To: Ryan Jameson (USA); [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] passing variables
 
 
 
 --- Ryan Jameson (USA) [EMAIL PROTECTED] wrote:
  I missed the part where he was using an image. Without a value
  property, I don't see how it could pass anything at all
  
  A note on my recent post, to emulate register_globals do this:
  
  if (!empty($_SERVER))
extract($_SERVER);

  if (!empty($_GET)) {
  extract($_GET);
  } else if (!empty($HTTP_GET_VARS)) {
  extract($HTTP_GET_VARS);
  }
  
  if (!empty($_POST)) {
  extract($_POST);
  } else if (!empty($HTTP_POST_VARS)) {
  extract($HTTP_POST_VARS);
  }
  
  
  This registers all of the different arrays.
 
 And completely nullifies the security value of having
 register_globals turned off. But I guess if you don't have access
 to
 the php.ini file this is as good...
 
   Ryan
  
 
 
 =
 Mark Weinstock
 [EMAIL PROTECTED]
 ***
 You can't demand something as a right unless you are willing to
 fight to death to defend everyone else's right to the same thing.
 -Stolen from the now-defunct Randy's Random mailing list.
 ***
 
 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
 http://mailplus.yahoo.com
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a right unless you are willing to fight to death to 
defend everyone else's right to the same thing.
-Stolen from the now-defunct Randy's Random mailing list.
***

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP-DB] passing variables from one page to another

2002-07-08 Thread Martin Clifford

If that is your exact code, then you need to have an ending quote after the query is 
written.  Like this:

$query = Select * from course, disc, instit, prof where course.CourseID =
$CourseID and course.DiscID = disc.DiscID and course.InstitID =
instit.InstitID and course.ProfID = prof.ProfID;

Martin

 Matthew K. Gold [EMAIL PROTECTED] 07/08/02 03:40PM 
Hi Everybody,

Please forgive the basic nature of this question--I have looked at the
manual, but I found that much of it went over my head.

I'm trying to create a second level of a website that displays course
listings.  The first level lists a bunch of courses.  I'd like users to be
able to click on the title of a course to go to a page that contains details
about that course.

From what I understand, I should do this by making the title of the course
on the first page (courses.php) a link to the second page (courseinfo.php)
with a query string attached--so that the link would look like
 a href=courseinfo.php?CourseID=12Accounting 101/a

What I'm having trouble doing is coding the second page.  Here's what I've
done.  When I run this, I get a blank page in return...if anyone can help, I
would greatly appreciate it.  Thanks in advance.

Matt


?php
$db = @mysql_connect(host,user,pword);
mysql_select_db(dln, $db);

if ( !$CourseID ) {
print (no course id included)
exit;
};

$query = Select * from course, disc, instit, prof where course.CourseID =
$CourseID and course.DiscID = disc.DiscID and course.InstitID =
instit.InstitID and course.ProfID = prof.ProfID;
$result = mysql_query ($query);
echo MySQL error number  . mysql_errno() . :  . mysql_error();

print (table border=\0\ cellpadding=\5\ class=\default\\n);

print (tr
bgcolor=\#ff9900\th$CourseID/th/trtrtd$CourseTitle/td/tr/t
able);

?



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



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




Re: [PHP-DB] passing variables from one page to another

2002-07-08 Thread Matthew K. Gold

You're right--I did leave out that end quotation mark.  Unfortunately,
though, I'm still getting the same result after adding it.

best,

Matt

- Original Message -
From: Martin Clifford [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, July 08, 2002 3:47 PM
Subject: Re: [PHP-DB] passing variables from one page to another


If that is your exact code, then you need to have an ending quote after the
query is written.  Like this:

$query = Select * from course, disc, instit, prof where course.CourseID =
$CourseID and course.DiscID = disc.DiscID and course.InstitID =
instit.InstitID and course.ProfID = prof.ProfID;

Martin

 Matthew K. Gold [EMAIL PROTECTED] 07/08/02 03:40PM 
Hi Everybody,

Please forgive the basic nature of this question--I have looked at the
manual, but I found that much of it went over my head.

I'm trying to create a second level of a website that displays course
listings.  The first level lists a bunch of courses.  I'd like users to be
able to click on the title of a course to go to a page that contains details
about that course.

From what I understand, I should do this by making the title of the course
on the first page (courses.php) a link to the second page (courseinfo.php)
with a query string attached--so that the link would look like
 a href=courseinfo.php?CourseID=12Accounting 101/a

What I'm having trouble doing is coding the second page.  Here's what I've
done.  When I run this, I get a blank page in return...if anyone can help, I
would greatly appreciate it.  Thanks in advance.

Matt


?php
$db = @mysql_connect(host,user,pword);
mysql_select_db(dln, $db);

if ( !$CourseID ) {
print (no course id included)
exit;
};

$query = Select * from course, disc, instit, prof where course.CourseID =
$CourseID and course.DiscID = disc.DiscID and course.InstitID =
instit.InstitID and course.ProfID = prof.ProfID;
$result = mysql_query ($query);
echo MySQL error number  . mysql_errno() . :  . mysql_error();

print (table border=\0\ cellpadding=\5\ class=\default\\n);

print (tr
bgcolor=\#ff9900\th$CourseID/th/trtrtd$CourseTitle/td/tr/t
able);

?



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





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




Re: [PHP-DB] passing variables from one page to another

2002-07-08 Thread Daniel Brunner

Hello!!

How are you fetching the rows???

mysql_fetch_rows?? or mysql_fetch_object???

Dan


On Monday, July 8, 2002, at 02:52 PM, [EMAIL PROTECTED] wrote:

 You're right--I did leave out that end quotation mark.  Unfortunately,
 though, I'm still getting the same result after adding it.

 best,

 Matt

 - Original Message -
 From: Martin Clifford [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, July 08, 2002 3:47 PM
 Subject: Re: [PHP-DB] passing variables from one page to another


 If that is your exact code, then you need to have an ending quote after 
 the
 query is written.  Like this:

 $query = Select * from course, disc, instit, prof where 
 course.CourseID =
 $CourseID and course.DiscID = disc.DiscID and course.InstitID =
 instit.InstitID and course.ProfID = prof.ProfID;

 Martin

 Matthew K. Gold [EMAIL PROTECTED] 07/08/02 03:40PM 
 Hi Everybody,

 Please forgive the basic nature of this question--I have looked at the
 manual, but I found that much of it went over my head.

 I'm trying to create a second level of a website that displays course
 listings.  The first level lists a bunch of courses.  I'd like users to 
 be
 able to click on the title of a course to go to a page that contains 
 details
 about that course.

 From what I understand, I should do this by making the title of the 
 course
 on the first page (courses.php) a link to the second page 
 (courseinfo.php)
 with a query string attached--so that the link would look like
  a href=courseinfo.php?CourseID=12Accounting 101/a

 What I'm having trouble doing is coding the second page.  Here's what 
 I've
 done.  When I run this, I get a blank page in return...if anyone can 
 help, I
 would greatly appreciate it.  Thanks in advance.

 Matt


 ?php
 $db = @mysql_connect(host,user,pword);
 mysql_select_db(dln, $db);

 if ( !$CourseID ) {
 print (no course id included)
 exit;
 };

 $query = Select * from course, disc, instit, prof where 
 course.CourseID =
 $CourseID and course.DiscID = disc.DiscID and course.InstitID =
 instit.InstitID and course.ProfID = prof.ProfID;
 $result = mysql_query ($query);
 echo MySQL error number  . mysql_errno() . :  . mysql_error();

 print (table border=\0\ cellpadding=\5\ class=\default\\n);

 print (tr
 bgcolor=\#ff9900\th$CourseID/th/trtrtd$CourseTitle/td/tr
 /t
 able);

 ?



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





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



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




Re: [PHP-DB] passing variables from one page to another

2002-07-08 Thread Matthew K. Gold

ummm:).I'm now using fetch_rows, though I wasn't using anything
before.  Still, it's not working.  Here's the new script (thanks again for
your help):


?php

$db = @mysql_connect(host,user,pword);
mysql_select_db(dln, $db);

if ( !$CourseID ) {
print (no course id included)
exit
};

$query = Select * from course, disc, instit, prof where course.CourseID =
$CourseID and course.DiscID = disc.DiscID and course.InstitID =
instit.InstitID and course.ProfID = prof.ProfID;
$result = mysql_query ($query);

echo MySQL error number  . mysql_errno() . :  . mysql_error();

print (table border=\0\ cellpadding=\5\ class=\default\\n);

while ($row = mysql_fetch_row ($result))
{

print (tr
bgcolor=\#ff9900\th$CourseID/th/trtrtd$CourseTitle/td/tr);

}
print (/table);
?


- Original Message -
From: Daniel Brunner [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, July 08, 2002 4:04 PM
Subject: Re: [PHP-DB] passing variables from one page to another


 Hello!!

 How are you fetching the rows???

 mysql_fetch_rows?? or mysql_fetch_object???

 Dan


 On Monday, July 8, 2002, at 02:52 PM, [EMAIL PROTECTED] wrote:

  You're right--I did leave out that end quotation mark.  Unfortunately,
  though, I'm still getting the same result after adding it.
 
  best,
 
  Matt
 
  - Original Message -
  From: Martin Clifford [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Monday, July 08, 2002 3:47 PM
  Subject: Re: [PHP-DB] passing variables from one page to another
 
 
  If that is your exact code, then you need to have an ending quote after
  the
  query is written.  Like this:
 
  $query = Select * from course, disc, instit, prof where
  course.CourseID =
  $CourseID and course.DiscID = disc.DiscID and course.InstitID =
  instit.InstitID and course.ProfID = prof.ProfID;
 
  Martin
 
  Matthew K. Gold [EMAIL PROTECTED] 07/08/02 03:40PM 
  Hi Everybody,
 
  Please forgive the basic nature of this question--I have looked at the
  manual, but I found that much of it went over my head.
 
  I'm trying to create a second level of a website that displays course
  listings.  The first level lists a bunch of courses.  I'd like users to
  be
  able to click on the title of a course to go to a page that contains
  details
  about that course.
 
  From what I understand, I should do this by making the title of the
  course
  on the first page (courses.php) a link to the second page
  (courseinfo.php)
  with a query string attached--so that the link would look like
   a href=courseinfo.php?CourseID=12Accounting 101/a
 
  What I'm having trouble doing is coding the second page.  Here's what
  I've
  done.  When I run this, I get a blank page in return...if anyone can
  help, I
  would greatly appreciate it.  Thanks in advance.
 
  Matt
 
 
  ?php
  $db = @mysql_connect(host,user,pword);
  mysql_select_db(dln, $db);
 
  if ( !$CourseID ) {
  print (no course id included)
  exit;
  };
 
  $query = Select * from course, disc, instit, prof where
  course.CourseID =
  $CourseID and course.DiscID = disc.DiscID and course.InstitID =
  instit.InstitID and course.ProfID = prof.ProfID;
  $result = mysql_query ($query);
  echo MySQL error number  . mysql_errno() . :  . mysql_error();
 
  print (table border=\0\ cellpadding=\5\ class=\default\\n);
 
  print (tr
 
bgcolor=\#ff9900\th$CourseID/th/trtrtd$CourseTitle/td/tr
  /t
  able);
 
  ?
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 



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




RE: [PHP-DB] passing variables from one page to another

2002-07-08 Thread Hutchins, Richard

Matthew, have you tried running your query from the command line in MySQL?
If you can do that successfully, that'll prove that the query is functioning
properly and the problem can be tracked elsewhere.

-Original Message-
From: Matthew K. Gold [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 08, 2002 3:40 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] passing variables from one page to another


Hi Everybody,

Please forgive the basic nature of this question--I have looked at the
manual, but I found that much of it went over my head.

I'm trying to create a second level of a website that displays course
listings.  The first level lists a bunch of courses.  I'd like users to be
able to click on the title of a course to go to a page that contains details
about that course.

From what I understand, I should do this by making the title of the course
on the first page (courses.php) a link to the second page (courseinfo.php)
with a query string attached--so that the link would look like
 a href=courseinfo.php?CourseID=12Accounting 101/a

What I'm having trouble doing is coding the second page.  Here's what I've
done.  When I run this, I get a blank page in return...if anyone can help, I
would greatly appreciate it.  Thanks in advance.

Matt


?php
$db = @mysql_connect(host,user,pword);
mysql_select_db(dln, $db);

if ( !$CourseID ) {
print (no course id included)
exit;
};

$query = Select * from course, disc, instit, prof where course.CourseID =
$CourseID and course.DiscID = disc.DiscID and course.InstitID =
instit.InstitID and course.ProfID = prof.ProfID;
$result = mysql_query ($query);
echo MySQL error number  . mysql_errno() . :  . mysql_error();

print (table border=\0\ cellpadding=\5\ class=\default\\n);

print (tr
bgcolor=\#ff9900\th$CourseID/th/trtrtd$CourseTitle/td/tr/t
able);

?



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

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




Re: [PHP-DB] passing variables from one page to another

2002-07-08 Thread Matthew K. Gold

It works from the command line if I leave out course.CourseID =  $CourseID
in the where line of the select clause.  I assume that I'd have to leave
that out when working from the command line because it's defined in the php
file...

But I think that that is where my problem is.  As I've mentioned, I'm very
new at this, so the answer could be very basic.

thanks,

Matt

- Original Message -
From: Hutchins, Richard [EMAIL PROTECTED]
To: 'Matthew K. Gold' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, July 08, 2002 4:35 PM
Subject: RE: [PHP-DB] passing variables from one page to another


 Matthew, have you tried running your query from the command line in MySQL?
 If you can do that successfully, that'll prove that the query is
functioning
 properly and the problem can be tracked elsewhere.

 -Original Message-
 From: Matthew K. Gold [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 08, 2002 3:40 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] passing variables from one page to another


 Hi Everybody,

 Please forgive the basic nature of this question--I have looked at the
 manual, but I found that much of it went over my head.

 I'm trying to create a second level of a website that displays course
 listings.  The first level lists a bunch of courses.  I'd like users to be
 able to click on the title of a course to go to a page that contains
details
 about that course.

 From what I understand, I should do this by making the title of the course
 on the first page (courses.php) a link to the second page (courseinfo.php)
 with a query string attached--so that the link would look like
  a href=courseinfo.php?CourseID=12Accounting 101/a

 What I'm having trouble doing is coding the second page.  Here's what I've
 done.  When I run this, I get a blank page in return...if anyone can help,
I
 would greatly appreciate it.  Thanks in advance.

 Matt


 ?php
 $db = @mysql_connect(host,user,pword);
 mysql_select_db(dln, $db);

 if ( !$CourseID ) {
 print (no course id included)
 exit;
 };

 $query = Select * from course, disc, instit, prof where course.CourseID =
 $CourseID and course.DiscID = disc.DiscID and course.InstitID =
 instit.InstitID and course.ProfID = prof.ProfID;
 $result = mysql_query ($query);
 echo MySQL error number  . mysql_errno() . :  . mysql_error();

 print (table border=\0\ cellpadding=\5\ class=\default\\n);

 print (tr

bgcolor=\#ff9900\th$CourseID/th/trtrtd$CourseTitle/td/tr/t
 able);

 ?



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



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




RE: [PHP-DB] passing variables from one page to another

2002-07-08 Thread Rich Hutchins

Just wanted to eliminate one possible problem area. If the query works, then
the problem must be in the PHP or the HTML. What do you see if you right
click and view source on the blank page you get? If you see something there,
copy it into a reply. Might be nothing important, but it'll show us what's
being parsed by the browser.

-Original Message-
From: Matthew K. Gold [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 08, 2002 5:07 PM
To: Hutchins, Richard; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] passing variables from one page to another


It works from the command line if I leave out course.CourseID =  $CourseID
in the where line of the select clause.  I assume that I'd have to leave
that out when working from the command line because it's defined in the php
file...

But I think that that is where my problem is.  As I've mentioned, I'm very
new at this, so the answer could be very basic.

thanks,

Matt

- Original Message -
From: Hutchins, Richard [EMAIL PROTECTED]
To: 'Matthew K. Gold' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, July 08, 2002 4:35 PM
Subject: RE: [PHP-DB] passing variables from one page to another


 Matthew, have you tried running your query from the command line in MySQL?
 If you can do that successfully, that'll prove that the query is
functioning
 properly and the problem can be tracked elsewhere.

 -Original Message-
 From: Matthew K. Gold [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 08, 2002 3:40 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] passing variables from one page to another


 Hi Everybody,

 Please forgive the basic nature of this question--I have looked at the
 manual, but I found that much of it went over my head.

 I'm trying to create a second level of a website that displays course
 listings.  The first level lists a bunch of courses.  I'd like users to be
 able to click on the title of a course to go to a page that contains
details
 about that course.

 From what I understand, I should do this by making the title of the course
 on the first page (courses.php) a link to the second page (courseinfo.php)
 with a query string attached--so that the link would look like
  a href=courseinfo.php?CourseID=12Accounting 101/a

 What I'm having trouble doing is coding the second page.  Here's what I've
 done.  When I run this, I get a blank page in return...if anyone can help,
I
 would greatly appreciate it.  Thanks in advance.

 Matt


 ?php
 $db = @mysql_connect(host,user,pword);
 mysql_select_db(dln, $db);

 if ( !$CourseID ) {
 print (no course id included)
 exit;
 };

 $query = Select * from course, disc, instit, prof where course.CourseID =
 $CourseID and course.DiscID = disc.DiscID and course.InstitID =
 instit.InstitID and course.ProfID = prof.ProfID;
 $result = mysql_query ($query);
 echo MySQL error number  . mysql_errno() . :  . mysql_error();

 print (table border=\0\ cellpadding=\5\ class=\default\\n);

 print (tr

bgcolor=\#ff9900\th$CourseID/th/trtrtd$CourseTitle/td/tr/t
 able);

 ?



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



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


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




Re: [PHP-DB] passing variables from one page to another

2002-07-08 Thread Matthew K. Gold

Thanks for the response.  Here's what I see in the source code:

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
HTMLHEAD
META content=text/html; charset=windows-1252
http-equiv=Content-Type/HEAD
BODY/BODY/HTML


I'm not actually testing the link--I'm just typing the following url into
the browser:  courseinfo.php?CourseID=12

Could that be the source of the problem?

thanks,

Matt


- Original Message -
From: Rich Hutchins [EMAIL PROTECTED]
To: Matthew K. Gold [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, July 08, 2002 5:39 PM
Subject: RE: [PHP-DB] passing variables from one page to another


 Just wanted to eliminate one possible problem area. If the query works,
then
 the problem must be in the PHP or the HTML. What do you see if you right
 click and view source on the blank page you get? If you see something
there,
 copy it into a reply. Might be nothing important, but it'll show us what's
 being parsed by the browser.

 -Original Message-
 From: Matthew K. Gold [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 08, 2002 5:07 PM
 To: Hutchins, Richard; [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] passing variables from one page to another


 It works from the command line if I leave out course.CourseID =  $CourseID
 in the where line of the select clause.  I assume that I'd have to leave
 that out when working from the command line because it's defined in the
php
 file...

 But I think that that is where my problem is.  As I've mentioned, I'm very
 new at this, so the answer could be very basic.

 thanks,

 Matt

 - Original Message -
 From: Hutchins, Richard [EMAIL PROTECTED]
 To: 'Matthew K. Gold' [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, July 08, 2002 4:35 PM
 Subject: RE: [PHP-DB] passing variables from one page to another


  Matthew, have you tried running your query from the command line in MySQ
L?
  If you can do that successfully, that'll prove that the query is
 functioning
  properly and the problem can be tracked elsewhere.
 
  -Original Message-
  From: Matthew K. Gold [mailto:[EMAIL PROTECTED]]
  Sent: Monday, July 08, 2002 3:40 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] passing variables from one page to another
 
 
  Hi Everybody,
 
  Please forgive the basic nature of this question--I have looked at the
  manual, but I found that much of it went over my head.
 
  I'm trying to create a second level of a website that displays course
  listings.  The first level lists a bunch of courses.  I'd like users to
be
  able to click on the title of a course to go to a page that contains
 details
  about that course.
 
  From what I understand, I should do this by making the title of the
course
  on the first page (courses.php) a link to the second page
(courseinfo.php)
  with a query string attached--so that the link would look like
   a href=courseinfo.php?CourseID=12Accounting 101/a
 
  What I'm having trouble doing is coding the second page.  Here's what
I've
  done.  When I run this, I get a blank page in return...if anyone can
help,
 I
  would greatly appreciate it.  Thanks in advance.
 
  Matt
 
 
  ?php
  $db = @mysql_connect(host,user,pword);
  mysql_select_db(dln, $db);
 
  if ( !$CourseID ) {
  print (no course id included)
  exit;
  };
 
  $query = Select * from course, disc, instit, prof where course.CourseID
=
  $CourseID and course.DiscID = disc.DiscID and course.InstitID =
  instit.InstitID and course.ProfID = prof.ProfID;
  $result = mysql_query ($query);
  echo MySQL error number  . mysql_errno() . :  . mysql_error();
 
  print (table border=\0\ cellpadding=\5\ class=\default\\n);
 
  print (tr
 

bgcolor=\#ff9900\th$CourseID/th/trtrtd$CourseTitle/td/tr/t
  able);
 
  ?
 
 
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php



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


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




Re: [PHP-DB] Passing variables to/from Flash

2001-05-16 Thread Atanas Vassilev

Yeah, it really worked, only the  char I had to put it at the beginning
of the string too and not only before the second and every consecutive
name-value pair. So the right string I had to output was:
var1=value1var2=value2var3=value3

Thank you for your help!
Atanas Vassilev



[EMAIL PROTECTED] [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 afaik it's something like:

 var1=value1var2=value2var3=value3...


  -Original Message-
  From: Atanas Vassilev [mailto:[EMAIL PROTECTED]]
  Sent: Dienstag, 15. Mai 2001 12:31
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] Passing variables to/from Flash
 
 
  I'm trying to send variables to a flash movie... In fact the
  designer of the
  flash part of the site told me that ActionScript had a built in function
  getData  that had one of its arguments the url from where the
  data should
  be pulled out - if he points his function to a *.php page in what form
  should I output the data within this php script - is it a
  urlencoded string
  or can it be an array, or just outputting name-value pairs on
  separate lines
  would be enough?
 
  Any help will be appreciated.
  Thanks in advance!
 
 
 
  --
  PHP Database 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 Database 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 Database 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]




RE: [PHP-DB] Passing variables to/from Flash

2001-05-15 Thread [EMAIL PROTECTED]

afaik it's something like:

var1=value1var2=value2var3=value3...


 -Original Message-
 From: Atanas Vassilev [mailto:[EMAIL PROTECTED]]
 Sent: Dienstag, 15. Mai 2001 12:31
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Passing variables to/from Flash
 
 
 I'm trying to send variables to a flash movie... In fact the 
 designer of the
 flash part of the site told me that ActionScript had a built in function
 getData  that had one of its arguments the url from where the 
 data should
 be pulled out - if he points his function to a *.php page in what form
 should I output the data within this php script - is it a 
 urlencoded string
 or can it be an array, or just outputting name-value pairs on 
 separate lines
 would be enough?
 
 Any help will be appreciated.
 Thanks in advance!
 
 
 
 -- 
 PHP Database 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 Database 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]