homepage Welcome to WebmasterWorld Guest from 54.196.167.69
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderators: physics

Databases Forum

    
Added phone number field to web form
having trouble getting it to write into DB
textex




msg:4434962
 8:02 pm on Mar 29, 2012 (gmt 0)

I successfully added phone_number to my web form.

Then included this on the index.cgi
$sql{phone_number } = $in{phone_number} || $in{phone_number } || '';

However, I can't get the phone number to write into the database correctly. I have minimal programming skills and tried a variety of different things (see below).

for ($sql{phone_number}) {
s/[^\d.-]//g; # only digits and dots and dashes
}

The above yields the same number no matter what is input. Any input? Thanks...

 

rocknbil




msg:4435314
 4:43 pm on Mar 30, 2012 (gmt 0)

This is likely more of a Perl problem than database - we'll need to see two bits of code:

- how the form input "gets" to the variables
- the insert statement and how it works

Please don't post the whole script, just the bits you see as relevant.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved