Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   PHP (https://www.askmehelpdesk.com/forumdisplay.php?f=454)
-   -   Capture and streaming webcam images. (https://www.askmehelpdesk.com/showthread.php?t=170955)

  • Jan 10, 2008, 12:04 PM
    atlanty
    Capture and streaming webcam images.
    Hi ! it is possible the capture and streaming webcam images in a webpage with PHP ?
    I have this source code below in my server however I want to change it to hold images from webcam and save them in MySQL database.

    <form action="addcam.php" method="post">
    Name<b>*</b>: <input type="text" name="requiredname"><br>
    Homepage: <input type="text" name="homepage"><i> (be sure to include http://)</i><br>
    Email address: <input type="text" name="email"><br>
    URL of cam image<b>*</b>: <input type="text" name="requiredimage"> <i> (be sure to include http://)</i><BR>
    <input type="Submit">
    </form>

    <?php

    // create connection
    $conn = mysql_connect($hostname, $username, $password);
    if (!$conn) {
    die ("Couldn't connect to server : " . mysql_error());
    }

    // select database
    $db = mysql_select_db($database, $conn);
    if (!$db) {
    die ("Couldn't select $database : " . mysql_error());
    }

    $name=$_POST['requiredname'];
    $homepage=$_POST['homepage'];
    $email=$_POST['email'];
    $image=$_POST['requiredimage'];

    $sql = "INSERT INTO cams (cam_name, homepage, email, cam_url)
    VALUES ('$name', '$homepage', '$email', '$image')";
    mysql_query($sql);

    mysql_close();

    echo "<p><a href='$domain/index.php'>To the portal!</a></p>";
    ?>
    Thanks for the answers !

  • All times are GMT -7. The time now is 09:13 AM.