Jump to content

ryanfilard

Members
  • Posts

    252
  • Joined

  • Last visited

Posts posted by ryanfilard

  1. I need to put php inside php.

    $insertGoTo = "index.php? "$sbninesven" ";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      }

     

    What do I do to get that inside of

    $insertGoTo = "index.php? "$sbninesven" ";

  2. I am making a login system and I have done it before. ryanweekly.com is the site I am trying to put it on. Here is the script to the home page.

    Here is the code I am having a problem with:

    <?php
    if (empty($username))
    include ("loginbar.php");
    if (!empty($username))
    include ("logged.php");
    ?>

    <?PHP
    $username = $_SESSION['MM_Username'];
    ?>
    <?php require_once('Connections/ryanweeklyusers.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      }
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    ?>
    <?php
    // *** Validate request to login to this site.
    if (!isset($_SESSION)) {
      session_start();
    }
    
    $loginFormAction = $_SERVER['PHP_SELF'];
    if (isset($_GET['accesscheck'])) {
      $_SESSION['PrevUrl'] = $_GET['accesscheck'];
    }
    
    if (isset($_POST['username'])) {
      $loginUsername=$_POST['username'];
      $password=$_POST['password'];
      $MM_fldUserAuthorization = "";
      $MM_redirectLoginSuccess = "index.php";
      $MM_redirectLoginFailed = "index.php?reg=loger";
      $MM_redirecttoReferrer = false;
      mysql_select_db($database_ryanweeklyusers, $ryanweeklyusers);
      
      $LoginRS__query=sprintf("SELECT username, password FROM users WHERE username=%s AND password=%s",
        GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); 
       
      $LoginRS = mysql_query($LoginRS__query, $ryanweeklyusers) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
         $loginStrGroup = "";
        
    if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}
        //declare two session variables and assign them
        $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['MM_UserGroup'] = $loginStrGroup;	      
    
        if (isset($_SESSION['PrevUrl']) && false) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];	
        }
        header("Location: " . $MM_redirectLoginSuccess );
      }
      else {
        header("Location: ". $MM_redirectLoginFailed );
      }
    }
    
    $ruser = $_REQUEST['Y2User-53201'];
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Ryan Weekly</title>
    <style type="text/css">
    body {
    background-color: #E3E5E2;
    }
    </style>
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
    </head>
    <style type="text/css">
    <!--
    body {
    font-size:12px;
    font-family:Verdana, Arial, Helvetica, sans-serif;
    }
    div#wrapper {
    width: 80%;
    background-color:#FFFFFF;
    margin-top: 50px;
    margin-bottom: 50px;
    margin-left: auto;
    margin-right: auto;
    padding: 0px;
    border: thin solid #000000;
    }
    div#header {
    padding: 15px;
    margin: 0px;
    text-align: center;
    }
    div#nav {
    width: 25%;
    padding: 10px;
    margin-top: 1px;
    float: left;
    border: thin solid #000000;
    
    }
    div#main {
    margin-left: 30%;
    margin-top: 1px;
    padding: 10px;
    border: thin solid #000000;
    }
    div#underhead {
    padding: 15px;
    margin: 0px;
    border-top: thin solid #000000;
    }
    
    {
    ul.nav a:hover, ul.nav a:active, ul.nav a:focus { /* this changes the background and text color for both mouse and keyboard navigators */
    background: #6F7D94;
    color: #FFF;
    }
    .content ul, .content ol { 
    padding: 0 15px 15px 40px; /* this padding mirrors the right padding in the headings and paragraph rule above. Padding was placed on the bottom for space between other elements on the lists and on the left to create the indention. These may be adjusted as you wish. */
    }
    
    /* ~~ The navigation list styles (can be removed if you choose to use a premade flyout menu like Spry) ~~ */
    ul.nav {
    list-style: none; /* this removes the list marker */
    border-top: 1px solid #666; /* this creates the top border for the links - all others are placed using a bottom border on the LI */
    margin-bottom: 15px; /* this creates the space between the navigation on the content below */
    }
    ul.nav li {
    border-bottom: 1px solid #666; /* this creates the button separation */
    }
    ul.nav a, ul.nav a:visited { /* grouping these selectors makes sure that your links retain their button look even after being visited */
    padding: 5px 5px 5px 15px;
    display: block; /* this gives the link block properties causing it to fill the whole LI containing it. This causes the entire area to react to a mouse click. */
    text-decoration: none;
    background: #8090AB;
    color: #000;
    }
    ul.nav a:hover, ul.nav a:active, ul.nav a:focus { /* this changes the background and text color for both mouse and keyboard navigators */
    background: #6F7D94;
    color: #FFF;
    }
    
    /* ~~ The footer ~~ */
    .footer {
    padding: 10px 0;
    background: #6F7D94;
    position: relative;/* this gives IE6 hasLayout to properly clear */
    clear: both; /* this clear property forces the .container to understand where the columns end and contain them */
    }
    
    /* ~~ miscellaneous float/clear classes ~~ */
    .fltrt {  /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
    float: right;
    margin-left: 8px;
    }
    .fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */
    float: left;
    margin-right: 8px;
    }
    .clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */
    clear:both;
    height:0;
    font-size: 1px;
    line-height: 0px;
    }
    -->
    </style>
    
    <body>
    <div align="Left">
      <p><img src="indexp.png" width="728" height="90" /></p>
    </div>
    <div id="underhead">
    <?php
    if (empty($username))
    include ("loginbar.php");
    if (!empty($username))
    include ("logged.php");
    ?>
    <?PHP 
    $justreg = $_REQUEST['reg'];
    if ($justreg == yes)
    echo 'Thanks For Registering!';
    if ($justreg == loger)
    echo 'There was an error while tring to log you in.';
    if ($justreg == out)
    echo 'You were logged out!';
    ?> 
    </div>
    <?php include("menu.php"); ?>
    <div id="main">
      <p>Welcome To Ryan Weekly! The all new and improved site!</p>
      <p>I have a song on itunes!</p>
      <p>
        <object width="400" height="160">
          <param name="movie" value="http://widget.tunecore.com/swf/tc_run_h_v2.swf?widget_id=62316" />
          <param name="allowFullScreen" value="true" />
          <param name="allowscriptaccess" value="always" />
          <embed src="http://widget.tunecore.com/swf/tc_run_h_v2.swf?widget_id=62316" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="400" height="160"></embed>
        </object>
      </p>
    </div>
    Ryan Weekly 2009 - 2011 (May 11, 2011 at 6:00PM Is our 3 Year anniversary!)
    <script type="text/javascript">
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
    var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
    </script>
    </body>
    </html>

  3. Hi, I am not sure why but my script is not working. Choose a post is not working

    http://beta.cwuforum.com/stock/tech.php

     

    <?PHP $idofp = $_REQUEST['bida']; ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Ryan Weekly</title>
    <style type="text/css">
    body {
    background-color: #E3E5E2;
    }
    </style>
    </head>
    <style type="text/css">
    <!--
    body {
    font-size:12px;
    font-family:Verdana, Arial, Helvetica, sans-serif;
    }
    div#wrapper {
    width: 80%;
    background-color:#FFFFFF;
    margin-top: 50px;
    margin-bottom: 50px;
    margin-left: auto;
    margin-right: auto;
    padding: 0px;
    border: thin solid #000000;
    }
    div#header {
    padding: 15px;
    margin: 0px;
    text-align: center;
    }
    div#nav {
    width: 25%;
    padding: 10px;
    margin-top: 1px;
    float: left;
    border: thin solid #000000;
    
    }
    div#main {
    margin-left: 30%;
    margin-top: 1px;
    padding: 10px;
    border: thin solid #000000;
    }
    div#underhead {
    padding: 15px;
    margin: 0px;
    border-top: thin solid #000000;
    }
    
    {
    ul.nav a:hover, ul.nav a:active, ul.nav a:focus { /* this changes the background and text color for both mouse and keyboard navigators */
    background: #6F7D94;
    color: #FFF;
    }
    .content ul, .content ol { 
    padding: 0 15px 15px 40px; /* this padding mirrors the right padding in the headings and paragraph rule above. Padding was placed on the bottom for space between other elements on the lists and on the left to create the indention. These may be adjusted as you wish. */
    }
    
    /* ~~ The navigation list styles (can be removed if you choose to use a premade flyout menu like Spry) ~~ */
    ul.nav {
    list-style: none; /* this removes the list marker */
    border-top: 1px solid #666; /* this creates the top border for the links - all others are placed using a bottom border on the LI */
    margin-bottom: 15px; /* this creates the space between the navigation on the content below */
    }
    ul.nav li {
    border-bottom: 1px solid #666; /* this creates the button separation */
    }
    ul.nav a, ul.nav a:visited { /* grouping these selectors makes sure that your links retain their button look even after being visited */
    padding: 5px 5px 5px 15px;
    display: block; /* this gives the link block properties causing it to fill the whole LI containing it. This causes the entire area to react to a mouse click. */
    text-decoration: none;
    background: #8090AB;
    color: #000;
    }
    ul.nav a:hover, ul.nav a:active, ul.nav a:focus { /* this changes the background and text color for both mouse and keyboard navigators */
    background: #6F7D94;
    color: #FFF;
    }
    
    /* ~~ The footer ~~ */
    .footer {
    padding: 10px 0;
    background: #6F7D94;
    position: relative;/* this gives IE6 hasLayout to properly clear */
    clear: both; /* this clear property forces the .container to understand where the columns end and contain them */
    }
    
    /* ~~ miscellaneous float/clear classes ~~ */
    .fltrt {  /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
    float: right;
    margin-left: 8px;
    }
    .fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */
    float: left;
    margin-right: 8px;
    }
    .clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */
    clear:both;
    height:0;
    font-size: 1px;
    line-height: 0px;
    }
    -->
    </style>
    
    <body>
    <div align="Left">
      <p><img src="indexp.png" width="728" height="90" /></p>
    </div>
    <div id="underhead">
      <form id="bida2" name="form1" method="post" action="tech.php">
        Choose Post: 
        <label for="id"></label>
        <select name="id" id="bida">
          <option value="ad1">Google Chrome Netbook </option>
        </select>
        <input type="submit" name="send" id="send" value="View" />
      </form>
    </div>
    <?php include("menu.php"); ?>
    <div id="main"> 
    <?PHP
    if (empty($idofp))
    include ("canoncamera1.php"); 
    if ($idofp == ad1)
    include ("chromenetbook.php"); 
      ?>
    </div>
    Ryan Weekly 2009 - 2011 (May 11, 2011 at 6:00PM Is our 3 Year anniversary!)
    </body>
    </html>

  4. I have checked this here is the full page code

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>PRIVATE | CWUFORUM.COM</title>
    </head>
    <?php
      //username
      $useah = $_SESSION['MM_Username'];
      $idfree = $_GET['camid3'];
    //database
    $db_host = "localhost";
    $db_name = "mydb";
    $username = "myuser";
    $password = "mypass";
    //connect
    mysql_connect($db_host,$username,$password);
    mysql_select_db($db_name);
    //Camera View Link
    ?>
    <?PHP
    $result = mysql_query("UPDATE camera SET public1='1' WHERE cwuser='$user'");
    ?>
    <body>
    <p>Your camera has been made private!</p>
    <p><a href="index.php">Back</a></p>
    </body>
    </html>

  5. I am trying to update a mysql field.

     

    I am using this php code all the login info is right and it does not work

    Table Name: camera

    Field I Want To Change: public1

     

    //Connect To Database
    $db_host = "localhost";
    $db_name = "mydbname";
    $username = "myusername";
    $password = "mypassword";
    
    mysql_connect($db_host,$username,$password);
    mysql_select_db($db_name);
    $result = mysql_query("UPDATE camera SET public1='2' WHERE cwuser='$user'");
    ?>
    

  6. Hi i created a website where you cam view ip webcams via php. I want to make it so people can make the camera private and public.

    I made two fields in mysql called "Username" and "Puborprivate"

    I tried to make the "Puborprivate" have two numbers "0" would be private and "1" would be public. How could I do this?

    My site is cwuforum.com/live/

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.