User Profile

Collapse

Profile Sidebar

Collapse
alibaba1
alibaba1
Last Activity: Feb 23 '12, 05:41 AM
Joined: Oct 24 '11
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • alibaba1
    started a topic mssql post state to email
    in PHP

    mssql post state to email

    Hey Everyone hope all ok. I am needing your expertise.

    I have an html form and inside of it i have a drop down option to choose a state

    Code:
    <select name="State">
        <option value="0" selected="selected">Select a State</option>
        <option value="AL">Alabama</option>
        <option value="AK">Alaska</option>
    ...
    See more | Go to post

  • alibaba1
    started a topic connect form to mssql database
    in PHP

    connect form to mssql database

    Hey Everyone hope all ok. I am needing your expertise.

    I have an html form and inside of it i have a drop down option to choose a state

    Code:
    <select name="State">
        <option value="0" selected="selected">Select a State</option>
        <option value="AL">Alabama</option>
        <option value="AK">Alaska</option>
    ...
    See more | Go to post

  • alibaba1
    started a topic Change php mysql to php mssql

    Change php mysql to php mssql

    Hey Everyone hope all well. I have this code that works perfectly on a mysql database

    Code:
    <?php
    // visit http://php.net/pdo for more details
    // start error handling
    
    try 
    {
      // connect
      $pdo = new PDO('mysql:host=localhost;dbname=name', 'name', 'password');
      // enable error handling through exceptions
      $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    ...
    See more | Go to post

  • alibaba1
    replied to send data from sql to email
    in PHP
    Hey Dormilich Thanks for all your help you have been fantastic. Happy to say finally got the ip address coming in the email. This was the final code

    Code:
    <?php
    // visit http://php.net/pdo for more details
    // start error handling
    
    try 
    {
      // connect
      $pdo = new PDO('mysql:host=localhost;dbname=name', 'user', 'pass');
      // enable error handling through exceptions
      $pdo->setAttribute(PDO::ATTR_ERRMODE,
    ...
    See more | Go to post

    Leave a comment:


  • alibaba1
    replied to send data from sql to email
    in PHP
    This is how my php code looks

    Code:
    <?php
    // visit http://php.net/pdo for more details
    // start error handling
    
    try 
    {
      // connect
      $pdo = new PDO('mysql:host=localhost;dbname=name', 'user', 'pass');
      // enable error handling through exceptions
      $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
      // create safe query
      $query = $pdo->prepare("SELECT
    ...
    See more | Go to post

    Leave a comment:


  • alibaba1
    replied to send data from sql to email
    in PHP
    yeah there is no errors at all. I just do not receive the email. Could i mix the php code you sent me with something like this

    Code:
    <?php
    if(isset($_POST['email'])) {
         
        // EDIT THE 2 LINES BELOW AS REQUIRED
        $email_to = "1stoptutorials@gmail.com";
        $email_subject = "This is a test";
         
         
        function died($error) {
            // your error
    ...
    See more | Go to post

    Leave a comment:


  • alibaba1
    replied to send data from sql to email
    in PHP
    did you test whether mail() returned true?
    No i did not, not sure exactly what this

    did you include the From: header?
    Is that this bit of code
    Code:
     mail("email@gmail.com", "database error", $e->getMessage(), "From: email@gmail.com");
    did you check the spam folder?
    Yes it is not in there

    Thanks

    Ali
    See more | Go to post

    Leave a comment:


  • alibaba1
    replied to send data from sql to email
    in PHP
    Hi Dormilich. I have been testing this on two different hosting accounts.
    Hostgator and godaddy.

    On godaddy when i had hostname set to localhost it brought up this error in my email

    Code:
    SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    So i changed localhost to godaddy given hostname. When i test the form again no errors are given and everything submits,...
    See more | Go to post

    Leave a comment:


  • alibaba1
    replied to send data from sql to email
    in PHP
    i am not sure if this could be the issue but for the ip table in my phpmyadmin i have the type to be decimal(20,0. I was not sure what it should be set to either decimal,varchar , text etc.. could this be the issue and also is this right

    Thanks

    ALi
    See more | Go to post

    Leave a comment:


  • alibaba1
    replied to send data from sql to email
    in PHP
    Sorry Dormilich, i am probably being a muppit here but this is what i am try to do. I took your code and added it to a php file. Then i change the info inside to direct to my databse, i also changed this bit of code as well:

    Code:
    $query = $pdo->prepare("SELECT ip FROM vincer WHERE state = ? ORDER BY rand() LIMIT 1");
    I added my table called vincer.

    I then created a basic html form with my state dropdown...
    See more | Go to post

    Leave a comment:


  • alibaba1
    replied to send data from sql to email
    in PHP
    Thanks for that.Do i need to add some php to the html state part at all

    Code:
    <select name="State">
    <option value="0" selected="selected">Select a State</option>
    <option value="AL">Alabama</option>
    <option value="AK">Alaska</option>
    <option value="AZ">Arizona</option>
    <option value="AR">Arkansas</option>
    ...
    See more | Go to post

    Leave a comment:


  • alibaba1
    replied to send data from sql to email
    in PHP
    Thanks for that, you have been a great help. Do i not need to add username and password anywhere? Thanks for everything

    Ali
    See more | Go to post

    Leave a comment:


  • alibaba1
    replied to send data from sql to email
    in PHP
    Hey Dormilich thanks for your reply and sorry in the delay. I had a look into query DB and i found this that might help me

    Code:
    <select name="State">
    <option value="0" selected="selected">Select a State</option>
    <option value="AL">Alabama</option>
    <option value="AK">Alaska</option>
    <option value="AZ">Arizona</option>
    ...
    See more | Go to post

    Leave a comment:


  • alibaba1
    started a topic send data from sql to email
    in PHP

    send data from sql to email

    Hi everyone hope all well. I am needing your valuable expertise in a problem i am having. I will try to explain below.

    I have a form and inside of that form i have a "select a state" option:

    Code:
    <select name="State">
    <option value="0" selected="selected">Select a State</option>
    <option value="AL">Alabama</option>
    <option
    ...
    See more | Go to post
No activity results to display
Show More
Working...