php-general Digest 19 Oct 2008 14:31:01 -0000 Issue 5744

Topics (messages 282091 through 282104):

logic for grabbing what we need from user-input addresses for AVS?
        282091 by: Govinda
        282092 by: Waynn Lue
        282093 by: Robert Cummings
        282096 by: Ashley Sheridan

Re: Form Loop
        282094 by: Sudheer
        282095 by: Ashley Sheridan
        282103 by: Bastien Koert
        282104 by: Shawn McKenzie

Re: paging at which level
        282097 by: Richard Heyes
        282098 by: Ashley Sheridan
        282099 by: Richard Heyes

how to start using a version control system (subversion)?
        282100 by: Rene Veerman
        282102 by: Richard Heyes

Re: Convert video to FLV like youtube
        282101 by: Rene Veerman

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 ---
Hi all

This is not exactly PHP, but an issue that we have to work out in code (whatever we use) - I am working on a shopping cart site which will have orders from any country.

To cut down on fraudulent orders, our cc processor (whatever we call them), to enable "Address Verification System (AVS)", accepts a var/ value which is "The numeric portion of the street address". It is "Required for AVS". Now to get this from what the user input, I can:

- just read the *numeric* characters off the front of the first (of 2) address text inputs, stopping grabbing them once I reach any non- numeric char., or I could - get *any* numeric chars input in that text area and concatenate them all together (if there is more than one continuous run of them), or - get *any* numeric chars input in *either* of the address text areas and concatenate that all together (if there is more than one continuous run of them), or
- (what are the other possibilities?)

I am asking you guys/gals using AVS: what are they looking for? The docs make this clear that they want: "The numeric portion of the street address", but just because I can't think of addresses that don't match a pattern I am thinking of does not mean they don't exist or are not valid. And how should the logic of my algorithm be written if it was just for USA addresses? ... and more importantly - if I am writing it to handle addresses from any country?

Thanks for any insight/logic based on experience,  ;-)

-Govinda

--- End Message ---
--- Begin Message ---
AVS generally only exists for us and canada and parts of the uk, if I
remember correctly. Usually they're just looking for the beginning
part of the street address, not the concatenation or anything else
like that. No need for apartment numbers, for example if you're just
looking at avs.

If you're doing a full credit card auth, though, that's a different matter.

Waynn

On 10/18/08, Govinda <[EMAIL PROTECTED]> wrote:
> Hi all
>
> This is not exactly PHP, but an issue that we have to work out in code
> (whatever we use) -
> I am working on a shopping cart site which will have orders from any
> country.
>
> To cut down on fraudulent orders, our cc processor (whatever we call
> them), to enable "Address Verification System (AVS)",  accepts a var/
> value which is "The numeric portion of the street address".  It is
> "Required for AVS".  Now to get this from what the user input, I can:
>
> - just read the *numeric* characters off the front of the first (of 2)
> address text inputs, stopping grabbing them once I reach any non-
> numeric char., or I could
> - get *any* numeric  chars input in that text area and concatenate
> them all together (if there is more than one continuous run of them), or
> - get *any* numeric  chars input in *either* of the address text areas
> and concatenate that all together (if there is more than one
> continuous run of them), or
> - (what are the other possibilities?)
>
> I am asking you guys/gals using AVS:  what are they looking for?  The
> docs make this clear that they want: "The numeric portion of the
> street address", but just because I can't think of addresses that
> don't match a pattern I am thinking of does not mean they don't exist
> or are not valid.  And how should the logic of my algorithm be written
> if it was just for USA addresses?  ... and more importantly - if I am
> writing it to handle addresses from any country?
>
> Thanks for any insight/logic based on experience,  ;-)
>
> -Govinda
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
Sent from my mobile device

--- End Message ---
--- Begin Message ---
On Sat, 2008-10-18 at 22:56 -0600, Govinda wrote:
> Hi all
> 
> This is not exactly PHP, but an issue that we have to work out in code  
> (whatever we use) -
> I am working on a shopping cart site which will have orders from any  
> country.
> 
> To cut down on fraudulent orders, our cc processor (whatever we call  
> them), to enable "Address Verification System (AVS)",  accepts a var/ 
> value which is "The numeric portion of the street address".  It is  
> "Required for AVS".  Now to get this from what the user input, I can:
> 
> - just read the *numeric* characters off the front of the first (of 2)  
> address text inputs, stopping grabbing them once I reach any non- 
> numeric char., or I could
> - get *any* numeric  chars input in that text area and concatenate  
> them all together (if there is more than one continuous run of them), or
> - get *any* numeric  chars input in *either* of the address text areas  
> and concatenate that all together (if there is more than one  
> continuous run of them), or
> - (what are the other possibilities?)
> 
> I am asking you guys/gals using AVS:  what are they looking for?  The  
> docs make this clear that they want: "The numeric portion of the  
> street address", but just because I can't think of addresses that  
> don't match a pattern I am thinking of does not mean they don't exist  
> or are not valid.  And how should the logic of my algorithm be written  
> if it was just for USA addresses?  ... and more importantly - if I am  
> writing it to handle addresses from any country?
> 
> Thanks for any insight/logic based on experience,  ;-)

AVS systems I've used don't ask for the street number. They ask for the
entire address and they do the matching for me and return a code
indicating what portions matched. For one client in particular an AVS
fail allows the order to go through, but it is flagged as peculiar and
requires someone to manually reject or allow the order to be fulfilled.
This was necessary since a lot of AVS failures were encountered for
regular clients.

If I had to make a choice given your system, I think I would just grab
the integer value of the first address line. No concatenation, and no
fussing with a second line...

    $number = (int)$input;

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


--- End Message ---
--- Begin Message ---
On Sun, 2008-10-19 at 01:10 -0400, Robert Cummings wrote:
> On Sat, 2008-10-18 at 22:56 -0600, Govinda wrote:
> > Hi all
> > 
> > This is not exactly PHP, but an issue that we have to work out in code  
> > (whatever we use) -
> > I am working on a shopping cart site which will have orders from any  
> > country.
> > 
> > To cut down on fraudulent orders, our cc processor (whatever we call  
> > them), to enable "Address Verification System (AVS)",  accepts a var/ 
> > value which is "The numeric portion of the street address".  It is  
> > "Required for AVS".  Now to get this from what the user input, I can:
> > 
> > - just read the *numeric* characters off the front of the first (of 2)  
> > address text inputs, stopping grabbing them once I reach any non- 
> > numeric char., or I could
> > - get *any* numeric  chars input in that text area and concatenate  
> > them all together (if there is more than one continuous run of them), or
> > - get *any* numeric  chars input in *either* of the address text areas  
> > and concatenate that all together (if there is more than one  
> > continuous run of them), or
> > - (what are the other possibilities?)
> > 
> > I am asking you guys/gals using AVS:  what are they looking for?  The  
> > docs make this clear that they want: "The numeric portion of the  
> > street address", but just because I can't think of addresses that  
> > don't match a pattern I am thinking of does not mean they don't exist  
> > or are not valid.  And how should the logic of my algorithm be written  
> > if it was just for USA addresses?  ... and more importantly - if I am  
> > writing it to handle addresses from any country?
> > 
> > Thanks for any insight/logic based on experience,  ;-)
> 
> AVS systems I've used don't ask for the street number. They ask for the
> entire address and they do the matching for me and return a code
> indicating what portions matched. For one client in particular an AVS
> fail allows the order to go through, but it is flagged as peculiar and
> requires someone to manually reject or allow the order to be fulfilled.
> This was necessary since a lot of AVS failures were encountered for
> regular clients.
> 
> If I had to make a choice given your system, I think I would just grab
> the integer value of the first address line. No concatenation, and no
> fussing with a second line...
> 
>     $number = (int)$input;
> 
> Cheers,
> Rob.
> -- 
> http://www.interjinn.com
> Application and Templating Framework for PHP
> 
> 
It does sound like a bit of a flawed system you are using though, I
mean, some addresses have only house names, not numbers, so there would
be no number, and what about business addresses in business centres?
"Unit 3 of Suchandsuch Business Centre, 20-30 Somesuch Road..." How
would you go about getting the numerical part from that?


Ash
www.ashleysheridan.co.uk


--- End Message ---
--- Begin Message ---

I'm trying to create a form with a loop. I need to append a value to a field name each time through the loop. For Instance:

while ($row = mysql_fetch_assoc($result)) {
    $x=1;
echo "<tr>"; echo "<td><input type='text' id='qty' name='quantity_' size='2' value='$row[qty]' /></td>";
?>
<td><input type="text" id="qty[<?php echo $x; ?>]" name="quantity[<?php echo $x; ?>]" size="2" value="$row[qty]"/></td>
<?php

    echo "</tr>";
    $x++;
}

the name value quantity needs the value of x appended to it. quantity_1, quantity_2 etc.
I recommend using array notation instead of appending $x to the element name. If you are using POST, when the form is submitted the values are available in the $_POST['quantity'] array. You can use foreach to iterate through it.

Example:
<?php
$values = $_POST['quantity'];
foreach ($values as $value) {
   echo $value;
}
?>


Regards,

--

With warm regards,
Sudheer. S
Business: http://binaryvibes.co.in, Community: http://lampcomputing.com, 
Personal: http://sudheer.net


--- End Message ---
--- Begin Message ---
On Sun, 2008-10-19 at 14:10 +0530, Sudheer wrote:
> > I'm trying to create a form with a loop. I need to append a value to a 
> > field name each time through the loop. For Instance:
> >
> > while ($row = mysql_fetch_assoc($result)) {
> >     $x=1;
> >     echo "<tr>";    echo "<td><input type='text' id='qty' 
> > name='quantity_'  size='2' value='$row[qty]' /></td>";
> ?>
> <td><input type="text" id="qty[<?php echo $x; ?>]" name="quantity[<?php 
> echo $x; ?>]"  size="2" value="$row[qty]"/></td>
> <?php
> 
> >     echo "</tr>";
> >     $x++;
> > }
> >
> > the name value quantity needs the value of x appended to it. 
> > quantity_1, quantity_2 etc.
> I recommend using array notation instead of appending $x to the element 
> name. If you are using POST, when the form is submitted the values are 
> available in the $_POST['quantity'] array. You can use foreach to 
> iterate through it.
> 
> Example:
> <?php
> $values = $_POST['quantity'];
> foreach ($values as $value) {
>     echo $value;
> }
> ?>
> 
> 
> Regards,
> 
> -- 
> 
> With warm regards,
> Sudheer. S
> Business: http://binaryvibes.co.in, Community: http://lampcomputing.com, 
> Personal: http://sudheer.net
> 
> 
There is no real need to use IDs for form elements unless you are
attaching labels to them. If you're using JavaScript to check for
certain values, then you can iterate the elements of the form in array
notation also. One more thing, you don't need to put explicit values
into form elements that use array notation, it's enough to put 

<input type="text" name="quantity[]" size="2" value="{$row['qty']}"/>

Note the curly braces, you must use these if the HTML is being output by
PHP, or it will not know that the variable you are trying to use is an
array element.


Ash
www.ashleysheridan.co.uk


--- End Message ---
--- Begin Message ---
>
>>
>> the name value quantity needs the value of x appended to it. quantity_1,
>> quantity_2 etc.
>>
> I recommend using array notation instead of appending $x to the element
> name. If you are using POST, when the form is submitted the values are
> available in the $_POST['quantity'] array. You can use foreach to iterate
> through it.
>
> Example:
> <?php
> $values = $_POST['quantity'];
> foreach ($values as $value) {
>   echo $value;
> }
> ?>
>
>
> Regards,
>
> --
>
> With warm regards,
> Sudheer. S
> Business: http://binaryvibes.co.in, Community: http://lampcomputing.com,
> Personal: http://sudheer.net


Arrays are definitely the way to go, not only is it easier to process,
adding new rows on the form can be done with simple javascript then if
needed
-- 

Bastien

Cat, the other other white meat

--- End Message ---
--- Begin Message ---
Rick Pasotto wrote:
> On Sat, Oct 18, 2008 at 08:07:26PM -0500, Shawn McKenzie wrote:
>> Terry J Daichendt wrote:
>>> I'm trying to create a form with a loop. I need to append a value to a
>>> field name each time through the loop. For Instance:
>>>
>>> while ($row = mysql_fetch_assoc($result)) {
>>>     $x=1;
>>>     echo "<tr>";    echo "<td><input type='text' id='qty'
>>> name='quantity_'  size='2' value='$row[qty]' /></td>";
>>>     echo "</tr>";
>>>     $x++;
>>> }
>>>
>>> the name value quantity needs the value of x appended to it. quantity_1,
>>> quantity_2 etc. What is the correct syntax to achieve this, especially
>>> the parsing to get it to work. I suspect the dot operator to append it
>>> but I can't get the parsing down.
>>>
>>> Terry Daichendt
>> echo '<td><input type="text" id="qty" name="quantity_' . $x . '"
>> size="2" value="' . $row['qty']. '" /></td>';
>>
>> However, I would use an array:
>>
>> echo '<td><input type="text" id="qty" name="quantity[' . $x . ']"
>> size="2" value="' . $row['qty']. '" /></td>';
>>
>> Depending upon your use, you can even leave out the index and let it
>> increment.
>>
>> echo '<td><input type="text" id="qty" name="quantity[]" size="2"
>> value="' . $row['qty']. '" /></td>';
> 
> Ids must be unique within a document.
> 
Yeah, I just copied and pasted and was concentrating on the name.

echo '<td><input type="text" id="qty' . $x . '" name="quantity[]"
size="2" value="' . $row['qty']. '" /></td>';

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

--- End Message ---
--- Begin Message ---
> I've not used a library to achieve paging

NIH syndrome? ;-)

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org

--- End Message ---
--- Begin Message ---
On Sun, 2008-10-19 at 10:23 +0100, Richard Heyes wrote:
> > I've not used a library to achieve paging
> 
> NIH syndrome? ;-)
> 
I'm still a little wet behind the ears, nih?!


Ash
www.ashleysheridan.co.uk


--- End Message ---
--- Begin Message ---
> I'm still a little wet behind the ears, nih?!

"Not Invented Here"

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org

--- End Message ---
--- Begin Message ---
Apologies for posting a monthly/yearly recurring theme here..
If someone can add links to previous discussions relating to the same, that could help too.

I'd like to use subversion on a home unix server of mine to keep track of my projects. I dont even know what i need for a good intergration of subversion when i run my software on shared hosted unix and develop on windows. I've got windows shellintergration (a virtual drive) for all my remote storage, and atm use aptana studio as my editor.
My home unix server is accessible (http & ftp atm) from the outside world..

My question is how to intergrate a subversion repository so that i can easilly checkout files on my windows development box (pref even from the editor; must support syntax highlighting too), and then update my sourcetree on the shared hosting (or another temp test server).

If possible, i'd like to avoid using subversion commandline instructions and use a web-interface. Ofcourse, i can do some things with subversion cmdline instr and put that in a php file.

I want to avoid as much (typing) overhead as possible for each operation i need to do. And i'd also like to know what visual interface to subversion most easilly manages the repository, creating/deleting branches from the main development line, etc.

Please reply-to-all.


Background: my motivation for using a version control system in the first place;

The software i develop (http://mediabeez.ws) runs on multiple servers, mostly unix. On each of these servers, i use symlinks to point from sites .../www/site-name.com/mediaBeez to a common .../mediaBeez-1.x directory that contains the code.. The code itself uses the http hostname to determine which config-file (containing db and theme settings) to use. Up until now i havent used any version-control besides properly naming code directories and copying them with windows explorer after each significant change.

This has worked fine up until recently.
My software runs on shared hosting and not everything (like video conversions to flash video) can be done there on that shared server. So now my software runs on 2 servers at the same time, calling functions in the same php library file (lib_import.php). I had to keep both files open in my editor, and after each saveable change manually copy them to the other copy of the same file.
That's no problem if its just 1 file, but i had 6 of them.
Needless to say, it takes too much concentration if there are more files involved. Up to 5 files on 2 servers simultaniously is doable, but more than that is a real attention-drain and nuisance.

My main development box runs windows vista.



--- End Message ---
--- Begin Message ---
> ...

The subversion manual is the best place to learn about it. Section 2
tells you about setting up a repository.

http://svnbook.red-bean.com/

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org

--- End Message ---
--- Begin Message ---
I use ffmpeg (unix commandline) to do the video converting..
ffmpeg needs to be properly re-compiled with mp3 support (for audio in the flv files); theres tutorials on google on how to do that.

Are you on shared hosting? Most wont allow any kind of video conversion on shared hosting.

I had to recruit my unix homeserver to do the video-converting for me.
Took quite some code to get it to run correctly spread between the shared hosting main server and the video-conversion server...
I'm willing to sell that piece of code at a reasonable price ;)

Ryan S wrote:
Hey!

Been googleing for a way to convert video to flv just like youtube and came 
accross the flv SDK kit, unfortunately it seems to only support C++, Delphi and 
C#

Have any of you guys come accross a php script that does this? any links, pointers and code would be appreciated.

TIA,
R

------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com


--- End Message ---

Reply via email to