Jump to content

loki951510

Members
  • Posts

    18
  • Joined

  • Last visited

Posts posted by loki951510

  1. I'm not really following. First of all, there should be no reason to run two queries.

     

    Are you wanting to set the field cn1 to the string value of "CN" concatenated with the new numerical value for pad_count? For example, if the exising pad_count value equals 10 and the $add_pad_count is 5: do you want to set pad_count to '15' and cn1 to 'cn15'?

    yes thats how i need to do it if poss

    i want to set pad_count to '15' and cn1 to 'cn15'

  2. If i have both set like this they work

    $sql = "UPDATE users SET pad_count = (pad_count + $add_pad_count) WHERE username = '$session->username'";
    $sql = "UPDATE users SET cn1='blue' WHERE username = '$session->username'";

    but on the second UPDATE i need cn1 to be like

     

    cn$pad_count

     

    so it will turn the next block blue in the list how can i do this as its starting to drive me made i have been trying for about a week now to get this sorted

     

    thanks for the help in advance

  3. i have this sql stament and i cant get it to work

                $sql2 = "SELECT pad_count FROM user WHERE pad_id = 1";
                $sql = "UPDATE user ". "SET pad_count = ($sql2 + $pad_count) ". "WHERE pad_id = $pad_id" ;

    this is the error im getting from it can some one help me plz

    Could not update data: You can't specify target table 'user' for update in FROM clause
  4. i have taken over someones hosting and they want to have prices show to people before they order so im trying to figger out how to add that into their order page what they already have got can anyone help me plz

     

    as i need diffent prices for the 3 size's and if its for Business or Resident

    <html>
      <head>
        <style title="XinhaInternalCSS" type="text/css">.htmtableborders, .htmtableborders td, .htmtableborders th {border : 1px dashed lightgrey ! important;}
    html, body { border: 0px; } 
    body { background-color: #ffffff; } 
    img, hr { cursor: default } 
    </style> 
        <style title="XinhaInternalCSS" type="text/css">.htmtableborders, .htmtableborders td, .htmtableborders th {border : 1px dashed lightgrey ! important;}
    html, body { border: 0px; } 
    body { background-color: #ffffff; } 
    img, hr { cursor: default } 
    </style> 
        <style title="XinhaInternalCSS" type="text/css">.htmtableborders, .htmtableborders td, .htmtableborders th {border : 1px dashed lightgrey ! important;}
    html, body { border: 0px; } 
    body { background-color: #ffffff; } 
    img, hr { cursor: default } 
    </style> <script type="text/javascript">
    function openWindow(url, wname, width, height) {
    window.open(url, wname, "height=" + height + ",width=" + width + "location = 0, status = 1, resizable = 0, scrollbars=1, toolbar = 0");
    return true;
    }
    </script> <!-- stylesheet loads to make everything styled --
    <body>
    <h2 id="pagetitle">Order a Skip</h2>
    <hr />
    <br />
    <!-- div loads to make sure everything goes in right place --> 
        
      </head> 
      <body> 
        <div id="centerpanel"> <img id="headpic" size="32" src="img/feature/home_main.jpg" border="0" style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #7b97c6; border-right-color: #7b97c6; border-bottom-color: #7b97c6; border-left-color: #7b97c6; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> <hr /> <br /> 
          <form name="contactform" method="post" action="https://xxxxxxx.co.uk/content/send_form_order.php" target="popupWin" onsubmit="return openWindow('content/send_form_order.php', 'popupWin', 600, 500);"> <label for="size">Please Select which size of skip you will be requiring: </label> <br /> 
            <table border="0"> 
              <tbody> 
                <tr> 
                  <th>Mini Skip</th> 
                  <th>Midi Skip</th> 
                  <th>Builders Skip</th> 
                </tr> 
                <tr> 
                  <td><img src="http://www.xxxxxxx.co.uk/img/skiphire/miniskip.jpg" alt="miniskip" /></td> 
                  <td><img src="http://www.xxxxxxx.co.uk/img/skiphire/midiskip.jpg" alt="midiskip" /></td> 
                  <td><img src="http://www.xxxxxxx.co.uk/img/skiphire/businessskip.jpg" alt="businessskip" /></td> 
                </tr> 
                <tr> 
                  <td>size 2  <br /><input type="radio" value="2" name="size" /></td> 
                  <td>Size 4  <br /><input type="radio" value="4" name="size" /></td> 
                  <td>Size 8 <br /><input type="radio" value="8" name="size" /></td> 
                </tr> 
              </tbody> 
            </table> 
            <table width="550px"> 
              <tbody> 
                <tr> 
                  <td valign="top"> <b> Selecting Your Skip</b><br /> </td> 
                </tr> 
                <tr> 
                  <td valign="top"> </td> 
                </tr> 
                <tr> 
                  <td valign="top"> <label for="delivery">Date for delivery: </label> </td> 
                  <td valign="top"> <input type="text" name="delivery" maxlength="20" size="10" value="XX/XX/XX" /> <br />
    please give at least 48 hours notice or call the office for more urgent requests.
     </td> 
                </tr> 
                <tr> 
                  <td valign="top"> <b> Your Details</b><br /> </td> 
                </tr> 
                <tr> 
                  <td valign="top"> <label for="busres">Please Select which applies to your order?</label> </td> 
                  <td valign="top">
    Business<input type="radio" value="Business" name="busres" />
    Resident<input type="radio" value="Resident" name="busres" /><br /> </td> 
                </tr> 
                <tr> 
                  <td valign="top"> <label for="title">Title:</label> </td> 
                  <td valign="top"> <input type="text" name="title" maxlength="10" size="10" /> </td> 
                </tr> 
                <tr> 
                  <td valign="top"> <label for="first_name">First Name</label> </td> 
                  <td valign="top"> <input type="text" name="first_name" maxlength="50" size="30" /> </td> 
                </tr> 
                <tr> 
                  <td valign="top"> <label for="last_name">Last Name</label> </td> 
                  <td valign="top"> <input type="text" name="last_name" maxlength="80" size="30" /> </td> 
                </tr> 
                <tr> 
                  <td valign="top"> <label for="address">Address: </label> </td> 
                  <td valign="top"> 
                    <textarea name="address" maxlength="1000" cols="25" rows="2"></textarea> 
                  </td> 
                </tr> 
                <tr> 
                  <td valign="top"> <label for="postcode">Postcode: </label> </td> 
                  <td valign="top"> <input type="text" name="postcode" maxlength="30" size="30" /> </td> 
                </tr> 
                <tr> 
                  <td valign="top"> <label for="payment">Please select a payment method:</label> </td> 
                  <td valign="top"> <select name="payment"> <option selected="selected">- Select -</option> <option value="Account">Account</option> <option value="Cheque">Cheque</option> <option value="Card">Card</option> <option value="Cash">Cash</option> </select></td> 
                </tr> 
                <tr> 
                  <td valign="top"> <label for="ref">Order reference number(if applicable): </label> </td> 
                  <td valign="top"> <input type="text" name="ref" maxlength="30" size="30" value="N/A" /> </td> 
                </tr> 
                <tr> 
                  <td valign="top"> <label for="instructions">Delivery instructions: </label> </td> 
                  <td valign="top"> 
                    <textarea name="instructions" maxlength="1000" cols="25" rows="2"></textarea> 
                  </td> 
                </tr> 
                <tr> 
                  <td valign="top"> <label for="telephone">Home/Work Telephone:</label> </td> 
                  <td valign="top"> <input type="text" name="telephone" maxlength="50" size="30" /> </td> 
                </tr> 
                <tr> </tr> 
                <tr> 
                  <td valign="top"> <label for="mobile">Mobile Number:</label> </td> 
                  <td valign="top"> <input type="text" name="mobile" maxlength="50" size="30" /> </td> 
                </tr> 
                <tr> 
                  <td valign="top"> <label for="email">Email Address</label> </td> 
                  <td valign="top"> <input type="text" name="email" maxlength="50" size="30" /> </td> 
                </tr> 
                <tr> 
                  <td colspan="2" style="text-align: center; "> <input type="submit" value="Submit Order" /> </td> 
                </tr> 
              </tbody> 
            </table> 
          </form> 
        </div> 
      </body>
    </html>
    
  5. i need to make this menu go down insted of right here is the code

     

      <?php do { ?>
       <li> <a href="?p=<?php echo $row_rsMainNav['pg_id']; ?>"<?php getSelectFront($row_rsMainNav['pg_id']); ?>><?php echo $row_rsMainNav['pg_link']; ?></a><br /></li>
        <?php } while ($row_rsMainNav = mysql_fetch_assoc($rsMainNav)); ?>

     

    the site is @ www.dsserver.co.uk/cmd so u can see what i mean

  6. how can i add a email message into this so when the person hits submit it will send out a e-mail to the diffent people in the group?????

     

    <?php
    
    include "connect.php"; //connection string
    include("include/session.php");
    
    print "<link rel='stylesheet' href='style.css' type='text/css'>";
    
    print "<table class='maintables'>";
    
    print "<tr class='headline'><td>Post a message</td></tr>";
    
    print "<tr class='maintables'><td>";
    
    // Write out our query.
    $query = "SELECT username FROM users";
    // Execute it, or return the error message if there's a problem.
    $result = mysql_query($query) or die(mysql_error());
    
    $dropdown = "<select name='username'>";
    while($row = mysql_fetch_assoc($result)) {
    $dropdown .= "\r\n<option value='{$row['username']}'>{$row['username']}</option>";
    }
    $dropdown .= "\r\n</select>";
    
    if(isset($_POST['submit']))
    
    {
    
       $name=$session->username;
    
       $yourpost=$_POST['yourpost'];
    
       $subject=$_POST['subject'];
    
    $to=$_POST['username']; 
    
    
       if(strlen($name)<1)
    
       {
    
          print "You did not type in a name."; //no name entered
    
       }
    
       else if(strlen($yourpost)<1)
    
       {
    
          print "You did not type in a post."; //no post entered
    
       }
    
       else if(strlen($subject)<1)
    
       {
    
          print "You did not enter a subject."; //no subject entered
    
       }
    
       else
    
       {
    
          $thedate=date("U"); //get unix timestamp
    
          $displaytime=date("F j, Y, g:i a");
    
          //we now strip HTML injections
    
          $subject=strip_tags($subject);
    
          $name=strip_tags($name);
    
          $yourpost=strip_tags($yourpost); 
    $to=strip_tags($to);
    
          $insertpost="INSERT INTO forumtutorial_posts(author,title,post,showtime,realtime,lastposter,name) values('$name+shaun','$subject','$yourpost','$displaytime','$thedate','$name','$to')";
    
          mysql_query($insertpost) or die("Could not insert post"); //insert post
    
          print "Message posted, go back to <A href='forum.php'>Forum</a>.";
    
       }
    
    
    
    }
    
    else
    
    {
    
       print "<form action='newtopic.php' method='post'>";
    
       print "Your name:<br>";
    
       print "$session->username<br>";
    
       print "User to send to:<br>";
    
    print "$dropdown<br>";
    
       print "Subject:<br>";
    
       print "<input type='text' name='subject' size='20'><br>";
    
       print "Your message:<br>";
    
       print "<textarea name='yourpost' rows='5' cols='40'></textarea><br>";
    
       print "<input type='submit' name='submit' value='submit'></form>";
    
    
    
    }
    
    print "</td></tr></table>";
    
    ?>
    

  7. i have been trying to get this code to get a list of usernames from a database and i have now got that to work but when i try and save it it saves all the usernames from the drop down list and not just the one i have selected

     

    how can i get it to just use the one i have selected

     

    <?php
    
    include "connect.php"; //connection string
    include("include/session.php");
    
    print "<link rel='stylesheet' href='style.css' type='text/css'>";
    
    print "<table class='maintables'>";
    
    print "<tr class='headline'><td>Post a message</td></tr>";
    
    print "<tr class='maintables'><td>";
    
    // Write out our query.
    $query = "SELECT username FROM users";
    // Execute it, or return the error message if there's a problem.
    $result = mysql_query($query) or die(mysql_error());
    
    $dropdown = "<select name='username'>";
    while($row = mysql_fetch_assoc($result)) {
    $dropdown .= "\r\n<option value='{$row['username']}'>{$row['username']}</option>";
    }
    $dropdown .= "\r\n</select>";
    
    if(isset($_POST['submit']))
    
    {
    
       $name=$session->username;
    
       $yourpost=$_POST['yourpost'];
    
       $subject=$_POST['subject'];
    
    $to=$dropdown;
    
       if(strlen($name)<1)
    
       {
    
          print "You did not type in a name."; //no name entered
    
       }
    
       else if(strlen($yourpost)<1)
    
       {
    
          print "You did not type in a post."; //no post entered
    
       }
    
       else if(strlen($subject)<1)
    
       {
    
          print "You did not enter a subject."; //no subject entered
    
       }
    
       else
    
       {
    
          $thedate=date("U"); //get unix timestamp
    
          $displaytime=date("F j, Y, g:i a");
    
          //we now strip HTML injections
    
          $subject=strip_tags($subject);
    
          $name=strip_tags($name);
    
          $yourpost=strip_tags($yourpost); 
    $to=strip_tags($to);
    
          $insertpost="INSERT INTO forumtutorial_posts(author,title,post,showtime,realtime,lastposter,name) values('$name','$subject','$yourpost','$displaytime','$thedate','$name','$to')";
    
          mysql_query($insertpost) or die("Could not insert post"); //insert post
    
          print "Message posted, go back to <A href='forum.php'>Forum</a>.";
    
       }
    
    
    
    }
    
    else
    
    {
    
       print "<form action='newtopic.php' method='post'>";
    
       print "Your name:<br>";
    
       print "$session->username<br>";
    
       print "User to send to:<br>";
    
    print "$dropdown";
    
       print "Subject:<br>";
    
       print "<input type='text' name='subject' size='20'><br>";
    
       print "Your message:<br>";
    
       print "<textarea name='yourpost' rows='5' cols='40'></textarea><br>";
    
       print "<input type='submit' name='submit' value='submit'></form>";
    
    
    
    }
    
    print "</td></tr></table>";
    
    ?>
    

     

    MOD EDIT: Changed PHP manual link [m] . . . [/m] tags to

     . . . 

    tags.

  8. hi all dont know if you can help

     

    im trying to remember how to do this i have a program what out puts the data like this

     

    The Fortress of the Aesir|xxxxxxx|Licat volare si super tergum Aquila volat.|14|0|United Kingdom|

     

    but i cant for the life of me remember how to make the php but each bit into a didnt box on a web page

     

    can someone plz help me

×
×
  • 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.