***UPDATED*** DB Technosystems Form Processor 02/09/2011

In this section you can share self-made extensions with other users of WYSIWYG Web Builder.
There is a dedicated section for commercial extensions.
User avatar
Patrik iden
 
 
Posts: 513
Joined: Wed Mar 24, 2010 9:07 pm
Location: Sweden

Re: ***UPDATED*** DB Technosystems Form Processor 02/09/2011

Post by Patrik iden » Tue Oct 25, 2011 11:11 am

Yes that works for the mails, but now i am translating the hole thing. Thats wy i wonderd about the prev question?

User avatar
Navaldesign
 
 
Posts: 903
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Re: ***UPDATED*** DB Technosystems Form Processor 02/09/2011

Post by Navaldesign » Tue Oct 25, 2011 12:00 pm

I repeat: The fields in the database MUST remain as they are (username and password) otherwise the other tools will NOT work.

You ONLY need to change the labels (text) in the forms (which you can do right from inside WWB) and the labels (text) in the mail. Do NOT change anything else.
www.dbtechnosystems.com

User avatar
Patrik iden
 
 
Posts: 513
Joined: Wed Mar 24, 2010 9:07 pm
Location: Sweden

Re: ***UPDATED*** DB Technosystems Form Processor 02/09/2011

Post by Patrik iden » Tue Oct 25, 2011 12:18 pm

I dont think you understand me. I Whant this hole thing in Swedish, so that all the mails and the database entrys is in swedish. I will translate all the tools.
If i can! :roll:
I just tried the translated signin form, but now i just get the message "User database not found" but the db entrys are correct setup. :oops:

User avatar
Navaldesign
 
 
Posts: 903
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Re: ***UPDATED*** DB Technosystems Form Processor 02/09/2011

Post by Navaldesign » Tue Oct 25, 2011 1:08 pm

Please understand that if you want to modify the full set of Login tools, you MUST have PHP (and probably MySQL, if you are using it) experience.
There is no way someone can guide you through the whole process, you will have to change this yourself.
www.dbtechnosystems.com

User avatar
Patrik iden
 
 
Posts: 513
Joined: Wed Mar 24, 2010 9:07 pm
Location: Sweden

Re: ***UPDATED*** DB Technosystems Form Processor 02/09/2011

Post by Patrik iden » Tue Oct 25, 2011 1:25 pm

I understand. Just one question, will it work if i put in åäö in the code?


Just if you want to and if you have the time could you take a quick look at this translated code, if you see anything wrong with it? :oops: the password for db is not in this code!

Code: Select all

<?php
$error_message = "";
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
   $action = isset($_POST['action']) ? $_POST['action'] : '';
   $mysql_server = 'mysql315.loopia.se';
   $mysql_username = 'pers@f47255';
   $mysql_password = '';
   $mysql_database = 'fcab_se_db_4';
   $mysql_table = 'USERS';

   $success_page = './anslut.php';

   if ($action == 'signup')
   {
      $newanvändarnamn = $_POST['användarnamn'];
      $newlösenord = $_POST['lösenord'];
      $newepost = $_POST['epost'];
      $bekräftalösenord = $_POST['bekräftalösenord'];
      $newnamn = $_POST['namn'];
      $telefon = $_POST['telefon'];
      $mobil = $_POST['mobil'];
      $företag = $_POST['företag'];
      $orgnr = $_POST['orgnr'];
      $kategori = $_POST['kategori'];
      $meddelande = $_POST['meddelande'];
      if ($newlösenord != $bekräftalösenord)
      {
         $error_message = 'Lösenord och bekräfta lösenord är ej lika!';
      }
      else
      if (!ereg("^[A-Za-z0-9_!@$]{1,50}$", $newanvändarnamn))
      {
         $error_message = 'Ogiltigt användarnamn, försök igen!';
      }
      else
      if (!ereg("^[A-Za-z0-9_!@$]{1,50}$", $newlösenord))
      {
         $error_message = 'Ogiltigt lösenord, försök igen!';
      }
      else
      if (!ereg("^[A-Za-z0-9_!@$.' &]{1,50}$", $newnamn))
      {
         $error_message = 'Ogiltigt namn, försök igen!';
      }
      else
      if (!ereg("^.+@.+\..+$", $newepost))
      {
         $error_message = 'Ogiltig epost adress, försök igen!';
      }
      if (empty($error_message))
      {
         $db = mysql_connect($mysql_server, $mysql_username, $mysql_password);
         mysql_select_db($mysql_database, $db);
         $sql = "SELECT användarnamn FROM ".$mysql_table." WHERE användarnamn = '".$newanvändarnamn."'";
         $result = mysql_query($sql, $db);
         if ($data = mysql_fetch_array($result))
         {
            $error_message = 'Användarnamn upptaget, välj ett annat.';
         }
      }
      if (empty($error_message))
      {
         $crypt_pass = md5($newlösenord);
         $sql = "INSERT `".$mysql_table."` (`användarnamn`, `lösenord`, `namn`, `epost`, `active`, `telefon`, `mobil`, `företag`, `orgnr`, `kategori`, `meddelande`) VALUES ('$newanvändarnamn', '$crypt_pass', '$newnamn', '$newepost', 1, '$telefon', '$mobil', '$företag', 'orgnr', '$kategori', '$meddelande')";
         $result = mysql_query($sql, $db);
         mysql_close($db);
         $mailto = $newepost;
         $subject = 'Nytt konto hos Jobler.se';
         $message = 'Nytt konto hos Jobler.se.';
         $message .= "\r\nAnvändarnamn: ";
         $message .= $newanvändarnamn;
         $message .= "\r\nLösenord: ";
         $message .= $newlösenord;
         $message .= "\r\n";
         $header  = "From: noreply@jobler.se"."\r\n";
         $header .= "Reply-To: noreply@jobler.se"."\r\n";
         $header .= "MIME-Version: 1.0"."\r\n";
         $header .= "Content-Type: text/plain; charset=utf-8"."\r\n";
         $header .= "Content-Transfer-Encoding: 8bit"."\r\n";
         $header .= "X-Mailer: PHP v".phpversion();
         mail($mailto, $subject, $message, $header);
         header('Location: '.$success_page);
         exit;
      }
   }
}
?>
Last edited by Patrik iden on Tue Oct 25, 2011 1:35 pm, edited 2 times in total.

User avatar
Navaldesign
 
 
Posts: 903
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Re: ***UPDATED*** DB Technosystems Form Processor 02/09/2011

Post by Navaldesign » Tue Oct 25, 2011 1:34 pm

Probably not but not sure as I have NEVER seen ANY php software using such characters.

But again, I repeat: you are doing something absolutely useles, database field naming has NOTHING to do with what the user will ever see. Please try to understand that what the user sees on screen or in the mails, can be set APART from the actual field naming in the database. You are only complicating your life.
www.dbtechnosystems.com

User avatar
Patrik iden
 
 
Posts: 513
Joined: Wed Mar 24, 2010 9:07 pm
Location: Sweden

Re: ***UPDATED*** DB Technosystems Form Processor 02/09/2011

Post by Patrik iden » Tue Oct 25, 2011 5:09 pm

Can i use the Code we talked about in the password recovery tool, or is this specificly for signup tool?

User avatar
Navaldesign
 
 
Posts: 903
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Re: ***UPDATED*** DB Technosystems Form Processor 02/09/2011

Post by Navaldesign » Tue Oct 25, 2011 5:17 pm

No, you can't. The DBTS Form Processor can only store data in the database, it can not retrieve or reset data. This is also the reason why I didn't answer you back with a price, because it is useless for the other tools.
www.dbtechnosystems.com

User avatar
Patrik iden
 
 
Posts: 513
Joined: Wed Mar 24, 2010 9:07 pm
Location: Sweden

Re: ***UPDATED*** DB Technosystems Form Processor 02/09/2011

Post by Patrik iden » Tue Oct 25, 2011 5:22 pm

OK, Thank you so much for all your answers. I'm realy greatfull! :D

User avatar
Navaldesign
 
 
Posts: 903
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Re: ***UPDATED*** DB Technosystems Form Processor 02/09/2011

Post by Navaldesign » Sun Nov 13, 2011 6:45 am

v.3 will work with WWB7 and of course with WWB8 (it is already being tested with WWB8)
www.dbtechnosystems.com

User avatar
Navaldesign
 
 
Posts: 903
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Re: ***UPDATED*** DB Technosystems Form Processor 02/09/2011

Post by Navaldesign » Sun Nov 13, 2011 6:51 pm

When it is 100% ready.....
www.dbtechnosystems.com

User avatar
Patrik iden
 
 
Posts: 513
Joined: Wed Mar 24, 2010 9:07 pm
Location: Sweden

Re: ***UPDATED*** DB Technosystems Form Processor 02/09/2011

Post by Patrik iden » Tue Nov 15, 2011 1:13 am

Hi I'm posting this hear, dont know ware else to post. But i wonder if you could help me whit somthing.
I Have a page that gets info from mysql, and beside that info i have inserted a mailform using the mail code from WWB mailform.
My problem is that i want to get the mailto emailaddress from the database. My Code looks like this now, but it's not working.
So if you want and have the time could you pleas have a look at it? I will gladely pay to get this to work! And this is the site address:
http://jobler.se/senaste6.php

Code: Select all

<?php
$databasename='****'; // Name of the database
$tablename='jobadd'; // Name of the table
$mysqladd='*****'; // Address to the MySQL Server - Usually localhost but could be an IP address
$mysqluser='*****'; // Your MySQL UserName
$mysqlpass='*****'; // Your MySQL Password


//CONNECT TO MYSQL
$link=mysql_connect($mysqladd, $mysqluser, $mysqlpass) or die('Could not connect to database: ' . mysql_error());

//CONNECT TO DATABASE
mysql_select_db($databasename, $link) or die('Could not connect to table: ' . mysql_error());

$Epost = $_POST['Epost'];

$query="SELECT Epost FROM jobadd WHERE Epost = '$Epost'"; 
 
$result=mysql_query($query); 
 
$row = mysql_fetch_array($result, MYSQL_ASSOC);

 
session_start();

if ($_SERVER['REQUEST_METHOD'] == 'POST') { 
  if (isset($_POST['captcha_code'],$_SESSION['random_txt']) && md5($_POST['captcha_code']) == $_SESSION['random_txt']) { 
    unset($_POST['captcha_code'],$_SESSION['random_txt']); 
  } 
  else { if ($errorpage == 'false') {
    echo '<b>Fel kod!</b><br>'; 
    echo '<a href="javascript:history.back()">Försök igen!</a>'; 
    exit; 
  } if ($errorpage == 'true')  { 
    header('Location: ././error.php'); 
  exit; 
  } 
}
}  
?>
<?php

   function ValidateEmail($email)
   {
      $pattern = '/^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i';
      return preg_match($pattern, $email);
   }

   if($_SERVER['REQUEST_METHOD'] == 'POST')
   {
      $mailto = $Epost;
      $mailfrom = isset($_POST['email']) ? $_POST['email'] : $mailto;
      $subject = 'Svar på Tjänstförfrågan från Jobler.se';
      $message = 'Hej, Vi vill gärna lämna en facktura på denna Tjänstförfrågan';
      $success_url = './tack.php';
      $error_url = './error.php';
      $error = '';
      $eol = "\n";
      $max_filesize = isset($_POST['filesize']) ? $_POST['filesize'] * 1024 : 1024000;
      $boundary = md5(uniqid(time()));

      $header  = 'From: '.$mailfrom.$eol;
      $header .= 'Reply-To: '.$mailfrom.$eol;
      $header .= 'MIME-Version: 1.0'.$eol;
      $header .= 'Content-Type: multipart/mixed; boundary="'.$boundary.'"'.$eol;
      $header .= 'X-Mailer: PHP v'.phpversion().$eol;
      if (!ValidateEmail($mailfrom))
      {
         $error .= "The specified email address is invalid!\n<br>";
      }

      if (!empty($error))
      {
         $errorcode = file_get_contents($error_url);
         $replace = "##error##";
         $errorcode = str_replace($replace, $error, $errorcode);
         echo $errorcode;
         exit;
      }

      $internalfields = array ("submit", "reset", "send", "captcha_code");
      $message .= $eol;
      $message .= $_SERVER['REMOTE_ADDR'];
      $message .= $eol;
      foreach ($_POST as $key => $value)
      {
         if (!in_array(strtolower($key), $internalfields))
         {
            if (!is_array($value))
            {
               $message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol;
            }
            else
            {
               $message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol;
            }
         }
      }

      $body  = 'This is a multi-part message in MIME format.'.$eol.$eol;
      $body .= '--'.$boundary.$eol;
      $body .= 'Content-Type: text/plain; charset=ISO-8859-1'.$eol;
      $body .= 'Content-Transfer-Encoding: 8bit'.$eol;
      $body .= $eol.stripslashes($message).$eol;
      if (!empty($_FILES))
      {
          foreach ($_FILES as $key => $value)
          {
             if ($_FILES[$key]['error'] == 0 && $_FILES[$key]['size'] <= $max_filesize)
             {
                $body .= '--'.$boundary.$eol;
                $body .= 'Content-Type: '.$_FILES[$key]['type'].'; name='.$_FILES[$key]['name'].$eol;
                $body .= 'Content-Transfer-Encoding: base64'.$eol;
                $body .= 'Content-Disposition: attachment; filename='.$_FILES[$key]['name'].$eol;
                $body .= $eol.chunk_split(base64_encode(file_get_contents($_FILES[$key]['tmp_name']))).$eol;
             }
         }
      }
      $body .= '--'.$boundary.'--'.$eol;
      mail($mailto, $subject, $body, $header);
      header('Location: '.$success_url);
      mysql_close();
      exit;
   }

?>
This also regards to the subject.

Thank you.

/Patrik

User avatar
Navaldesign
 
 
Posts: 903
Joined: Sat Mar 01, 2008 8:08 pm
Location: Italy
Contact:

Re: ***UPDATED*** DB Technosystems Form Processor 02/09/2011

Post by Navaldesign » Tue Nov 15, 2011 5:55 am

First, this has nothing to do with this thread, and posting it here makes it harder for other users to find answers regarding the DBTS Form Processor.

You should be starting a new thread.

Now, regarding your code, it is rather meaningless.

I mean, you are trying to retrieve an email address (Epost) from the database, but then you do nothing with it! so what's the purpose ?

Then, you do his retrieval in ALL cases, even when the method is not POST. In that case, the WHERE clause is invalid as no value exists for Epost.

But even when the method is POST , you are trying to retrieve the record from the database but you then don't extract it from the $row you retrieved, neither are you using it anywhere .

Can you explain what's the purpose of this so I can help you ? and please start a new thread.
www.dbtechnosystems.com

User avatar
Patrik iden
 
 
Posts: 513
Joined: Wed Mar 24, 2010 9:07 pm
Location: Sweden

Re: ***UPDATED*** DB Technosystems Form Processor 02/09/2011

Post by Patrik iden » Tue Nov 15, 2011 12:48 pm

Thanks for your reply. New Thread: viewtopic.php?f=21&t=42999&p=214462#p214462

User avatar
kevinp
 
 
Posts: 93
Joined: Wed Feb 21, 2007 2:51 pm
Location: Preston, Lancashire, England
Contact:

Re: ***UPDATED*** DB Technosystems Form Processor 02/09/2011

Post by kevinp » Sat Nov 19, 2011 9:57 am

Hi Naval

Personally I think the work you do to extend the capabilities of WB is verging on a miracle. Your extensions are brilliant and I think I can confidently say that everyone in the forum appreciates the work you do in your free time without payment and understand that your paid work has to come first. If people need something extra and need it fast then, as I have done in the past, they can contact you and pay for it (at very reasonable rates I must add). Keep up the excellent work Naval but not at the expense of your health.

Cheers

Kevinp

Post Reply