Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2013
    Posts
    200
    Thanks
    14
    Thanked 0 Times in 0 Posts

    new thread from yesterday page won't display results

    I need help alooot.com/Sanel-Suad/obrada.php
    won't display results.



    This it alooot.com/Sanel-Suad/unospodataka.php

    here i am entering in formations in the form.
    PHP Code:



    <?php require_once('Connections/webdes42_boookingsystem.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;
    }
    }

    $editFormAction $_SERVER['PHP_SELF'];
    if (isset(
    $_SERVER['QUERY_STRING'])) {
      
    $editFormAction .= "?" htmlentities($_SERVER['QUERY_STRING']);
    }

    if ((isset(
    $_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      
    $insertSQL sprintf("INSERT INTO adult (rooms, adult, kids, startDate, endDate) VALUES (%s, %s, %s, %s, %s)",
                           
    GetSQLValueString($_POST['rooms'], "int"),
                           
    GetSQLValueString($_POST['adult'], "int"),
                           
    GetSQLValueString($_POST['kids'], "int"),
                           
    GetSQLValueString($_POST['startDate'], "text"),
                           
    GetSQLValueString($_POST['endDate'], "text"));

      
    mysql_select_db($database_webdes42_boookingsystem$webdes42_boookingsystem);
      
    $Result1 mysql_query($insertSQL$webdes42_boookingsystem) or die(mysql_error());

      
    $insertGoTo "obrada.php";
      if (isset(
    $_SERVER['QUERY_STRING'])) {
        
    $insertGoTo .= (strpos($insertGoTo'?')) ? "&" "?";
        
    $insertGoTo .= $_SERVER['QUERY_STRING'];
      }
      
    header(sprintf("Location: %s"$insertGoTo));
    }
     







    ?>


    <!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>Untitled Document</title>
    </head>

    <body>
    <form action="<?php echo $editFormAction?>" method="post" name="form1" id="form1">
      <table align="center">
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">Rooms:</td>
          <td><input type="text" name="rooms" value="" size="32" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">Adult:</td>
          <td><input type="text" name="adult" value="" size="32" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">Kids:</td>
          <td><input type="text" name="kids" value="" size="32" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">StartDate:</td>
          <td><input type="text" name="startDate" value="" size="32" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">EndDate:</td>
          <td><input type="text" name="endDate" value="" size="32" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">&nbsp;</td>
          <td><input type="submit" value="Insert record" /></td>
        </tr>
      </table>
      <input type="hidden" name="MM_insert" value="form1" />
    </form>
    <p>&nbsp;</p>
    </body>
    </html>

  • #2
    Regular Coder
    Join Date
    Aug 2013
    Posts
    200
    Thanks
    14
    Thanked 0 Times in 0 Posts
    I need help alooot.com/Sanel-Suad/obrada.php
    won't display results.

    This is
    alooot.com/Sanel-Suad/obrada.php spouse get results.

    PHP Code:

    <?php require_once('Connections/webdes42_boookingsystem.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;
    }
    }

    mysql_select_db($database_webdes42_boookingsystem$webdes42_boookingsystem);
    $query_Recordset1 "SELECT * FROM adult";
    $Recordset1 mysql_query($query_Recordset1$webdes42_boookingsystem) or die(mysql_error());
    $row_Recordset1 mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 mysql_num_rows($Recordset1);
     


    mysql_free_result($Recordset1);
     

    $host="m"// Host name 
    $username=""// Mysql username 
    $password=""// Mysql password 
    $db_name=""// Database name 
    $tbl_name=""// Table name 

    // Connect to server and select database.
    mysql_connect("$host""$username""$password")or die("cannot connect"); 
    mysql_select_db("$db_name")or die("cannot select DB");

    // Get values from form 
    $startDate=$_POST['startDate'];
    $endDate=$_POST['endDate'];

    $rooms=$_POST['rooms'];
    $kids=$_POST['kids'];
    $adult=$_POST['adult'];
    // Insert data into mysql 

    $sql="INSERT INTO adult(startDate,endDate, rooms, kids,adult,numberdays)VALUES('$startDate','$endDate', '$rooms', '$kids','$adult','$numberdays')";
    $result=mysql_query($sql);



        


    if(
    $result){
    echo 
    "succesfull";
    echo 
    "<BR>";
    echo 
    "<a href=''></a>";
    }

    else {
    echo 
    "ERROR";
    }


    ?> 

      <?php 
    $ending 
    strtotime($_POST['endDate']);
    $starting strtotime($_POST['startDate']);

    $numberDays floor(abs($ending -$starting) / 86400);



    echo 
    "You want reserve room number   (".$_POST["rooms"].")  from " .$_POST['startDate']. " until " .$_POST['endDate']. " in period of " .ceil($numberDays). " day(s) and ".ceil($numberDays)." night(s).";
    if(
    $_POST['rooms']=="1"){
        
    $s1=100;
    }else if (
    $_POST['rooms']=="2"){
        
    $s1=200;
    }else if(
    $_POST['rooms']=="3"){
        
    $s1=300;
    }else if (
    $_POST['rooms']=="4"){
        
    $s1=400;
    }
    $price=$numberDays*$s1;
        
     echo 
    "<div style='text-align:down 1000px'><h1> "$_SESSION['price']."</h1></div>";

             echo 
    '<br />You have to pay  € '.$price;



    if( 
    $vr2 "0" )
    {


    }

    {

        
        }
        
        
    //$_POST['brojDana']=$brojDana;



     
    ?>

    <p class="nn">&nbsp;<?php echo $row_Recordset2['']; ?></p>
    <?php 

    echo "<div style='text-align:down 1000px'><h1> "$_SESSION['rooms,you,have,kids,you, have,adult']."</h1></div>";
     
    ?>
    <h3>You want[     <?php echo $row_Recordset1['rooms']; ?>  ]rooms . You have [ <?php echo $_POST['kids']; ?>     ]kids. You have[      <?php echo $_POST['adult']; ?>         ]adult.<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
    [/QUOTE]

  • #3
    Regular Coder
    Join Date
    Aug 2013
    Posts
    200
    Thanks
    14
    Thanked 0 Times in 0 Posts
    Any helppp anybody checking this.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •