|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 4 Jun 2004 13:41:58 -0000 Issue 2802
php-general-digest-help
lists.php.net
Date: Fri Jun 04 2004 - 08:41:58 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 4 Jun 2004 13:41:58 -0000 Issue 2802
Topics (messages 187587 through 187621):
Re: Bulk table updates
187587 by: deseavers.mindspring.com
187588 by: John W. Holmes
187597 by: Robert Sossomon
187602 by: Dennis Seavers
187607 by: Marek Kilimajer
Current URL
187589 by: Stephen Craton
187590 by: Robert Cummings
187594 by: Aidan Lister
187595 by: Robert Cummings
Problem with PHP + WML + Post method
187591 by: Shelby
187592 by: Tyler Replogle
187593 by: Shelby
select from db
187596 by: BigMark
187598 by: Robert Sossomon
187599 by: Dennis Seavers
187600 by: Dennis Seavers
Re: Best way to sort?
187601 by: Angelo Zanetti
187614 by: Daniel Clark
Re: Class Syntax Help or Globals issue
187603 by: Bob Pillford
sessions
187604 by: BigMark
187605 by: Enda Nagle - Lists
187606 by: James Kaufman
187616 by: Daniel Clark
php-cgi+suexec and fastcgi
187608 by: Adrian Teasdale
187609 by: Adrian Teasdale
## Getting into Netscape.com Inbox
187610 by: jack bauer
error when running commands via exec() in CLI-mode
187611 by: Alberto Mucignat
MySQL & PHP
187612 by: Nunners
187615 by: Thijs Lensselink
187617 by: Robert Sossomon
Re: help needed with tiger tree hashes
187613 by: Thijs Lensselink
Re: PHP Debugger 4 Linux?
187618 by: Marco Schuler
187619 by: Yann Larrivee
php as CGI and $_POST
187620 by: David T-G
Compiling PHP with mnoGoSearch fails
187621 by: Aaron Gould
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Use a SELECT query to get the values (SELECT * FROM table) and a table that has form input fields in the cells. The values for the form fields would be based on the array you get from the SELECT query. The form could be something like <form action="<?=$PHP_SELF ?>" method="post">. In the script, before the body, you would have an if statement to check whether the submit button for the form is set; if it is set, it will run an INSERT INTO query:
if (isset ($submit)) {
$query = "INSERT INTO . . . ";
$query_result =
mysql_query ($query);
}
If the form is submitted, then the values in all the form fields (including any changes) will go into the database. If it's not submitted, the current values will be displayed in the tabled-embedded form. Actually, I think if the form is submitted, it will redisplay with the new values as defaults.
Hopefully this will work, or lead you in the right direction.
-----Original Message-----
From: Robert Sossomon <robert
gcnorris.com>
Sent: Jun 3, 2004 6:23 PM
To: php-general
lists.php.net
Subject: [PHP] Bulk table updates
I am looking for a tutorial or a already created class or file that I can
use to learn how to create a form that is populated from a database table
that can be edited in every row and column and takes only 1 SAVE button to
upload all the changes.
Thanks,
Robert
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Robert Sossomon wrote:
> I am looking for a tutorial or a already created class or file that I can
> use to learn how to create a form that is populated from a database table
> that can be edited in every row and column and takes only 1 SAVE button to
> upload all the changes.
Look on phpclasses.org or in PEAR; I know there are classes that do
this. If all else fails, install PHPMyAdmin, which allows you do this.
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
attached mail follows:
I use a separate page to do the addition of information to my DB
currently, the whole set of information is being re-written as I type
this, but where I am stuck is getting the whole thing to be parsed through
then just one line.
The code I currently use is as follows:
<SNIP CODE>
<!-- modifycart.php -->
$get_Quote = "select st.id, st.sel_item_id, st.sel_item_desc,
st.sel_item_price, st.sel_item_qty, st.sel_item_comment from
store_shoppertrack as st left join items as si on si.id = st.sel_item_id
where session_id = '$PHPSESSID' order by $vsort";
$get_Quote_res = mysql_query($get_Quote) or die(mysql_error());
while ($row = MYSQL_FETCH_ROW($get_Quote_res))
$number = mysql_numrows($get_Quote_res);
if (mysql_num_rows($get_Quote_res) < 1)
{ //print message
$display_block = "<P>You have no items in your Quote. Please <a
href=\"seestore.php\">continue to shop</a>!</P>";
}
else
{ //get info and build Quote display
while ($i < $number)
{
$id = mysql_result($get_Quote_res,$i,'id');
$item_title = mysql_result($get_Quote_res,$i,'sel_item_id');
$item_desc = mysql_result($get_Quote_res,$i,'sel_item_desc');
$item_price = mysql_result($get_Quote_res,$i,'sel_item_price');
$item_qty = mysql_result($get_Quote_res,$i,'sel_item_qty');
$item_comment = mysql_result($get_Quote_res,$i,'sel_item_comment');
if ($item_title == " >>>>>")
{
$display_block .= "<tr><td>Comment:</td><td colspan=2 align=center><form
method=post action=\"replacecart.php\"><input type=\"hidden\"
name=\"sel_item_id\" value=\"$item_title\"><input type=\"text\" size=75
name=\"sel_item_desc\" value=\"$item_desc\"><input type=\"hidden\"
name=\"sel_item_qty\" value=\"1\"><input type=\"hidden\" name=\"SESSID\"
value=\"$PHPSESSID\">\n<input type=\"hidden\" name=\"id\"
value=\"$id\">\n<input type=\"hidden\" name=\"url\"
value=\"$_SERVER[PHP_SELF]?view_code=$view_code\"><input type=\"hidden\"
name=\"sel_item_price\" value=\"0\"></td><td><select
name=\"color\"><option value=\"aqua\">aqua</option><option
value=\"black\">black</option><option value=\"blue\">blue</option><option
value=\"fuchsia\">fuchsia</option><option
value=\"gray\">gray</option><option value=\"green\">green</option><option
value=\"lime\">lime</option><option
value=\"maroon\">maroon</option><option
value=\"navy\">navy</option><option value=\"olive\">olive</option><option
value=\"purple\">purple</option><option value=\"red\">red</option><option
value=\"silver\">silver</option><option
value=\"teal\">teal</option><option value=\"white\">white</option><option
value=\"yellow\">yellow</option></select>\n</td><td>Currently:
$item_comment</td><td><input type=\"submit\" name=\"submit\"
value=\"Modify\"></form></td></tr>\n"; }
else
{
$display_block .= "\n<tr><td><form method=post
action=\"replacecart.php\">\n";
$display_block .= "$item_title</td><td><input type=text size=4
name=\"sel_item_qty\" value=\"$item_qty\">\n";
$display_block .= "</td><td><input type=\"text\" size=75
name=\"sel_item_desc\" value=\"$item_desc\">";
$display_block .= "<input type=\"hidden\" name=\"SESSID\"
value=\"$PHPSESSID\">\n<input type=\"hidden\" name=\"id\"
value=\"$id\">\n<input type=\"hidden\" name=\"sel_item_id\"
value=\"$item_title\">\n";
$display_block .= "<input type=\"hidden\" name=\"url\"
value=\"$_SERVER[PHP_SELF]?view_code=$view_code\">\n</td><td>";
$display_block .= "<input type=\"text\" name=\"sel_item_price\" size=\"5\"
value=\"$item_price\">\n</td><td>\n<input type=\"text\" name=\"comment\"
value=\"$item_comment\"></td><td>\n";
$display_block .= "<input type=\"submit\" name=\"submit\"
value=\"Modify\"></form></td>\n";
}
$i++;
}
<!-- End Modify Cart -->
<!-- Replacecart.php -->
$addtocart = "replace into store_shoppertrack
values('$_POST[id]','$_POST[SESSID]','$_POST[sel_item_id]','$_POST[sel_item_qty]','$_POST[sel_item_price]','$_POST[sel_item_desc]','$comment',
now(),'','','','')";
mysql_query($addtocart);
<!-- End Replace Cart -->
<End Snip CODE>
I have a test set of data and stuff set up on my server:
http://lonewolf.homelinux.net/quoter
There are some errors in not getting to other tables, but they are
irrelevant for seeing what is there. The data in the table is of course
bogus data, but you should see what I am getting at.
Thanks,
Robert
> Use a SELECT query to get the values (SELECT * FROM table) and a table
> that has form input fields in the cells. The values for the form fields
> would be based on the array you get from the SELECT query. The form could
> be something like <form action="<?=$PHP_SELF ?>" method="post">. In the
> script, before the body, you would have an if statement to check whether
> the submit button for the form is set; if it is set, it will run an INSERT
> INTO query:
>
> if (isset ($submit)) {
> $query = "INSERT INTO . . . ";
> $query_result =
mysql_query ($query);
> }
>
> If the form is submitted, then the values in all the form fields
> (including any changes) will go into the database. If it's not submitted,
> the current values will be displayed in the tabled-embedded form.
> Actually, I think if the form is submitted, it will redisplay with the new
> values as defaults.
>
> Hopefully this will work, or lead you in the right direction.
>
>
>
> -----Original Message-----
> From: Robert Sossomon <robert
gcnorris.com>
> Sent: Jun 3, 2004 6:23 PM
> To: php-general
lists.php.net
> Subject: [PHP] Bulk table updates
>
> I am looking for a tutorial or a already created class or file that I can
> use to learn how to create a form that is populated from a database table
> that can be edited in every row and column and takes only 1 SAVE button to
> upload all the changes.
>
> Thanks,
> Robert
>
> --
> 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
>
attached mail follows:
Maybe I don't understand what you're trying to accomplish -- and I'm not
sure what you meant by "parsed through then just one line" -- but the
application you have at the link would work if you set the default values
of the form elements to the data currently in your table. Even if you have
a separate page for entering data, you can have the same script handle both
the data viewing and updating.
Hope that helps (but I'm guessing it won't)
> [Original Message]
> From: Robert Sossomon <robert
gcnorris.com>
> To: <php-general
lists.php.net>
> Date: 06/03/2004 11:23:31 PM
> Subject: Re: [PHP] Bulk table updates
>
> I use a separate page to do the addition of information to my DB
> currently, the whole set of information is being re-written as I type
> this, but where I am stuck is getting the whole thing to be parsed through
> then just one line.
>
> The code I currently use is as follows:
> <SNIP CODE>
> <!-- modifycart.php -->
>
>
> $get_Quote = "select st.id, st.sel_item_id, st.sel_item_desc,
> st.sel_item_price, st.sel_item_qty, st.sel_item_comment from
> store_shoppertrack as st left join items as si on si.id = st.sel_item_id
> where session_id = '$PHPSESSID' order by $vsort";
>
> $get_Quote_res = mysql_query($get_Quote) or die(mysql_error());
>
> while ($row = MYSQL_FETCH_ROW($get_Quote_res))
> $number = mysql_numrows($get_Quote_res);
>
>
> if (mysql_num_rows($get_Quote_res) < 1)
> { //print message
> $display_block = "<P>You have no items in your Quote. Please <a
> href=\"seestore.php\">continue to shop</a>!</P>";
> }
> else
> { //get info and build Quote display
>
> while ($i < $number)
> {
> $id = mysql_result($get_Quote_res,$i,'id');
> $item_title = mysql_result($get_Quote_res,$i,'sel_item_id');
> $item_desc = mysql_result($get_Quote_res,$i,'sel_item_desc');
> $item_price = mysql_result($get_Quote_res,$i,'sel_item_price');
> $item_qty = mysql_result($get_Quote_res,$i,'sel_item_qty');
> $item_comment = mysql_result($get_Quote_res,$i,'sel_item_comment');
>
>
> if ($item_title == " >>>>>")
> {
> $display_block .= "<tr><td>Comment:</td><td colspan=2 align=center><form
> method=post action=\"replacecart.php\"><input type=\"hidden\"
> name=\"sel_item_id\" value=\"$item_title\"><input type=\"text\" size=75
> name=\"sel_item_desc\" value=\"$item_desc\"><input type=\"hidden\"
> name=\"sel_item_qty\" value=\"1\"><input type=\"hidden\" name=\"SESSID\"
> value=\"$PHPSESSID\">\n<input type=\"hidden\" name=\"id\"
> value=\"$id\">\n<input type=\"hidden\" name=\"url\"
> value=\"$_SERVER[PHP_SELF]?view_code=$view_code\"><input type=\"hidden\"
> name=\"sel_item_price\" value=\"0\"></td><td><select
> name=\"color\"><option value=\"aqua\">aqua</option><option
> value=\"black\">black</option><option value=\"blue\">blue</option><option
> value=\"fuchsia\">fuchsia</option><option
> value=\"gray\">gray</option><option value=\"green\">green</option><option
> value=\"lime\">lime</option><option
> value=\"maroon\">maroon</option><option
> value=\"navy\">navy</option><option value=\"olive\">olive</option><option
> value=\"purple\">purple</option><option value=\"red\">red</option><option
> value=\"silver\">silver</option><option
> value=\"teal\">teal</option><option value=\"white\">white</option><option
> value=\"yellow\">yellow</option></select>\n</td><td>Currently:
> $item_comment</td><td><input type=\"submit\" name=\"submit\"
> value=\"Modify\"></form></td></tr>\n"; }
> else
> {
> $display_block .= "\n<tr><td><form method=post
> action=\"replacecart.php\">\n";
> $display_block .= "$item_title</td><td><input type=text size=4
> name=\"sel_item_qty\" value=\"$item_qty\">\n";
> $display_block .= "</td><td><input type=\"text\" size=75
> name=\"sel_item_desc\" value=\"$item_desc\">";
> $display_block .= "<input type=\"hidden\" name=\"SESSID\"
> value=\"$PHPSESSID\">\n<input type=\"hidden\" name=\"id\"
> value=\"$id\">\n<input type=\"hidden\" name=\"sel_item_id\"
> value=\"$item_title\">\n";
> $display_block .= "<input type=\"hidden\" name=\"url\"
> value=\"$_SERVER[PHP_SELF]?view_code=$view_code\">\n</td><td>";
> $display_block .= "<input type=\"text\" name=\"sel_item_price\" size=\"5\"
> value=\"$item_price\">\n</td><td>\n<input type=\"text\" name=\"comment\"
> value=\"$item_comment\"></td><td>\n";
> $display_block .= "<input type=\"submit\" name=\"submit\"
> value=\"Modify\"></form></td>\n";
>
> }
> $i++;
> }
>
> <!-- End Modify Cart -->
>
> <!-- Replacecart.php -->
>
> $addtocart = "replace into store_shoppertrack
>
values('$_POST[id]','$_POST[SESSID]','$_POST[sel_item_id]','$_POST[sel_item_
qty]','$_POST[sel_item_price]','$_POST[sel_item_desc]','$comment',
> now(),'','','','')";
>
> mysql_query($addtocart);
>
> <!-- End Replace Cart -->
>
> <End Snip CODE>
>
> I have a test set of data and stuff set up on my server:
> http://lonewolf.homelinux.net/quoter
>
> There are some errors in not getting to other tables, but they are
> irrelevant for seeing what is there. The data in the table is of course
> bogus data, but you should see what I am getting at.
>
> Thanks,
> Robert
>
>
> > Use a SELECT query to get the values (SELECT * FROM table) and a table
> > that has form input fields in the cells. The values for the form fields
> > would be based on the array you get from the SELECT query. The form
could
> > be something like <form action="<?=$PHP_SELF ?>" method="post">. In the
> > script, before the body, you would have an if statement to check whether
> > the submit button for the form is set; if it is set, it will run an
INSERT
> > INTO query:
> >
> > if (isset ($submit)) {
> > $query = "INSERT INTO . . . ";
> > $query_result =
mysql_query ($query);
> > }
> >
> > If the form is submitted, then the values in all the form fields
> > (including any changes) will go into the database. If it's not
submitted,
> > the current values will be displayed in the tabled-embedded form.
> > Actually, I think if the form is submitted, it will redisplay with the
new
> > values as defaults.
> >
> > Hopefully this will work, or lead you in the right direction.
> >
> >
> >
> > -----Original Message-----
> > From: Robert Sossomon <robert
gcnorris.com>
> > Sent: Jun 3, 2004 6:23 PM
> > To: php-general
lists.php.net
> > Subject: [PHP] Bulk table updates
> >
> > I am looking for a tutorial or a already created class or file that I
can
> > use to learn how to create a form that is populated from a database
table
> > that can be edited in every row and column and takes only 1 SAVE button
to
> > upload all the changes.
> >
> > Thanks,
> > Robert
> >
> > --
> > 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 General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Robert Sossomon wrote:
> I use a separate page to do the addition of information to my DB
> currently, the whole set of information is being re-written as I type
> this, but where I am stuck is getting the whole thing to be parsed through
> then just one line.
>
> The code I currently use is as follows:
> <SNIP CODE>
> <!-- modifycart.php -->
>
>
> $get_Quote = "select st.id, st.sel_item_id, st.sel_item_desc,
> st.sel_item_price, st.sel_item_qty, st.sel_item_comment from
> store_shoppertrack as st left join items as si on si.id = st.sel_item_id
> where session_id = '$PHPSESSID' order by $vsort";
>
> $get_Quote_res = mysql_query($get_Quote) or die(mysql_error());
>
> while ($row = MYSQL_FETCH_ROW($get_Quote_res))
> $number = mysql_numrows($get_Quote_res);
>
>
> if (mysql_num_rows($get_Quote_res) < 1)
> { //print message
> $display_block = "<P>You have no items in your Quote. Please <a
> href=\"seestore.php\">continue to shop</a>!</P>";
> }
> else
> { //get info and build Quote display
>
> while ($i < $number)
> {
> $id = mysql_result($get_Quote_res,$i,'id');
> $item_title = mysql_result($get_Quote_res,$i,'sel_item_id');
> $item_desc = mysql_result($get_Quote_res,$i,'sel_item_desc');
> $item_price = mysql_result($get_Quote_res,$i,'sel_item_price');
> $item_qty = mysql_result($get_Quote_res,$i,'sel_item_qty');
> $item_comment = mysql_result($get_Quote_res,$i,'sel_item_comment');
>
>
> if ($item_title == " >>>>>")
> {
> $display_block .= "<tr><td>Comment:</td><td colspan=2 align=center><form
> method=post action=\"replacecart.php\"><input type=\"hidden\"
> name=\"sel_item_id\" value=\"$item_title\">
You can remove sel_item_id hidden field
> <input type=\"text\" size=75
> name=\"sel_item_desc\" value=\"$item_desc\">
And rename all other fields to field_name[$id].
Then in replacecart.php loop one of the fields (other then checkboxes if
you use them), the array index will give you the id:
foreach($_POST['sel_item_desc'] as $id => $dummy) {
update table set
sel_item_desc = '$_POST[sel_item_desc][$id]',
sel_item_qty = '$_POST[sel_item_qty][$id]',
.......
where id = '$id'
}
> <input type=\"hidden\"
> name=\"sel_item_qty\" value=\"1\"><input type=\"hidden\" name=\"SESSID\"
> value=\"$PHPSESSID\">\n<input type=\"hidden\" name=\"id\"
> value=\"$id\">\n<input type=\"hidden\" name=\"url\"
> value=\"$_SERVER[PHP_SELF]?view_code=$view_code\"><input type=\"hidden\"
> name=\"sel_item_price\" value=\"0\"></td><td><select
> name=\"color\"><option value=\"aqua\">aqua</option><option
> value=\"black\">black</option><option value=\"blue\">blue</option><option
> value=\"fuchsia\">fuchsia</option><option
> value=\"gray\">gray</option><option value=\"green\">green</option><option
> value=\"lime\">lime</option><option
> value=\"maroon\">maroon</option><option
> value=\"navy\">navy</option><option value=\"olive\">olive</option><option
> value=\"purple\">purple</option><option value=\"red\">red</option><option
> value=\"silver\">silver</option><option
> value=\"teal\">teal</option><option value=\"white\">white</option><option
> value=\"yellow\">yellow</option></select>\n</td><td>Currently:
> $item_comment</td><td><input type=\"submit\" name=\"submit\"
> value=\"Modify\"></form></td></tr>\n"; }
> else
> {
> $display_block .= "\n<tr><td><form method=post
> action=\"replacecart.php\">\n";
> $display_block .= "$item_title</td><td><input type=text size=4
> name=\"sel_item_qty\" value=\"$item_qty\">\n";
> $display_block .= "</td><td><input type=\"text\" size=75
> name=\"sel_item_desc\" value=\"$item_desc\">";
> $display_block .= "<input type=\"hidden\" name=\"SESSID\"
> value=\"$PHPSESSID\">\n<input type=\"hidden\" name=\"id\"
> value=\"$id\">\n<input type=\"hidden\" name=\"sel_item_id\"
> value=\"$item_title\">\n";
> $display_block .= "<input type=\"hidden\" name=\"url\"
> value=\"$_SERVER[PHP_SELF]?view_code=$view_code\">\n</td><td>";
> $display_block .= "<input type=\"text\" name=\"sel_item_price\" size=\"5\"
> value=\"$item_price\">\n</td><td>\n<input type=\"text\" name=\"comment\"
> value=\"$item_comment\"></td><td>\n";
> $display_block .= "<input type=\"submit\" name=\"submit\"
> value=\"Modify\"></form></td>\n";
>
> }
> $i++;
> }
>
> <!-- End Modify Cart -->
>
> <!-- Replacecart.php -->
>
> $addtocart = "replace into store_shoppertrack
> values('$_POST[id]','$_POST[SESSID]','$_POST[sel_item_id]','$_POST[sel_item_qty]','$_POST[sel_item_price]','$_POST[sel_item_desc]','$comment',
> now(),'','','','')";
>
> mysql_query($addtocart);
>
> <!-- End Replace Cart -->
>
> <End Snip CODE>
>
> I have a test set of data and stuff set up on my server:
> http://lonewolf.homelinux.net/quoter
>
> There are some errors in not getting to other tables, but they are
> irrelevant for seeing what is there. The data in the table is of course
> bogus data, but you should see what I am getting at.
>
> Thanks,
> Robert
>
>
>
>>Use a SELECT query to get the values (SELECT * FROM table) and a table
>>that has form input fields in the cells. The values for the form fields
>>would be based on the array you get from the SELECT query. The form could
>>be something like <form action="<?=$PHP_SELF ?>" method="post">. In the
>>script, before the body, you would have an if statement to check whether
>>the submit button for the form is set; if it is set, it will run an INSERT
>>INTO query:
>>
>>if (isset ($submit)) {
>> $query = "INSERT INTO . . . ";
>> $query_result =
mysql_query ($query);
>>}
>>
>>If the form is submitted, then the values in all the form fields
>>(including any changes) will go into the database. If it's not submitted,
>>the current values will be displayed in the tabled-embedded form.
>>Actually, I think if the form is submitted, it will redisplay with the new
>>values as defaults.
>>
>>Hopefully this will work, or lead you in the right direction.
>>
>>
attached mail follows:
I've wondered for quite some time, and search just as long it seems like,
for a way to get the current URL directory. For example, let's say you were
at www.example.com/files. The script is executing in this directory, and
it's calling an include script from the base (www.example.com or maybe even
www.example.com/includes). In this included file are some links and maybe
some images. These images and links are set up to be called from the base
directory, so basically all the links inside the file say something like
"images/bob.gif" or something of that nature.
How could you dynamicaly change this in relation to where the included
script is? If I were to include it in that files in /files, it would look
for the images in /files/images/bob.gif which would not be there. One
solution I have thought of is just putting the / at the beginning (/images/)
but that wouldn't be the safest solution if the script were running in a
subfolder to begind with (like the entire site is in www.example.com/site1).
I hope you understand what I'm trying to say. Any ideas?
Thanks,
Stephen Craton
http://www.melchior.us <http://www.melchior.us/>
attached mail follows:
On Thu, 2004-06-03 at 23:15, Stephen Craton wrote:
> I've wondered for quite some time, and search just as long it seems like,
> for a way to get the current URL directory. For example, let's say you were
> at www.example.com/files. The script is executing in this directory, and
> it's calling an include script from the base (www.example.com or maybe even
> www.example.com/includes). In this included file are some links and maybe
> some images. These images and links are set up to be called from the base
> directory, so basically all the links inside the file say something like
> "images/bob.gif" or something of that nature.
>
> How could you dynamicaly change this in relation to where the included
> script is? If I were to include it in that files in /files, it would look
> for the images in /files/images/bob.gif which would not be there. One
> solution I have thought of is just putting the / at the beginning (/images/)
> but that wouldn't be the safest solution if the script were running in a
> subfolder to begind with (like the entire site is in www.example.com/site1).
>
> I hope you understand what I'm trying to say. Any ideas?
In a configuration file shared by the project's scripts have a constant
or global variable like follows:
$GLOBALS['imageBase'] = '/site1/';
Now wherever in your site you use an image you can use this value to
prepend the image path.
Cheers,
Blobbie.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Hi,
You could use $_SERVER['DOCUMENT_ROOT']
"Robert Cummings" <robert
interjinn.com> wrote in message
news:1086319737.29789.8.camel
blobule.suds...
> On Thu, 2004-06-03 at 23:15, Stephen Craton wrote:
> > I've wondered for quite some time, and search just as long it seems
like,
> > for a way to get the current URL directory. For example, let's say you
were
> > at www.example.com/files. The script is executing in this directory, and
> > it's calling an include script from the base (www.example.com or maybe
even
> > www.example.com/includes). In this included file are some links and
maybe
> > some images. These images and links are set up to be called from the
base
> > directory, so basically all the links inside the file say something like
> > "images/bob.gif" or something of that nature.
> >
> > How could you dynamicaly change this in relation to where the included
> > script is? If I were to include it in that files in /files, it would
look
> > for the images in /files/images/bob.gif which would not be there. One
> > solution I have thought of is just putting the / at the beginning
(/images/)
> > but that wouldn't be the safest solution if the script were running in a
> > subfolder to begind with (like the entire site is in
www.example.com/site1).
> >
> > I hope you understand what I'm trying to say. Any ideas?
>
> In a configuration file shared by the project's scripts have a constant
> or global variable like follows:
>
> $GLOBALS['imageBase'] = '/site1/';
>
> Now wherever in your site you use an image you can use this value to
> prepend the image path.
>
> Cheers,
> Blobbie.
> --
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting |
> | a powerful, scalable system for accessing system services |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for |
> | creating re-usable components quickly and easily. |
> `------------------------------------------------------------'
attached mail follows:
On Fri, 2004-06-04 at 01:38, Aidan Lister wrote:
> Hi,
>
> You could use $_SERVER['DOCUMENT_ROOT']
>
That doesn't work... as the OP mentioned, the URLs might need to refer
locally within a subsite built as a subdirectory within the document
root.
Cheers,
Rob.
>
> "Robert Cummings" <robert
interjinn.com> wrote in message
> news:1086319737.29789.8.camel
blobule.suds...
> > On Thu, 2004-06-03 at 23:15, Stephen Craton wrote:
> > > I've wondered for quite some time, and search just as long it seems
> like,
> > > for a way to get the current URL directory. For example, let's say you
> were
> > > at www.example.com/files. The script is executing in this directory, and
> > > it's calling an include script from the base (www.example.com or maybe
> even
> > > www.example.com/includes). In this included file are some links and
> maybe
> > > some images. These images and links are set up to be called from the
> base
> > > directory, so basically all the links inside the file say something like
> > > "images/bob.gif" or something of that nature.
> > >
> > > How could you dynamicaly change this in relation to where the included
> > > script is? If I were to include it in that files in /files, it would
> look
> > > for the images in /files/images/bob.gif which would not be there. One
> > > solution I have thought of is just putting the / at the beginning
> (/images/)
> > > but that wouldn't be the safest solution if the script were running in a
> > > subfolder to begind with (like the entire site is in
> www.example.com/site1).
> > >
> > > I hope you understand what I'm trying to say. Any ideas?
> >
> > In a configuration file shared by the project's scripts have a constant
> > or global variable like follows:
> >
> > $GLOBALS['imageBase'] = '/site1/';
> >
> > Now wherever in your site you use an image you can use this value to
> > prepend the image path.
> >
> > Cheers,
> > Blobbie.
> > --
> > .------------------------------------------------------------.
> > | InterJinn Application Framework - http://www.interjinn.com |
> > :------------------------------------------------------------:
> > | An application and templating framework for PHP. Boasting |
> > | a powerful, scalable system for accessing system services |
> > | such as forms, properties, sessions, and caches. InterJinn |
> > | also provides an extremely flexible architecture for |
> > | creating re-usable components quickly and easily. |
> > `------------------------------------------------------------'
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
attached mail follows:
Hi,
I'm having problem with the "Post" method in my PHP + WML file.
Note that I have No problem with the "Get" method.
When I click "Login",
The Error:
Malformed server response
I'm using Win2k + PHP436 for testing.
And I have set the MIME type in the IIS:
.wml
application/x-httpd-php
=============
index.php
=============
<?
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<card id="card1" title="Home">
<p>
User ID: <input name="myuserid" size="15" value=""/><br/>
Password: <input type="password" name="mypwd" size="15" value=""/><br/>
<do type="accept" name="next" label="Login">
<go href="index.php" method="post">
<postfield name="myuserid2" value="$myuserid"/>
</go>
</do>
</p>
</card>
</wml>
Is there anything I miss out?
By the way, when I test with Win2003 server + PHP436, there is no problem.
Does the problem lie with the Win2k server?
attached mail follows:
hey,
don't you need a page thats after that and will check the info, if you have
it will help use see what your problem with the $_POST[] is.
>From: "Shelby" <shelby
itsupport.com.sg>
>To: php-general
lists.php.net
>Subject: [PHP] Problem with PHP + WML + Post method
>Date: Fri, 4 Jun 2004 11:46:10 +0800
>
>Hi,
>I'm having problem with the "Post" method in my PHP + WML file.
>Note that I have No problem with the "Get" method.
>
>When I click "Login",
>The Error:
>Malformed server response
>
>
>I'm using Win2k + PHP436 for testing.
>And I have set the MIME type in the IIS:
>.wml
>application/x-httpd-php
>
>
>=============
>index.php
>=============
><?
>header("Content-type: text/vnd.wap.wml");
>echo "<?xml version=\"1.0\"?>";
>echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
>. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
>?>
><wml>
><card id="card1" title="Home">
><p>
>User ID: <input name="myuserid" size="15" value=""/><br/>
>Password: <input type="password" name="mypwd" size="15" value=""/><br/>
><do type="accept" name="next" label="Login">
><go href="index.php" method="post">
><postfield name="myuserid2" value="$myuserid"/>
></go>
></do>
></p>
></card>
></wml>
>
>
>
>
>Is there anything I miss out?
>By the way, when I test with Win2003 server + PHP436, there is no problem.
>Does the problem lie with the Win2k server?
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
_________________________________________________________________
Stop worrying about overloading your inbox - get MSN Hotmail Extra Storage!
http://join.msn.click-url.com/go/onm00200362ave/direct/01/
attached mail follows:
Hi,
the href property is going back to index.php. It is going back to itself.
"Tyler Replogle" <dbnm
hotmail.com> wrote in message
news:BAY15-F42VudG1FgMOk00051dda
hotmail.com...
> hey,
> don't you need a page thats after that and will check the info, if you
have
> it will help use see what your problem with the $_POST[] is.
>
>
>
>
> >From: "Shelby" <shelby
itsupport.com.sg>
> >To: php-general
lists.php.net
> >Subject: [PHP] Problem with PHP + WML + Post method
> >Date: Fri, 4 Jun 2004 11:46:10 +0800
> >
> >Hi,
> >I'm having problem with the "Post" method in my PHP + WML file.
> >Note that I have No problem with the "Get" method.
> >
> >When I click "Login",
> >The Error:
> >Malformed server response
> >
> >
> >I'm using Win2k + PHP436 for testing.
> >And I have set the MIME type in the IIS:
> >.wml
> >application/x-httpd-php
> >
> >
> >=============
> >index.php
> >=============
> ><?
> >header("Content-type: text/vnd.wap.wml");
> >echo "<?xml version=\"1.0\"?>";
> >echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
> >. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
> >?>
> ><wml>
> ><card id="card1" title="Home">
> ><p>
> >User ID: <input name="myuserid" size="15" value=""/><br/>
> >Password: <input type="password" name="mypwd" size="15" value=""/><br/>
> ><do type="accept" name="next" label="Login">
> ><go href="index.php" method="post">
> ><postfield name="myuserid2" value="$myuserid"/>
> ></go>
> ></do>
> ></p>
> ></card>
> ></wml>
> >
> >
> >
> >
> >Is there anything I miss out?
> >By the way, when I test with Win2003 server + PHP436, there is no
problem.
> >Does the problem lie with the Win2k server?
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> _________________________________________________________________
> Stop worrying about overloading your inbox - get MSN Hotmail Extra
Storage!
> http://join.msn.click-url.com/go/onm00200362ave/direct/01/
attached mail follows:
Hi i have a football tipping database and i need to extract certain records
from a users 'selections' table
table name 'Selections'
(rows) Round Game Name Winner Points
data eg 1 1 mark Hawthorn 4
(if team is a winner then 4 points added)
1 2 mark Geelong 0
What i want to do is show all the above rows of a particular user and round,
ie: all of user 'mark' round 1 details which includes games 1-8, the team
names he picked, and the points for a win.
p.s. is there a way of totaling the points as well
mark
attached mail follows:
<!SNIP>
> table name 'Selections'
>
> (rows) Round Game Name Winner Points
> data eg 1 1 mark Hawthorn 4
> (if team is a winner then 4 points added)
>
> 1 2 mark Geelong 0
>
<! End Snip>
Assuming you have them submit a form to get here:
<?php
//somefilename
//Access your Database
include "db.php";
//Name from previous form, or you can use from authentication,
//whichever, just mod the code to reflect where getting it from
$name = $_POST[name];
//query and results
$query = "select * from Selections where Name='$name'";
$result = mysql_query($query);
/* Determine the number of records returned */
while ($row = MYSQL_FETCH_ROW($result))
$number = mysql_numrows($result);
/* Start printing to make it look good */
print "<table cellspacing=\"0\" cellpadding=\"5\" border=\"1\">";
print
"<tr><th>Round</th><th>Game</th><th>Name</th><th>Winner</th><th>Points</th></tr>";
$total_points=0;
/* Iterate through to make it clean */
while ($i < $number)
{
$item_1 = mysql_result($result, $i,"Round");
$item_2 = mysql_result($result, $i,"Game");
$item_3 = mysql_result($result, $i,"Name");
$item_4 = mysql_result($result, $i,"Winner");
$item_5 = mysql_result($result, $i,"Points");
/* This makes it print out in 2 separate color, depending on rows. */
if ($i%2 == 0)
{
print "<tr
bgcolor=\"#eeeeee\"><td>$item_1</td><td>$item_2</td><td>$item_3</td><td>$item_4</td><td>$item_5</td></tr>\n";
}
else
{
print "<tr
bgcolor=\"#ffffff\"><td>$item_1</td><td>$item_2</td><td>$item_3</td><td>$item_4</td><td>$item_5</td></tr>\n";
}
/* Increase record count and total_points to date */
$i++;
$total_points += $item_5;
}
/* close everything up */
print "<tr><th colspan=5>Total Points Earned: $total_points</th></tr>";
print "</table>";
}
?>
attached mail follows:
When you run this script, or one like it, does it work? You seem to be
missing a number of brackets. For example, you have:
while ($row = MYSQL_FETCH_ROW($result))
instead of
while ($row = MYSQL_FETCH_ROW($result)) {
or
while ($row = MYSQL_FETCH_ROW($result))
{
> [Original Message]
> From: Robert Sossomon <robert
gcnorris.com>
> To: BigMark <neretlis
westnet.com.au>
> Cc: <php-general
lists.php.net>
> Date: 06/03/2004 11:44:58 PM
> Subject: Re: [PHP] select from db
>
> <!SNIP>
> > table name 'Selections'
> >
> > (rows) Round Game Name Winner Points
> > data eg 1 1 mark Hawthorn 4
> > (if team is a winner then 4 points added)
> >
> > 1 2 mark Geelong 0
> >
> <! End Snip>
>
> Assuming you have them submit a form to get here:
> <?php
> //somefilename
>
> //Access your Database
> include "db.php";
>
> //Name from previous form, or you can use from authentication,
> //whichever, just mod the code to reflect where getting it from
> $name = $_POST[name];
>
> //query and results
> $query = "select * from Selections where Name='$name'";
> $result = mysql_query($query);
>
> /* Determine the number of records returned */
> while ($row = MYSQL_FETCH_ROW($result))
> $number = mysql_numrows($result);
>
> /* Start printing to make it look good */
> print "<table cellspacing=\"0\" cellpadding=\"5\" border=\"1\">";
> print
>
"<tr><th>Round</th><th>Game</th><th>Name</th><th>Winner</th><th>Points</th><
/tr>";
>
> $total_points=0;
> /* Iterate through to make it clean */
> while ($i < $number)
> {
> $item_1 = mysql_result($result, $i,"Round");
> $item_2 = mysql_result($result, $i,"Game");
> $item_3 = mysql_result($result, $i,"Name");
> $item_4 = mysql_result($result, $i,"Winner");
> $item_5 = mysql_result($result, $i,"Points");
>
> /* This makes it print out in 2 separate color, depending on rows. */
> if ($i%2 == 0)
> {
> print "<tr
>
bgcolor=\"#eeeeee\"><td>$item_1</td><td>$item_2</td><td>$item_3</td><td>$ite
m_4</td><td>$item_5</td></tr>\n";
> }
> else
> {
> print "<tr
>
bgcolor=\"#ffffff\"><td>$item_1</td><td>$item_2</td><td>$item_3</td><td>$ite
m_4</td><td>$item_5</td></tr>\n";
> }
> /* Increase record count and total_points to date */
> $i++;
> $total_points += $item_5;
> }
> /* close everything up */
> print "<tr><th colspan=5>Total Points Earned: $total_points</th></tr>";
> print "</table>";
> }
>
> ?>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I think I misread your script.
I took the line
print "<table cellspacing=\"0\" cellpadding=\"5\" border=\"1\">";
to be part of the while loop, meaning there would be two statements. I'm
not accustomed to seeing scripts that use functions without brackets, even
when their not required.
Sorry for the confusion.
> [Original Message]
> From: Dennis Seavers <deseavers
mindspring.com>
> To: Robert Sossomon <robert
gcnorris.com>
> Cc: <php-general
lists.php.net>
> Date: 06/04/2004 12:00:39 AM
> Subject: Re: [PHP] select from db
>
> When you run this script, or one like it, does it work? You seem to be
> missing a number of brackets. For example, you have:
>
> while ($row = MYSQL_FETCH_ROW($result))
>
> instead of
>
> while ($row = MYSQL_FETCH_ROW($result)) {
>
> or
>
> while ($row = MYSQL_FETCH_ROW($result))
> {
>
> > [Original Message]
> > From: Robert Sossomon <robert
gcnorris.com>
> > To: BigMark <neretlis
westnet.com.au>
> > Cc: <php-general
lists.php.net>
> > Date: 06/03/2004 11:44:58 PM
> > Subject: Re: [PHP] select from db
> >
> > <!SNIP>
> > > table name 'Selections'
> > >
> > > (rows) Round Game Name Winner Points
> > > data eg 1 1 mark Hawthorn 4
> > > (if team is a winner then 4 points added)
> > >
> > > 1 2 mark Geelong
0
> > >
> > <! End Snip>
> >
> > Assuming you have them submit a form to get here:
> > <?php
> > //somefilename
> >
> > //Access your Database
> > include "db.php";
> >
> > //Name from previous form, or you can use from authentication,
> > //whichever, just mod the code to reflect where getting it from
> > $name = $_POST[name];
> >
> > //query and results
> > $query = "select * from Selections where Name='$name'";
> > $result = mysql_query($query);
> >
> > /* Determine the number of records returned */
> > while ($row = MYSQL_FETCH_ROW($result))
> > $number = mysql_numrows($result);
> >
> > /* Start printing to make it look good */
> > print "<table cellspacing=\"0\" cellpadding=\"5\" border=\"1\">";
> > print
> >
>
"<tr><th>Round</th><th>Game</th><th>Name</th><th>Winner</th><th>Points</th><
> /tr>";
> >
> > $total_points=0;
> > /* Iterate through to make it clean */
> > while ($i < $number)
> > {
> > $item_1 = mysql_result($result, $i,"Round");
> > $item_2 = mysql_result($result, $i,"Game");
> > $item_3 = mysql_result($result, $i,"Name");
> > $item_4 = mysql_result($result, $i,"Winner");
> > $item_5 = mysql_result($result, $i,"Points");
> >
> > /* This makes it print out in 2 separate color, depending on rows. */
> > if ($i%2 == 0)
> > {
> > print "<tr
> >
>
bgcolor=\"#eeeeee\"><td>$item_1</td><td>$item_2</td><td>$item_3</td><td>$ite
> m_4</td><td>$item_5</td></tr>\n";
> > }
> > else
> > {
> > print "<tr
> >
>
bgcolor=\"#ffffff\"><td>$item_1</td><td>$item_2</td><td>$item_3</td><td>$ite
> m_4</td><td>$item_5</td></tr>\n";
> > }
> > /* Increase record count and total_points to date */
> > $i++;
> > $total_points += $item_5;
> > }
> > /* close everything up */
> > print "<tr><th colspan=5>Total Points Earned: $total_points</th></tr>";
> > print "</table>";
> > }
> >
> > ?>
> >
> > --
> > 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
attached mail follows:
what is the 2? in the order by statement mean?
thanks
-----Original Message-----
From: Raúl Castro [mailto:ora7
cdmb.gov.co]
Sent: Thursday, June 03, 2004 6:20 PM
To: php-general
lists.php.net
Subject: Re: [PHP] Best way to sort?
The best way is:
SELECT person_name, count(*)
FROM table_name
GROUP BY person_name
ORDER BY 2 DESC
----- Original Message -----
From: "Daniel Clark" <dclark
nwlink.com>
To: "Brian Dunning" <brian
briandunning.com>
Cc: <php-general
lists.php.net>
Sent: Thursday, June 03, 2004 10:30 AM
Subject: Re: [PHP] Best way to sort?
> SELECT DISTINCT person_name, count(*)
> FROM table_name
> GROUP BY person_name
> ORDER BY 2 DESC
>
> > I'm not sure if this is a complex SQL query or a PHP array sorting
> > thing, but what's the best way to take this data:
> >
> > Tom
> > Greg
> > Brian
> > Tom
> > Brian
> > Tom
> >
> > And return the following results, sorted by number of records:
> >
> > Tom - 3
> > Brian - 2
> > Greg - 1
> >
> > Any thoughts?
> >
> > --
> > 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--------------------------------------------------------------------
Disclaimer
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is
intended for the attention and use only of the addressee.
Should you have received this e-mail in error, please delete
and destroy it and any attachments thereto immediately.
Under no circumstances will the Cape Technikon or the sender
of this e-mail be liable to any party for any direct, indirect,
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911
attached mail follows:
Order by the 2nd column
>>what is the 2? in the order by statement mean?
>>thanks
>>
>>-----Original Message-----
>>From: Raúl Castro [mailto:ora7
cdmb.gov.co]
>>Sent: Thursday, June 03, 2004 6:20 PM
>>To: php-general
lists.php.net
>>Subject: Re: [PHP] Best way to sort?
>>
>>
>>The best way is:
>>
>>SELECT person_name, count(*)
>>FROM table_name
>>GROUP BY person_name
>>ORDER BY 2 DESC
attached mail follows:
Thanks very much!
Marek Kilimajer wrote:
> bob pilly wrote:
>
>> Hi All
>>
>> I am new to classes and are trying to work out whether
>> they will make my coding experience easier. I have
>> written the following test class which is trying to
>> take three variables from a mssql query and add them
>> as variables in a new class. This isnt working as i
>> keep getting an error that says ;
>>
>> Warning: Missing argument 1 for app() in
>> /var/www/htdocs/temp3.php on line 13
>>
>> Warning: Missing argument 2 for app() in
>> /var/www/htdocs/temp3.php on line 13
>>
>> Warning: Missing argument 3 for app() in
>> /var/www/htdocs/temp3.php on line 13
>>
>> the code .....
>> //a basic class to store basic appointment details in
>> class App {
>>
>> var $name;
>> var $the_date;
>> var $result;
>>
>> //add values to the variables
>>
>
> This is the function's constructor, it's called when you create a
> class instance using "new" operator:
>
>> function App($app1name,$appdate,$appresult){
>> $this->name=$app1name;
>> $this->the_date=$appdate;
>> $this->result=$appresult;
>> }
>>
>> }
>>
>> $query="select app1name,appdate,appresult from
>> appresult where appdate > 'jun 01 2004'";
>> $qresult=mssql_query($query,$numero);//get the number
>> of rows returned
>> $numrow=mssql_num_rows($qresult);
>> if($row=mssql_fetch_array($qresult)){
>> $i=0;
>> do{
>> $j=$i;
>
>
> So instead of:
>
>> $j= new App;
>>
>> $j->App($row[app1name],$row['appdate'],$row['appresult']);
>
>
> you have to suply the arguments to the contructor this way:
>
> $j= new App($row[app1name],$row['appdate'],$row['appresult']);
>
>> }
>> while($row=mssql_fetch_array($qresult));
>> }
>>
>> ?>
>>
>>
>> Is there a syntax problem with the way im trying to
>> pass the value of the $row array cells into the class
>> function?
>>
>> I have looked at the online manual for classes but
>> find it a bit confusing on how to input and extract
>> variables data in classes. Any help or pointing in the
>> direction of some good docs would be greatly
>> appreciated!
>>
>> thanks for any help in advance.
>>
>
attached mail follows:
why is this not working. I am using instead of a form ($name =
$_POST[name];)
and linking to it from a users logged in page.
$FirstName = $_SESSION['first_name'];
$LastName = $_SESSION['last_name'];
$name = "$FirstName , $LastName";
Mark
attached mail follows:
Mark,
You need to do this:
$name = " . $FirstName . " , " . $LastName . ";
Regards
Enda
--
On 05/06/2004 01:22, "BigMark" <neretlis
westnet.com.au> wrote:
> why is this not working. I am using instead of a form ($name =
> $_POST[name];)
> and linking to it from a users logged in page.
>
> $FirstName = $_SESSION['first_name'];
> $LastName = $_SESSION['last_name'];
> $name = "$FirstName , $LastName";
>
> Mark
attached mail follows:
On Fri, Jun 04, 2004 at 04:22:57PM -0800, BigMark wrote:
> why is this not working. I am using instead of a form ($name =
> $_POST[name];)
> and linking to it from a users logged in page.
>
> $FirstName = $_SESSION['first_name'];
> $LastName = $_SESSION['last_name'];
> $name = "$FirstName , $LastName";
>
> Mark
>
Have you started the session? Each page needs a session_start() call before
accessing session variables. That is,
session_start();
$FirstName = $_SESSION['first_name'];
$LastName = $_SESSION['last_name'];
$name = "$FirstName , $LastName";
--
Jim Kaufman
Linux Evangelist
public key 0x6D802619
http://www.linuxforbusiness.net
attached mail follows:
Did you have session_start() on this page before accessing the session variables?
Could also do:
$name = "$_SESSION['first_name'] , $_SESSION['last_name']" ;
>>why is this not working. I am using instead of a form ($name =
>>$_POST[name];)
>>and linking to it from a users logged in page.
>>
>>$FirstName = $_SESSION['first_name'];
>>$LastName = $_SESSION['last_name'];
>>$name = "$FirstName , $LastName";
>>
>>Mark
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
attached mail follows:
Hi there
we need to run php under another user account as we are setting up a
link with it to Qmail. Our plan is to use:
php-cgi+suexec for this. fastcgi may be an alternative and we are just
wondering if there is anything bad about using fastcgi for this?
Any help appreciated
Thanks
Ade
attached mail follows:
Hi there
we need to run php under another user account as we are setting up a
link with it to Qmail. Our plan is to use:
php-cgi+suexec for this. fastcgi may be an alternative and we are just
php-cgi+wondering if there is anything bad about using fastcgi for this?
Any help appreciated
Thanks
Ade
attached mail follows:
Hi,
i'm trying to access my netscape.com inbox with php,
so i started to decode the ssl session and got all sent packets
in plaintext, not really hard. but know i have to deal with encrypted
cookies and i have no clue what i have to do. i found no help
while i crawled the web for hours.
an example:
Cookie:
MC_MS_LDC=1 activationde 1 1086246633 0 1086245744 0;
MC_NPID=mc-sr12.websys.aol.com/9738;
MC_SESSION0=%2FO7gI0OrZnCyKU9ZmWBsOA%3D%3D-diAxLjAga2lkIDIwMDQwNjAyMDEwMDAxM
TE1OQ%3D%3D-nrVhh6NyA2ucnTGoqHuGR%2FW8HXEp74Oo%2FBWpqzwyvOvf77IyX6CWZ0YIHJyg
TZzKxaQ4181tOTlZwZI11OGY1TfbIX1JRDLS3LL2xDtnIaXYf7V8yDXTeA%3D%3D;
C_SITE_ACT=yiBeRJ8fvFTwAFG+ZefJmA==-yI/TFXODOR4TuSu2hocH7bDa744fsOwU+92Ub3mW
tfBUOnWuJkVCJ34mEq9zmEsz5mto1KN24NA=;
MC_SITE_ACT=yiBeRJ8fvFTwAFG+ZefJmA==-yI/TFXODOR7m9s106Mf3qlzvgDhdyOqWVpA43Kx
7G1H3uij9bZQ7iXEb3BgZsRJwqoPSTd1IzJ4=;
MC_SITEID=nscpenusmail;
MC_SSTATE=mach5%3d1;
MC_AUTHLEV=2
i tried to use rawurldecode() and base64_decode and i got only one small
part in plaintext:
diAxLjAga2lkIDIwMDQwNjAyMDEwMDAxMTE1OQ%3D%3D
v 1.0 kid 200406020100011159
someone in here that have a clue what should i do next?
regards
attached mail follows:
I do this:
<?php
$cmd = 'rsync -Razv file.php user
host::zone';
exec($cms, $log, $ret);
?>
when an rsync error occure, if I run this script by a web server I get
no output (errors go correctly into $log and $ret), while running the
script in a console environment I get errors in the standard output even
if I suppress them with "
".
anyone knows a workaround? is this a bug?
bye, alberto.
--
"Imagination is more important than knowledge"
attached mail follows:
I've just installed Fedora Core 2, including I believe both PHP & MySQL..
However whenever I try and run something that connects to MySQL, it comes up
with the following:
"cannot load MySQL extension,
please check PHP Configuration."
Does this mean anything to anyone?
I've checked loads of things, like MySQL is running, etc etc But without
luck..
Cheers
Nunners
attached mail follows:
Looks like the mysql module for php is not loaded.
Is extension=mysql.so included in the php.ini.
Nunners wrote on vrijdag 4 juni 2004 14:07:
> I've just installed Fedora Core 2, including I believe both PHP &
> MySQL.. However whenever I try and run something that connects to
> MySQL, it comes up with the following:
>
>
>
> "cannot load MySQL extension,
>
> please check PHP Configuration."
>
>
>
> Does this mean anything to anyone?
>
>
>
> I've checked loads of things, like MySQL is running, etc etc But
> without luck..
>
>
>
> Cheers
>
> Nunners
attached mail follows:
Run: rpm -q php-mysql
From the command line as root and see if it is there, if not go out and
download the fedora rpm with that in the title, since that would be the
missing piece.
HTH,
Robert
-----Original Message-----
From: Nunners [mailto:webmaster
jnsolutions.co.uk]
Sent: Friday, June 04, 2004 8:07 AM
To: php-general
lists.php.net
Subject: [PHP] MySQL & PHP
I've just installed Fedora Core 2, including I believe both PHP &
MySQL.. However whenever I try and run something that connects to MySQL,
it comes up with the following:
"cannot load MySQL extension,
please check PHP Configuration."
Does this mean anything to anyone?
I've checked loads of things, like MySQL is running, etc etc But without
luck..
Cheers
Nunners
attached mail follows:
check: http://www.cs.technion.ac.il/~biham/Reports/Tiger/testresults.html
The results you posted seem to be right.
Carl S. in 't Veld wrote on vrijdag 4 juni 2004 0:52:
> I am trying to generate tiger tree hashes the same way as
> directconnect does, but I am failing.
>
> I checked the output from php with the reference vectors from
> http://www.cs.technion.ac.il/~biham...ssie-format.dat
> and they appear to be different!
>
> echo bin2hex(mhash(MHASH_TIGER, 'abc'))."<br/>\n";
> outputs
> f258c1e88414ab2a527ab541ffc5b8bf935f7b951c132951
> instead of
> 2AAB1484E8C158F2BFB8C5FF41B57A525129131C957B5F93
>
> and, for example,
> echo bin2hex(mhash(MHASH_TIGER, 'message digest'))."<br/>\n";
> outputs
> 951a2078cbf881d91c441e754830cf0df6295aa51aca7f51
> instead of
> D981F8CB78201A950DCF3048751E441C517FCA1AA55A29F6
>
> What am I doing wrong here?
attached mail follows:
Am Fr, 2004-06-04 um 00.14 schrieb Nick Wilson:
> Hi everyone,
>
> Can anyone recommend a good debugger for *nix?
Zend Studio
> Many thx!
> --
> Nick W
--
Regards
Marco
attached mail follows:
Xdebug, is free and works on unix and windows and it is a PHP extension.
www.xdebug.org
Yann
On Fri, 2004-06-04 at 09:51, Marco Schuler wrote:
> Am Fr, 2004-06-04 um 00.14 schrieb Nick Wilson:
> > Hi everyone,
> >
> > Can anyone recommend a good debugger for *nix?
>
> Zend Studio
>
> > Many thx!
> > --
> > Nick W
>
> --
> Regards
> Marco
attached mail follows:
Hi, all --
I am working up a CGI script to take advantage of Apache's suEXEC so that
the web server can manipulate files as the site owner. I have already
managed a simple
$f = fopen("/path/to/docroot/testfile",'w') ;
fwrite($f,"hi!\n") ;
fclose($f) ;
and know that it works as intended, but now I seem completely unable to
get any $_POST (or even $_GET) data into the script. I suspect, from
reading the manual and noting the warnings, that any GET data will be
ignored, and that's fine, but I know that I can provide that without even
messing about with a form that I might somehow be screwing up, so I
thought I'd try it...
My code is as simple as
#!/usr/local/bin/php
<?php
print "Content-type: text/html\n\n" ;
print "_POST IS ." ; print_r($_POST) ; print ".<br>\n" ;
print "_GET IS ." ; print_r($_GET) ; print ".<br>\n" ;
print "Enter your password:<br>\n" ;
print "<form method='post'>\n" ;
print "<input type='password' name='pass'>\n" ;
print "<br>\n<input type='submit' value='ENTER'>\n" ;
print "</form>\n" ;
exit ;
?>
but I only get
_POST IS .Array ( ) .
_GET IS .Array ( ) .
Enter your password:
____________________
ENTER
even after submitting. Switching to
<form method='get'>
doesn't help anything.
So how on earth does one get data into a CGI PHP script?
TIA & HAND
:-D
--
David T-G
davidtg
justpickone.org
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)
iD8DBQFAwHQ7Gb7uCXufRwARAqo2AKDOHvJltpoBfDKLXYBt4VIrNcqRjACg25yp
gXvr4ELboNTHRjOYQ1pFn+g=
=ms+o
-----END PGP SIGNATURE-----
attached mail follows:
Has anyone here had recent success compiling PHP with mnoGoSearch?
I'm trying to get PHP 4.3.7 and mnoGoSearch 3.1.21 to work together, but
it's just not working. mnoGoSearch configures and installs fine (in
"/usr/local/mnogosearch"), and PHP configures fine. But during PHP's
make, I get all sorts of errors at the end of the compilation:
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x4): multiple
definition of `mysql_port'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x4): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x8): multiple
definition of `mysql_unix_port'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x8): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0xc): multiple
definition of `net_buffer_length'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0xc): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x10): multiple
definition of `max_allowed_packet'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x10): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x14): multiple
definition of `net_read_timeout'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x14): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x18): multiple
definition of `net_write_timeout'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.data+0x18): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x0): In function
`mysql_server_init':
: multiple definition of `mysql_server_init'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x0): first defined here
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x16c0): In function
`mysql_once_init':
: multiple definition of `mysql_once_init'
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x16c0): first defined
here
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x10): In function
`mysql_server_end':
...
(and many more lines like this, substituting "mysql_server_end" with
other mysql-related items).
It certainly seems MySQL related. Any ideas?
Here's my PHP configure line:
./configure --prefix=/usr/local/apache
--with-apxs=/usr/local/apache/bin/apxs --enable-trans-sid
--enable-inline-optimization --with-gettext --enable-ftp --with-zlib
--with-pspell --with-curl --with-imap --with-kerberos --with-xml
--with-mcrypt --with-mnogosearch=/usr/local/mnogosearch
--with-mysql=/usr
Thanks,
--
Aaron Gould
Parts Canada - Web Developer
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]