php-general Digest 15 Mar 2009 17:07:48 -0000 Issue 6013

Topics (messages 290071 through 290090):

Reading from a COM port in Windows blows up
        290071 by: Matt Neimeyer
        290072 by: Manuel Lemos

how can genrate different URLs but showing same html page
        290073 by: rahulb

GeoIP?
        290074 by: Michelle Konzack
        290075 by: Michelle Konzack
        290078 by: tedd
        290080 by: Nitsan Bin-Nun
        290082 by: Per Jessen
        290083 by: Michelle Konzack
        290090 by: Michelle Konzack

Re: Problem with passing and Area in a $_POST
        290076 by: tedd
        290084 by: Shawn McKenzie
        290085 by: Richard Kurth
        290086 by: Richard Kurth
        290087 by: Phpster
        290089 by: Richard Kurth

Re: left join does not work, why?
        290077 by: PJ
        290079 by: 9el
        290081 by: Jan G.B.
        290088 by: Marc Christopher Hall

Administrivia:

To subscribe to the digest, e-mail:
        [email protected]

To unsubscribe from the digest, e-mail:
        [email protected]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
I just recently got a new Onkyo TX-SR706 Audio Receiver that has an
RS232 interface and I thought... cool... Build a Web Interface so I
can control it from several rooms away.

The code below works using PHP 5.2.8 under Apache (XAMPP) on Windows
XP to change the current input of my Audio Receiver. So I know at
least one way communication works.

If I swap out !1SLI01 (SeLect Input 01) for !1SLIQSTN which should
query the current input and uncomment the lines that are commented out
below "COM1 Replied". That PHP session and the COM Port itself  lock
up until I reboot the machine.

Being able to query the device would be nice... but isn't strictly
necessary... So I just want to make sure I'm not doing something crazy
/ wrong.

------------------------------------------------------------------------------------------

$Set_Mode = "MODE COM1: BAUD=9600 PARITY=N DATA=8 STOP=1 DTR=OFF RTS=OFF";
exec($Set_Mode, $Output, $Result);

echo "<pre>".implode("\n",$Output)."</pre>";
echo "<br><br>";

switch($Result)
        {
        case 0: echo "COM1 Configured<br>";             $BadConfig = false;     
break;
        default:        echo "COM1 not configured<br>"; $BadConfig = true;      
break;
        }

if(!$BadConfig)
        {
        $ComPort = fopen("COM1", "wb+");

        if(!$ComPort)
                { echo "COM1 not opened<br>"; }
        else
                {
                echo "COM1 Opened<br>";
                $Command = "!1SLI01\n";
                $result = fwrite($ComPort,$Command);
                if(!$result)
                        { echo "COM1 Error<br>"; }
                else
                        {
                        echo "COM1 Replied:<br>";
//                      $Buffer = fgets($ComPort,1024);
//                      while(trim($Buffer) != "")
//                              {
//                              echo $Buffer."<br>";
//                              $Buffer = fgets($ComPort,1024);
//                              }
                        }
                if(fclose($ComPort)) { echo "COM1 Closed<br>"; }
                }
        }

--- End Message ---
--- Begin Message ---
Hello,

on 03/15/2009 01:56 AM Matt Neimeyer said the following:
>       $ComPort = fopen("COM1", "wb+");

I suspect all this does is opening a file named COM1 . Shouldn't that be
 "COM1:" instead of just COM1?

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--- End Message ---
--- Begin Message ---
Hi, I am developing forum website as my final year project. I am having
problem in generating different URLs but keeping the same page..

Scenario: I am showing threads for different languages in different page,
but since format of data is same for threads of all the languages, so what i
planned was, to write one single xhtml page, which will be populated by data
at run time using php/mysql. but i want to show different URLs for different
languages thread, even when same html page is called.

i am taking the reference of bytes.com for this design.

i would be really grateful for any help in this.

thanks in advance.

-- 
View this message in context: 
http://www.nabble.com/how-can-genrate-different-URLs-but-showing-same-html-page-tp22520985p22520985.html
Sent from the PHP - General mailing list archive at Nabble.com.


--- End Message ---
--- Begin Message ---
Hello,

I am in creation of a WaveLAN service in Germany  and  my  HTML-Form  is
DoS'ed be idiots outside of Germany.  Can someone tell me how to prevent
peoples, filling out the form without being in Germany?

Note: I do not want to load the whole GeoIP Database in my scripts.

Or is there a Free Online-Service which can do this?

If not, it would be a nice project to start and could work like the RBL.


Thanks, Greetings and nice Day/Evening
    Michelle Konzack
    Systemadministrator
    24V Electronic Engineer
    Tamay Dogan Network
    Debian GNU/Linux Consultant

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
<http://www.tamay-dogan.net/>                 Michelle Konzack
<http://www.can4linux.org/>                   Apt. 917
<http://www.flexray4linux.org/>               50, rue de Soultz
Jabber [email protected]           67100 Strasbourg/France
IRC #Debian (irc.icq.com)                     Tel. DE: +49 177 9351947
ICQ #328449886                                Tel. FR: +33  6  61925193

Attachment: signature.pgp
Description: Digital signature


--- End Message ---
--- Begin Message ---
Forgotten one thing:

Am 2009-03-15 13:52:52, schrieb Michelle Konzack:
> Hello,
> 
> I am in creation of a WaveLAN service in Germany  and  my  HTML-Form  is
> DoS'ed be idiots outside of Germany.  Can someone tell me how to prevent
> peoples, filling out the form without being in Germany?
> 
> Note: I do not want to load the whole GeoIP Database in my scripts.
> 
> Or is there a Free Online-Service which can do this?
> 
> If not, it would be a nice project to start and could work like the RBL.
------------------------ END OF REPLIED MESSAGE ------------------------

Yes, I  KNOW  <http://search.cpan.org/~borisz/Geo-IP-1.37/lib/Geo/IP.pm>
and I have tried to implement it in PHP, but it is very slow...

Thanks, Greetings and nice Day/Evening
    Michelle Konzack
    Systemadministrator
    24V Electronic Engineer
    Tamay Dogan Network
    Debian GNU/Linux Consultant

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
<http://www.tamay-dogan.net/>                 Michelle Konzack
<http://www.can4linux.org/>                   Apt. 917
<http://www.flexray4linux.org/>               50, rue de Soultz
Jabber [email protected]           67100 Strasbourg/France
IRC #Debian (irc.icq.com)                     Tel. DE: +49 177 9351947
ICQ #328449886                                Tel. FR: +33  6  61925193

Attachment: signature.pgp
Description: Digital signature


--- End Message ---
--- Begin Message ---
At 1:52 PM +0100 3/15/09, Michelle Konzack wrote:
Hello,

I am in creation of a WaveLAN service in Germany  and  my  HTML-Form  is
DoS'ed be idiots outside of Germany.  Can someone tell me how to prevent
peoples, filling out the form without being in Germany?

Note: I do not want to load the whole GeoIP Database in my scripts.

Or is there a Free Online-Service which can do this?

If not, it would be a nice project to start and could work like the RBL.


Thanks, Greetings and nice Day/Evening
    Michelle Konzack
    Systemadministrator
    24V Electronic Engineer
    Tamay Dogan Network
    Debian GNU/Linux Consultant

I'll answer, but I'm not in Germany.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
Take a look at this:
http://www.maxmind.com/app/geolitecountry

Use indexes, I think the checkup won't take long.

HTH,
Nitsan

On Sun, Mar 15, 2009 at 3:06 PM, tedd <[email protected]> wrote:

> At 1:52 PM +0100 3/15/09, Michelle Konzack wrote:
>
>> Hello,
>>
>> I am in creation of a WaveLAN service in Germany  and  my  HTML-Form  is
>> DoS'ed be idiots outside of Germany.  Can someone tell me how to prevent
>> peoples, filling out the form without being in Germany?
>>
>> Note: I do not want to load the whole GeoIP Database in my scripts.
>>
>> Or is there a Free Online-Service which can do this?
>>
>> If not, it would be a nice project to start and could work like the RBL.
>>
>>
>> Thanks, Greetings and nice Day/Evening
>>    Michelle Konzack
>>    Systemadministrator
>>    24V Electronic Engineer
>>    Tamay Dogan Network
>>    Debian GNU/Linux Consultant
>>
>
> I'll answer, but I'm not in Germany.
>
> Cheers,
>
> tedd
>
> --
> -------
> http://sperling.com  http://ancientstones.com  http://earthstones.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Michelle Konzack wrote:

> Hello,
> 
> I am in creation of a WaveLAN service in Germany  and  my  HTML-Form 
> is
> DoS'ed be idiots outside of Germany.  Can someone tell me how to
> prevent peoples, filling out the form without being in Germany?
> 
> Note: I do not want to load the whole GeoIP Database in my scripts.

The easiest is to use a DNS service - this is the best one I know:
http://countries.nerd.dk/


/Per

-- 
Per Jessen, Zürich (9.8°C)


--- End Message ---
--- Begin Message ---
Hello Nitsan,

Am 2009-03-15 15:39:26, schrieb Nitsan Bin-Nun:
> Take a look at this:
> http://www.maxmind.com/app/geolitecountry
> 
> Use indexes, I think the checkup won't take long.

I have it installed (php5-geoip, 1.0.3-1) , but it is realy slow

OK, now I have greped for DE and the database is  now  only  9607  lines
insteed of 108166 and it is a little bit faster...  However,  it  has  a
heavy Disk-IO and I do not know, if my Hoster like such stuff.  :-/

Maybe PostgreSQL or MySQL would be better?

Thanks, Greetings and nice Day/Evening
    Michelle Konzack
    Systemadministrator
    24V Electronic Engineer
    Tamay Dogan Network
    Debian GNU/Linux Consultant

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
<http://www.tamay-dogan.net/>                 Michelle Konzack
<http://www.can4linux.org/>                   Apt. 917
<http://www.flexray4linux.org/>               50, rue de Soultz
Jabber [email protected]           67100 Strasbourg/France
IRC #Debian (irc.icq.com)                     Tel. DE: +49 177 9351947
ICQ #328449886                                Tel. FR: +33  6  61925193

Attachment: signature.pgp
Description: Digital signature


--- End Message ---
--- Begin Message ---
Hello Per,

Am 2009-03-15 15:12:47, schrieb Per Jessen:
> The easiest is to use a DNS service - this is the best one I know:
> http://countries.nerd.dk/

This is cool...

OK, I have imported the ISO codes list and it just works how it should.

Thanks, Greetings and nice Day/Evening
    Michelle Konzack
    Systemadministrator
    24V Electronic Engineer
    Tamay Dogan Network
    Debian GNU/Linux Consultant

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
<http://www.tamay-dogan.net/>                 Michelle Konzack
<http://www.can4linux.org/>                   Apt. 917
<http://www.flexray4linux.org/>               50, rue de Soultz
Jabber [email protected]           67100 Strasbourg/France
IRC #Debian (irc.icq.com)                     Tel. DE: +49 177 9351947
ICQ #328449886                                Tel. FR: +33  6  61925193

Attachment: signature.pgp
Description: Digital signature


--- End Message ---
--- Begin Message ---
At 6:31 PM -0700 3/14/09, Richard Kurth wrote:
I have a script that is passing a area in a $_POST and it does not pass
the data. When I try to look at the data with $_POST['fieldorder'] it
its empty but when I look at it with $_REQUEST['fieldorder'] the data is
there. This seams very strange to me. It has been working for about 6
months with no problem and then all of a sudden it does not pass the
data anymore. The real funny thing is the rest of the data that is sent
that is not an area gets past in a $_POST works just fine.Would there be
something in the php.ini file that I have changed that would case this.

What method is your form using?

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
tedd wrote:
> At 6:31 PM -0700 3/14/09, Richard Kurth wrote:
>> I have a script that is passing a area in a $_POST and it does not pass
>> the data. When I try to look at the data with $_POST['fieldorder'] it
>> its empty but when I look at it with $_REQUEST['fieldorder'] the data is
>> there. This seams very strange to me. It has been working for about 6
>> months with no problem and then all of a sudden it does not pass the
>> data anymore. The real funny thing is the rest of the data that is sent
>> that is not an area gets past in a $_POST works just fine.Would there be
>> something in the php.ini file that I have changed that would case this.
> 
> What method is your form using?
> 
> Cheers,
> 
> tedd
> 

And what is an area?  A textarea?

-- 
Thanks!
-Shawn
http://www.spidean.com

--- End Message ---
--- Begin Message ---
tedd wrote:
At 6:31 PM -0700 3/14/09, Richard Kurth wrote:
I have a script that is passing a area in a $_POST and it does not pass
the data. When I try to look at the data with $_POST['fieldorder'] it
its empty but when I look at it with $_REQUEST['fieldorder'] the data is
there. This seams very strange to me. It has been working for about 6
months with no problem and then all of a sudden it does not pass the
data anymore. The real funny thing is the rest of the data that is sent
that is not an area gets past in a $_POST works just fine.Would there be
something in the php.ini file that I have changed that would case this.

What method is your form using?

Cheers,

tedd

It is using POST as it always has but it just stopped working for the one post the one with an array in it.
--- End Message ---
--- Begin Message ---
Shawn McKenzie wrote:
tedd wrote:
At 6:31 PM -0700 3/14/09, Richard Kurth wrote:
I have a script that is passing a area in a $_POST and it does not pass
the data. When I try to look at the data with $_POST['fieldorder'] it
its empty but when I look at it with $_REQUEST['fieldorder'] the data is
there. This seams very strange to me. It has been working for about 6
months with no problem and then all of a sudden it does not pass the
data anymore. The real funny thing is the rest of the data that is sent
that is not an area gets past in a $_POST works just fine.Would there be
something in the php.ini file that I have changed that would case this.
What method is your form using?

Cheers,

tedd


And what is an area?  A textarea?

This is the form that is being sent as a post and the fieldorder[] is the part that is not sending properly. But it has worked for about a year in the script. It just stopped working. and I did not change anything in this script


<form action="import.php" method="post">
<!-- <form action="testimport.php" method="post"> -->
<INPUT TYPE=HIDDEN NAME=members_id VALUE=<?php echo $_SESSION["members_id"];?>>
   <INPUT TYPE=HIDDEN NAME=copy VALUE='<?php echo $_POST['copy'];?>'>
   <INPUT TYPE=HIDDEN NAME=format VALUE=<?php echo $_POST['format'];?>>
    <input type="hidden" name="doit" value="no">

   <TABLE>
       </TD></TR>
<TR><TH><font class=fieldlabel>Our Fields</font></TH><TH><font class=fieldlabel>Your Data</font></TH></TR>
       <?php
       /*echo $_POST['format'];
       echo"<br>";
       echo $copy;
       echo"<br>";*/
$fieldnumber = 0;
         while (list(,$field) = each($fields)){
             echo "    <TR>\n";
             echo "        <TD><SELECT NAME=fieldorder[]>\n";
             reset($possiblefields);
             reset($descriptionfields);
             $anyselected = '';

             while (list(,$description) = each($descriptionfields)){
                  list(,$possible) = each($possiblefields);

$selected = @(($fieldorder[$fieldnumber] == $possible) ? 'SELECTED' : '');
                 if ($fieldnumber >= count($fieldorder) && !$anyselected){
                     $selected = 'SELECTED';
                 }
echo "<OPTION value=\"$possible\" $selected>$description</OPTION>\n";
             }
             echo "        </SELECT></TD>\n";
             echo "        <TD>$field</TD>\n";
             echo "    </TR>\n";
             $fieldnumber++;
         }
?>
   </TABLE>
<TABLE> <TR ALIGN=CENTER>
           <TD><input type=submit name='recorddelta' value='<|'></TD>
           <TD><input type=submit name='recorddelta' value='<10'></TD>
           <TD><input type=submit name='recorddelta' value='<'></TD>
           <TD><input type=submit name='recorddelta' value='>'></TD>
           <TD><input type=submit name='recorddelta' value='>10'></TD>
           <TD><input type=submit name='recorddelta' value='|>'></TD>
       </TR>
       <TR>
           <TD COLSPAN=6>
Jump To: <INPUT NAME=recordnumber SIZE=5 VALUE=<?php echo $recordnumber;?>>
               <INPUT TYPE=SUBMIT NAME=recorddelta VALUE="Jump">
           </TD>
       </TR>
   </TABLE>
<font class=fieldlabel>If the first Row is the Header Row You must check this box</FONT> <input type="checkbox" name="firstheader" value="">
<br>
<font class=fieldlabel>Pick a Category to import these contacts to</FONT>
<br>
<?php
$sqlu="SELECT value,discription FROM category WHERE members_id = '$_SESSION[members_id]'";
radio($sqlu,'catagory','value','discription',$row["catagory"]);
?> <HR>
   <font class="instructions">
       <P>Once you're happy with the fields lining up click Import</P>
<P><I>Double-check everything before you IMPORT</I></P></FONT>
   <INPUT TYPE=SUBMIT NAME=import VALUE="IMPORT">
</FORM>


--- End Message ---
--- Begin Message --- I don't think that fieldorder needs to be an array. I don't see you using it as a multiselect. Does this field occur multiple times on the form?

Bastien

Sent from my iPod

On Mar 15, 2009, at 11:56, Richard Kurth <[email protected]> wrote:

Shawn McKenzie wrote:
tedd wrote:

At 6:31 PM -0700 3/14/09, Richard Kurth wrote:

I have a script that is passing a area in a $_POST and it does not pass the data. When I try to look at the data with $_POST['fieldorder'] it its empty but when I look at it with $_REQUEST['fieldorder'] the data is there. This seams very strange to me. It has been working for about 6 months with no problem and then all of a sudden it does not pass the data anymore. The real funny thing is the rest of the data that is sent that is not an area gets past in a $_POST works just fine.Would there be something in the php.ini file that I have changed that would case this.

What method is your form using?

Cheers,

tedd



And what is an area?  A textarea?


This is the form that is being sent as a post and the fieldorder[] is the part that is not sending properly. But it has worked for about a year in the script. It just stopped working. and I did not change anything in this script


<form action="import.php" method="post">
<!-- <form action="testimport.php" method="post"> -->
<INPUT TYPE=HIDDEN NAME=members_id VALUE=<?php echo $_SESSION["members_id"];?>>
  <INPUT TYPE=HIDDEN NAME=copy VALUE='<?php echo $_POST['copy'];?>'>
  <INPUT TYPE=HIDDEN NAME=format VALUE=<?php echo $_POST['format'];?>>
   <input type="hidden" name="doit" value="no">

  <TABLE>
      </TD></TR>
<TR><TH><font class=fieldlabel>Our Fields</font></TH><TH><font class=fieldlabel>Your Data</font></TH></TR>
      <?php
      /*echo $_POST['format'];
      echo"<br>";
      echo $copy;
      echo"<br>";*/
            $fieldnumber = 0;
        while (list(,$field) = each($fields)){
            echo "    <TR>\n";
            echo "        <TD><SELECT NAME=fieldorder[]>\n";
            reset($possiblefields);
            reset($descriptionfields);
            $anyselected = '';

            while (list(,$description) = each($descriptionfields)){
                 list(,$possible) = each($possiblefields);

$selected = @(($fieldorder[$fieldnumber] == $possible) ? 'SELECTED' : ''); if ($fieldnumber >= count($fieldorder) && ! $anyselected){
                    $selected = 'SELECTED';
                }
echo "<OPTION value=\"$possible\" $selected> $description</OPTION>\n";
            }
            echo "        </SELECT></TD>\n";
            echo "        <TD>$field</TD>\n";
            echo "    </TR>\n";
            $fieldnumber++;
        }
           ?>
  </TABLE>
 <TABLE>                <TR ALIGN=CENTER>
          <TD><input type=submit name='recorddelta' value='<|'></TD>
          <TD><input type=submit name='recorddelta' value='<10'></TD>
          <TD><input type=submit name='recorddelta' value='<'></TD>
          <TD><input type=submit name='recorddelta' value='>'></TD>
          <TD><input type=submit name='recorddelta' value='>10'></TD>
          <TD><input type=submit name='recorddelta' value='|>'></TD>
      </TR>
      <TR>
          <TD COLSPAN=6>
Jump To: <INPUT NAME=recordnumber SIZE=5 VALUE=<?php echo $recordnumber;?>>
              <INPUT TYPE=SUBMIT NAME=recorddelta VALUE="Jump">
          </TD>
      </TR>
  </TABLE>
<font class=fieldlabel>If the first Row is the Header Row You must check this box</FONT> <input type="checkbox" name="firstheader" value="">
<br>
<font class=fieldlabel>Pick a Category to import these contacts to</ FONT>
<br>
<?php
$sqlu="SELECT value,discription FROM category WHERE members_id = '$_SESSION[members_id]'";
radio($sqlu,'catagory','value','discription',$row["catagory"]);
?>          <HR>
  <font class="instructions">
      <P>Once you're happy with the fields lining up click Import</P>
    <P><I>Double-check everything before you IMPORT</I></P></FONT>
  <INPUT TYPE=SUBMIT NAME=import VALUE="IMPORT">
</FORM>


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


--- End Message ---
--- Begin Message ---
Phpster wrote:
I don't think that fieldorder needs to be an array. I don't see you using it as a multiselect. Does this field occur multiple times on the form?

Bastien

Sent from my iPod

On Mar 15, 2009, at 11:56, Richard Kurth <[email protected]> wrote:

Shawn McKenzie wrote:
tedd wrote:

At 6:31 PM -0700 3/14/09, Richard Kurth wrote:

I have a script that is passing a area in a $_POST and it does not pass
the data. When I try to look at the data with $_POST['fieldorder'] it
its empty but when I look at it with $_REQUEST['fieldorder'] the data is
there. This seams very strange to me. It has been working for about 6
months with no problem and then all of a sudden it does not pass the
data anymore. The real funny thing is the rest of the data that is sent that is not an area gets past in a $_POST works just fine.Would there be something in the php.ini file that I have changed that would case this.

What method is your form using?

Cheers,

tedd



And what is an area?  A textarea?


This is the form that is being sent as a post and the fieldorder[] is the part that is not sending properly. But it has worked for about a year in the script. It just stopped working. and I did not change anything in this script


<form action="import.php" method="post">
<!-- <form action="testimport.php" method="post"> -->
<INPUT TYPE=HIDDEN NAME=members_id VALUE=<?php echo $_SESSION["members_id"];?>>
  <INPUT TYPE=HIDDEN NAME=copy VALUE='<?php echo $_POST['copy'];?>'>
  <INPUT TYPE=HIDDEN NAME=format VALUE=<?php echo $_POST['format'];?>>
   <input type="hidden" name="doit" value="no">

  <TABLE>
      </TD></TR>
<TR><TH><font class=fieldlabel>Our Fields</font></TH><TH><font class=fieldlabel>Your Data</font></TH></TR>
      <?php
      /*echo $_POST['format'];
      echo"<br>";
      echo $copy;
      echo"<br>";*/
            $fieldnumber = 0;
        while (list(,$field) = each($fields)){
            echo "    <TR>\n";
            echo "        <TD><SELECT NAME=fieldorder[]>\n";
            reset($possiblefields);
            reset($descriptionfields);
            $anyselected = '';

            while (list(,$description) = each($descriptionfields)){
                 list(,$possible) = each($possiblefields);

$selected = @(($fieldorder[$fieldnumber] == $possible) ? 'SELECTED' : ''); if ($fieldnumber >= count($fieldorder) && !$anyselected){
                    $selected = 'SELECTED';
                }
echo "<OPTION value=\"$possible\" $selected>$description</OPTION>\n";
            }
            echo "        </SELECT></TD>\n";
            echo "        <TD>$field</TD>\n";
            echo "    </TR>\n";
            $fieldnumber++;
        }
           ?>
  </TABLE>
 <TABLE>                <TR ALIGN=CENTER>
          <TD><input type=submit name='recorddelta' value='<|'></TD>
          <TD><input type=submit name='recorddelta' value='<10'></TD>
          <TD><input type=submit name='recorddelta' value='<'></TD>
          <TD><input type=submit name='recorddelta' value='>'></TD>
          <TD><input type=submit name='recorddelta' value='>10'></TD>
          <TD><input type=submit name='recorddelta' value='|>'></TD>
      </TR>
      <TR>
          <TD COLSPAN=6>
Jump To: <INPUT NAME=recordnumber SIZE=5 VALUE=<?php echo $recordnumber;?>>
              <INPUT TYPE=SUBMIT NAME=recorddelta VALUE="Jump">
          </TD>
      </TR>
  </TABLE>
<font class=fieldlabel>If the first Row is the Header Row You must check this box</FONT> <input type="checkbox" name="firstheader" value="">
<br>
<font class=fieldlabel>Pick a Category to import these contacts to</FONT>
<br>
<?php
$sqlu="SELECT value,discription FROM category WHERE members_id = '$_SESSION[members_id]'";
radio($sqlu,'catagory','value','discription',$row["catagory"]);
?>          <HR>
  <font class="instructions">
      <P>Once you're happy with the fields lining up click Import</P>
    <P><I>Double-check everything before you IMPORT</I></P></FONT>
  <INPUT TYPE=SUBMIT NAME=import VALUE="IMPORT">
</FORM>



Yes the field order does have a multiselect it selects the order that you what to import a list from a CVS file like first name last name address ets..... it can have 2 up to 25 diferent selections in it. The question was not about that it is way can I not receive the data in that field as a $_POST but I can with a $_REQUEST all the other $_POSTs go thrue without any problem




--- End Message ---
--- Begin Message ---
Daniel Brown wrote:
> On Sat, Mar 14, 2009 at 19:51, PJ <[email protected]> wrote:
>   
>> $sql1 = "SELECT b.id, b.title, b.sub_title, b.descr, b.comment,
>> b.bk_cover, b.copyright, b.ISBN, b.language, b.sellers, c.publisher, <---
>> CONCAT_WS(' ', first_name, last_name) AS Author
>> FROM book AS b
>> LEFT JOIN book_author AS ab ON b.id = ab.bookID
>> LEFT JOIN author AS a ON ab.authID=a.id
>> LEFT JOIN book_publisher as abc ON b.id = abc.bookID // <---
>> LEFT JOIN publishers AS c ON abc.publishers_id = c.id // <---
>> ORDER BY title ASC ";
>> $result1 = mysql_query($sql1, $db);
>> $bookCount = mysql_num_rows($result1);
>>     
>
>     For this and future problems of a similar nature, the quickest and
> easiest way to start debugging is to change the mysql_query() line to
> output the error.  Like so:
>
> <?php
> // ....
> $result1 = mysql_query($sql1,$db) or die("SQL: ".$sql1."\n".mysql_error());
> // ....
> ?>
>
>     If the query fails on $sql1, PHP runs the 'or' as a failure
> fallback and dies by printing the SQL query given and MySQL's error
> response.
>   
Thank you for that. I had not used that as I thought that
error_reporting(E_ALL);
ini_set('display_errors', 1);
would be enough.   =-O

The error reported now is to check the syntax near the commented out lines.
So, what is going on here? I understood that when the lines are
commented out they are not lprocessed.
When I deleted the commented out lines the errors went away.
This does not make sense and obviously could be very misleading in
debugging.


-- 
unheralded genius: "A clean desk is the sign of a dull mind. "
-------------------------------------------------------------
Phil Jourdan --- [email protected]
   http://www.ptahhotep.com
   http://www.chiccantine.com/andypantry.php


--- End Message ---
--- Begin Message ---
-----------------------------------------------------------------------
Use FreeOpenSourceSoftwares, Stop piracy, Let the developers live. Get
a Free CD of Ubuntu mailed to your door without any cost. Visit :
www.ubuntu.com
----------------------------------------------------------------------


On Sun, Mar 15, 2009 at 7:02 PM, PJ <[email protected]> wrote:

> Daniel Brown wrote:
> > On Sat, Mar 14, 2009 at 19:51, PJ <[email protected]> wrote:
> >
> >> $sql1 = "SELECT b.id, b.title, b.sub_title, b.descr, b.comment,
> >> b.bk_cover, b.copyright, b.ISBN, b.language, b.sellers, c.publisher,
> <---
> >> CONCAT_WS(' ', first_name, last_name) AS Author
> >> FROM book AS b
> >> LEFT JOIN book_author AS ab ON b.id = ab.bookID
> >> LEFT JOIN author AS a ON ab.authID=a.id
> >> LEFT JOIN book_publisher as abc ON b.id = abc.bookID // <---
> >> LEFT JOIN publishers AS c ON abc.publishers_id = c.id // <---
> >> ORDER BY title ASC ";
> >> $result1 = mysql_query($sql1, $db);
> >> $bookCount = mysql_num_rows($result1);
> >>
> >
> >     For this and future problems of a similar nature, the quickest and
> > easiest way to start debugging is to change the mysql_query() line to
> > output the error.  Like so:
> >
> > <?php
> > // ....
> > $result1 = mysql_query($sql1,$db) or die("SQL:
> ".$sql1."\n".mysql_error());
> > // ....
> > ?>
> >
> >     If the query fails on $sql1, PHP runs the 'or' as a failure
> > fallback and dies by printing the SQL query given and MySQL's error
> > response.
> >
> Thank you for that. I had not used that as I thought that
> error_reporting(E_ALL);
> ini_set('display_errors', 1);
> would be enough.   =-O
>
> The error reported now is to check the syntax near the commented out lines.
> So, what is going on here? I understood that when the lines are
> commented out they are not lprocessed.
> When I deleted the commented out lines the errors went away.


:P

>
> This does not make sense and obviously could be very misleading in
> debugging.
>
>
> --
> unheralded genius: "A clean desk is the sign of a dull mind. "
> -------------------------------------------------------------
> Phil Jourdan --- [email protected]
>   http://www.ptahhotep.com
>   http://www.chiccantine.com/andypantry.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
2009/3/15 PJ <[email protected]>:
> Daniel Brown wrote:
>> On Sat, Mar 14, 2009 at 19:51, PJ <[email protected]> wrote:
>>
>>> $sql1 = "SELECT b.id, b.title, b.sub_title, b.descr, b.comment,
>>> b.bk_cover, b.copyright, b.ISBN, b.language, b.sellers, c.publisher, <---
>>> CONCAT_WS(' ', first_name, last_name) AS Author
>>> FROM book AS b
>>> LEFT JOIN book_author AS ab ON b.id = ab.bookID
>>> LEFT JOIN author AS a ON ab.authID=a.id
>>> LEFT JOIN book_publisher as abc ON b.id = abc.bookID // <---
>>> LEFT JOIN publishers AS c ON abc.publishers_id = c.id // <---
>>> ORDER BY title ASC ";
>>> $result1 = mysql_query($sql1, $db);
>>> $bookCount = mysql_num_rows($result1);
> The error reported now is to check the syntax near the commented out lines.
> So, what is going on here? I understood that when the lines are
> commented out they are not lprocessed.
> When I deleted the commented out lines the errors went away.
> This does not make sense and obviously could be very misleading in
> debugging.
>

*How* are you commenting out? Mysql accepts /* such comments */, so if
you want to transform a line in your SQL query string into a comment,
you gotta do it that way.
so this is just wrong:
$x = " select *
// from foo
from bar";
and that query would be valid
"SELECT this/*, that*/ from x"

--- End Message ---
--- Begin Message ---
Not to mention if this is written for v 5 then you need to wrap your joins
in ()

-----Original Message-----
From: Jan G.B. [mailto:[email protected]] 
Sent: Sunday, March 15, 2009 9:47 AM
To: PJ
Cc: Daniel Brown; [email protected]
Subject: Re: [PHP] left join does not work, why?

2009/3/15 PJ <[email protected]>:
> Daniel Brown wrote:
>> On Sat, Mar 14, 2009 at 19:51, PJ <[email protected]> wrote:
>>
>>> $sql1 = "SELECT b.id, b.title, b.sub_title, b.descr, b.comment,
>>> b.bk_cover, b.copyright, b.ISBN, b.language, b.sellers, c.publisher,
<---
>>> CONCAT_WS(' ', first_name, last_name) AS Author
>>> FROM book AS b
>>> LEFT JOIN book_author AS ab ON b.id = ab.bookID
>>> LEFT JOIN author AS a ON ab.authID=a.id
>>> LEFT JOIN book_publisher as abc ON b.id = abc.bookID // <---
>>> LEFT JOIN publishers AS c ON abc.publishers_id = c.id // <---
>>> ORDER BY title ASC ";
>>> $result1 = mysql_query($sql1, $db);
>>> $bookCount = mysql_num_rows($result1);
> The error reported now is to check the syntax near the commented out
lines.
> So, what is going on here? I understood that when the lines are
> commented out they are not lprocessed.
> When I deleted the commented out lines the errors went away.
> This does not make sense and obviously could be very misleading in
> debugging.
>

*How* are you commenting out? Mysql accepts /* such comments */, so if
you want to transform a line in your SQL query string into a comment,
you gotta do it that way.
so this is just wrong:
$x = " select *
// from foo
from bar";
and that query would be valid
"SELECT this/*, that*/ from x"

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


__________ Information from ESET Smart Security, version of virus signature
database 3937 (20090314) __________

The message was checked by ESET Smart Security.

http://www.eset.com


 

__________ Information from ESET Smart Security, version of virus signature
database 3937 (20090314) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 


--- End Message ---

Reply via email to