Jump to content

MSUK1

Members
  • Posts

    188
  • Joined

  • Last visited

Posts posted by MSUK1

  1. Hello

     

    I am trying to upload an SQL file to my new VPS. However i keep getting this error:

     

    #1153 - Got a packet bigger than 'max_allowed_packet' bytes

     

    I've contacted my host and they've said phps upload limit is 2M and the packetsize is too small

     

    Ive checked my php ini file, upload size is 128M and the packet max is 16M

     

    What am i doing wrong?

     

    The filesize is just over 2MB

  2. by client do you mean devide being used to view website?

     

    If so, the font i am looking for is installed on both mac, windows and iphone.

     

    Like i said i visited just-eat.com and there font works on my iphone? However using their same code, does not work on my iphone?

     

    If you mean installing on my server how do i do this?

  3. Hi there, im wondering how via css and html to get the font "rockwell" on mobile and desktop devices.

     

    I at first used:

     

    font-family:rockwell;
    

     

    this worked on my desktop but not my iphone?

     

    i can see a site www.just-eat.co.uk using this:

     

    font-family:"RockwellRegular",Arial,Helvetica,sans-serif;
    

     

    so i thought i'd try this straight copy and paste, but then i only get the arial font?

  4. Hello, i have hosting with hosting24.com

     

    When inside our office on IP - A, email authentication and cpanel login authentication fails intermitently, sometimes it works sometimes it doesn't displaying password wrong error.

     

    When outside the office or on IP - X everything works like normal, no errors no nothing.

     

    We have tried the following steps, new IP from ISP.

    New router

  5. the data in the DB is fine,

     

    I think the problem is coming from the select form.

     

    I have written the "on change" function which submits the form on change

     

    it is converting any symbol &^%$£@!!@£ into its symbol value

     

    is there a way to prevent this? i believe this is the failure

  6. sample function

     

    function displayLeaders($usern){
    
       global $database;
       $q = "SELECT * "
           ."FROM ".TBL_USERS." WHERE userlevel = '5'";
       $result = $database->query($q);
       /* Error occurred, return given name by default */
       $num_rows = mysql_numrows($result);
       if(!$result || ($num_rows < 0)){
          echo "Error displaying info";
          return;
       }
       if($num_rows == 0){
          echo "Database table empty";
          return;
       }
       /* Display table contents */
       echo "<select onchange=\"document.leaders_email.submit()\" name=\"emailLeader\" id=\"emailLeader\" placeholder=\"Select A Leader\" class=\"{validate:{required:true}}\">\n";
       echo "<option value=\"\">Please Choose A Leader</option>\n";
       for($i=0; $i<$num_rows; $i++){
          $LMusername = mysql_result($result,$i,"username");
          $LMemail = mysql_result($result,$i,"email");
          echo "<option value=\"$LMemail\">$LMusername ( $LMemail )</option>\n";
       }
          echo "</select>";
    }
    

  7. Hello

     

    I am using a function to get a users email from a database, in the database it is stored as email@domain.com, when i pull this down from the database, and insert it into a select field it turns the value to email%2540domain.com %2540 = @ sign (im guessing)

     

    does anyone know why this is happening?

     

    All help appreciated

  8. Hello

     

    I have a script which propogates a select input with usersnames from a database,

     

    i want to be able to when a user selects a member for the fields (containing the members info) to be propogated so that an admin can change the details

     

    here is the script i use to get the members information:

     

    function displayMembers($usern){
    
       global $usern;
       global $database;
       $q = "SELECT * "
           ."FROM ".TBL_MEMBERS." WHERE leader = '$usern'";
       $result = $database->query($q);
       /* Error occurred, return given name by default */
       $num_rows = mysql_numrows($result);
       if(!$result || ($num_rows < 0)){
          echo "Error displaying info";
          return;
       }
       if($num_rows == 0){
          echo "Database table empty";
          return;
       }
       /* Display table contents */
       echo "<select name=\"selmem\" id=\"selmem\" placeholder=\"Select A Member\" class=\"{validate:{required:true}}\">\n";
       echo "<option value=\"\">Please Choose A Member</option>\n";
       for($i=0; $i<$num_rows; $i++){
          $Mprefix = mysql_result($result,$i,"prefix");
          $Mfname  = mysql_result($result,$i,"firstname");
          $Mlname = mysql_result($result,$i,"lastname");
          $Mgender  = mysql_result($result,$i,"gender");
          $Mdob  = mysql_result($result,$i,"dob");
          $Mpostcode = mysql_result($result,$i,"postcode");
          $Memail = mysql_result($result,$i,"email");
          echo "<option value=\"$Memail\">$Mfname $Mlname ( $Memail )</option>\n";
       }
          echo "</select>";
    }
    

     

     

    all help appreciated

  9. Hello

     

    im trying to create a settings page for a script im working on

     

    i want to use a variable 'l' for the link of an iframe

     

    ive written this

     

    settings.php

    <?
    /*
    THIS IS YOUR SETTINGS PAGE
    USE THIS TO CONFIGURE THE ITEM SWITCHER
    WE HOPE YOU ENJOY OUR PLUGIN
    */
    
    // STEP 1: CHOOSE YOUR THEME : 'green' 'orange' 'blue' 'pink' 
    
    $color = 'blue'; // change between the ' '
    
    // STEP 2: CREATE YOUR MENU
    
    /* HERE IS OUR PRE-DEFINED MENU SEE DOCUMENTATION TO ADDING MORE ITEMS */
    
    $menu = '       <li class="is-nav-li">
                    	<a href="http://msukserver.net/Dev/ItemSwitcher/?l=domain1">
                        Theme Forest
                        <span class="orange">Orange</span>
                        </a>
                    </li>
                	<li class="is-nav-li">
                    	<a href="http://msukserver.net/Dev/ItemSwitcher/?l=2">
                        Code Canyon
                        <span class="blue">Blue</span>
                        </a>
                    </li>
                	<li class="is-nav-li">
                    	<a href="http://msukserver.net/Dev/ItemSwitcher/?l=domain3">
                        Graphic River
                        <span class="green">Green</span>
                        </a>
                    </li>
                	<li class="is-nav-li">
                    	<a href="http://msukserver.net/Dev/ItemSwitcher/?l=domain4">
                        Video Hive
                        <span class="pink">Pink</span>
                        </a>
                    </li>
    	';
    
    // STEP 3: DEFINE EACH URL
    
    $l = NULL;
    if(isset($_GET['l']) && $_GET['l'] == "domain1"){
      $l = 'http://www.domain1.net/';
    }
    $l = NULL;
    if(isset($_GET['l']) && $_GET['l'] == "domain2"){
      $l = 'http://www.domain2.net/';
    }
    $l = NULL;
    if(isset($_GET['l']) && $_GET['l'] == "domain3"){
      $l = 'http://www.domain3.net/';
    }
    $l = NULL;
    if(isset($_GET['l']) && $_GET['l'] == "domain4"){
      $l = 'http://www.domain4.net/';
    }
    
    echo $l;
    
    ?>
    

     

    then the main index.php file which includes settings.php before the header

     

    <?
    
    include 'settings.php';
    
    ?>
    
    <!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>
    
    <link rel="stylesheet" type="text/css" media="screen" href="is/css/<? echo $color; ?>.css"/>
        <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
    
    </head>
    
    <body>
    
    <div id="isbar" class="isbar">
    <div id="left">
    	<div class="logo"></div>
    </div>
    <div id="right">
    	<a id="close-button" class="close" href="#hello">
    		<p class="close">close</p>
    	</a>
    	<a class="buy" href="#hello">
    		<p class="buy">Purchase</p>
    	</a>
    </div>
    <div id="center">
        	<div id="is-button">
            	<p class="button">Select A Theme</p>
            </div>
        	<div id="is-menu">
            	<ul id="is-nav-ul">
                <? echo $menu; ?>
                </ul>
            </div>
    </div>
    </div>
    
    <!-- JS -->
    
    <script type="text/javascript">
    $("#is-button").click(function () {
    $("#is-menu").fadeToggle("slow");
    });    
    $("#close-button").click(function () {
    $("#isbar").fadeOut("fast");
    });    
    </script>
    
    <iframe src="<? echo $l; ?>" scrolling="yes" width="100%" height="100%">
    </iframe>
    
    </body>
    </html>

     

    when selecting the link (which navigates to ?l=domain1 (for example))

     

    nothing loads in the iframe, it doesn't seem to be echoing a value for 'l'

     

    all help apperciated

  10. Why is the second field name a variable ie $week?

     

    if you have 2 VALUES you 2 fields to update.

     

    $q = "INSERT INTO ".TBL_MEMBER_NOTES." (memberid, $week) VALUES ('$id', '$note') ON DUPLICATE KEY UPDATE $week = '$note'";
    

     

     

    Sorry, i got confused, thank you let me try this

     

    really appreciate it

  11. so its not like values where i put '$variable' around a variable?

     

    memberid is unique, it is their email address.

     

    At first i tried setting this as a primary key but this limited it to 8 chars, so i set it as a unique key

     

    ok let me try again :)

     

       /**
        * addNewNote - Inserts the given to member note database
        */
       function addNewNote($id, $week, $note){
          $q = "INSERT INTO ".TBL_MEMBER_NOTES." ($week) VALUES ('$id', '$note') ON DUPLICATE KEY UPDATE memberid = '$id', '$week' = '$note'";
          return mysql_query($q, $this->connection);
       }
       
    

     

    still not updating :/

  12. would this be the correct string then?

     

       /**
        * addNewNote - Inserts the given to member note database
        */
       function addNewNote($id, $week, $note){
          $q = "INSERT INTO ".TBL_MEMBER_NOTES." (memberid, '$week') VALUES ('$id', '$note') ON DUPLICATE KEY UPDATE memberid = '$id', '$week' = '$note'";
          return mysql_query($q, $this->connection);
       }
    

     

    thank you

  13. i was just looking at phpMyadmin and trying to see what it runs when i manually update the row.

     

    if i use update for this, how would i write a bit of code to decipher if a row exists for that memberid?

     

    if memberid exists ->Update OR if it doesnt Insert

     

    (im guessing thats the right method?)

  14. Hello

     

    I have created a little note system for an admin to be able to add notes for a specific user.

     

    I'll attach each bit of code as it follows, im not getting any errors but at the same time im not getting the desired output?

     

    My DB structure is as follows:

     

    Columns: memberid | week1 ... week52

     

    (im not sure that is the best way to do it but please correct me where neccessery)

     

    The Form: (have removed a lot of the options just because they aren't necessary you'll get the picture)

                  <a name="form"></a><form action="system/process.php" method="post">                  
                    <p>
                        Member to add notes for:
                      <input type="text" disabled="true" id="membername" placeholder="<?php echo $_GET["name"]; ?>" value="<?php echo $_GET["name"]; ?>" name="membername" class="{validate:{required:true, minlength:3}}" />
                      </p>
                      
                      <p>
                       Please select the week to add notes for:
                        <select name="week" id="week" placeholder="week" class="{validate:{required:true}}">
                          <option selected="true">Please select or search for a week</option>
                          <option value="week1">Week 1</option>
                          <option value="week2">Week 2</option>
                          <option value="week3">Week 3</option>
                        </select>
                      </p>
    
                    <p>
                       Please add the notes below:
                      <textarea id="note" name="note" class="{validate:{required:true}}">This is a textarea</textarea>
                    </p>
                      
                      <input type="hidden" value="<?php echo $_GET["email"]; ?>" name="id" id="id" />
    	  <input type="hidden" name="newnote" value="1" /> <!-- THIS IS USED TO TRIGGER THE FUNCTION -->
    
                
                <div class="action_bar">
              <input type="submit" class="button blue small" value="Submit" id="submit" name="submit" />
                  <a href="members" class="button red small">Close window</a>
                </div>
                </form>
    

     

    process.php (again i have removed functions you do not need to see as they do no interact at all with this function)

          /* Add new Member Note */
          else if(isset($_POST['newnote'])){
             $this->procNewNote();
          }
    
       /**
        * procNewNote
        **/
       function procNewNote(){
          global $session, $form;
          /* Registration attempt */
          $retval = $session->newnote($_POST['id'], $_POST['week'], $_POST['note']);
          
          /* Registration Successful */
          if($retval == 0){
             $_SESSION['regsuccess'] = true;
             header("Location: ".$session->referrer);
          }
          /* Error found with form */
          else if($retval == 1){
             $_SESSION['value_array'] = $_POST;
             $_SESSION['error_array'] = $form->getErrorArray();
             header("Location: ".$session->referrer);
          }
          /* Registration attempt failed */
          else if($retval == 2){
             header("Location: ".$session->referrer);
          }
       }
    

     

    session.php

       /**
        * register new note - register a new note
        */
       function newnote($subid, $subweek, $subnote){
          global $database, $form, $mailer;  //The database, form and mailer object
          
          /* ID error checking */
          $field = "id";  //Use field name for first name
          if(!$subid || strlen($subid = trim($subid)) == 0){
             $form->setError($field, "* Fatal error occured");
          }
          else{
          }
    
          /* Week error checking */
          $field = "week";  //Use field name for first name
          if(!$subweek || strlen($subweek = trim($subweek)) == 0){
             $form->setError($field, "* Please select a week");
          }
          else{
          }
    
          /* Note error checking */
          $field = "note";  //Use field name for first name
          if(!$subnote || strlen($subnote = trim($subnote)) == 0){
             $form->setError($field, "* Please enter your notes");
          }
          else{
          }
    
          /* Errors exist, have user correct them */
          if($form->num_errors > 0){
             return 1;  //Errors with form
          }
          /* No errors, add the new account to the */
          else{
             if($database->addNewNote($subid, $subweek, $subnote)){
                return 0;  //New user added succesfully
             }else{
                return 2;  //Registration attempt failed
             }
          }
       }
    

     

    database.php

       /**
        * addNewNote - Inserts the given to member note database
        */
       function addNewNote($id, $week, $note){
          $q = "INSERT INTO ".TBL_MEMBER_NOTES." ('$week')
      WHERE memberid = '$id'
      VALUES ('$note')";
          return mysql_query($q, $this->connection);
       }
    

     

    TBL_MEMBER_NOTES is define in constant.php file

    define("TBL_MEMBER_NOTES", "member_notes");
    

     

    What i hope to happen

     

    im hoping this system would insert into the table a new row for a user, if it doesn't exist and fill in the specified column (weekX) for the week selected in the field

     

    if the member note row already exists im hoping for it to insert into the specified column and just update it

     

    all help is appreciated

  15. i completely re-thought about what i wanted- apologies

     

    I used AJAX to process the form to a php page.

     

    and as soon as the form was successfully completed the form in the div should hide.

     

    Tested and working this is my code: is the formatting okay?

     

    I don't see how this relates to php at all. You already said your using jQuery.

     

    It related to php because i wanted to process the php form using ajax

     

     

    <html>
    <head>
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>EU Cookie Plugin</title>
    <style>
    div.divvy {width:100%;height:auto;border-bottom:#000;background-color:#333;color:#fff;padding:10px;text-align:center;top:0px;}
    </style>
    </head>
    
    <body style="padding:0px; margin:0px;">
    
    
    <? if (!isset($_COOKIE["EURegulationsMSUK"])) { ?>
        <div id="note" class="divvy">
            <form name="setform" method="post" action="setcookie.php">
                <input type="button" id="EUclose" class="button" name="set" value="on" />
            </form>
        </div>
    <script>
    	$(".button").click(function() {
    		var set = $("input#EUclose").val();
    		var dataString = 'set='+ set;
    	  
    	$.ajax({
    		type: "POST",
    		url: "setcookie.php",
    		data: dataString,
    	success: function() {
    		$('#note').slideUp(400,function () {
    			$('#note').remove();
    					});
    				}
    			});
    		return false;
    	});
        </script>
    
    <? } ?>
    
        <div>
    	<?php
              if (isset($_COOKIE["EURegulationsMSUK"])) 
              echo "Cookie Permission " . $_COOKIE["EURegulationsMSUK"] . "!<br />";
            else
              if(!isset($_COOKIE["EURegulationsMSUK"]))
                echo "Cookie Permission off";
            else
                echo "Error no cookie Set";
            ?>
        <br />
            <p style="display:inline;">Switch off Cookie</p>
                <form style="display:inline;" name="setform" method="post" action="setcookie.php">
                    <button name="set" type="submit" value="off">Off</button>
                </form>
        </div>
    </body>
    </html>
    

  16. I have a form that submits to a page

     

    when the user presses the submit button i want the form to wait 3 seconds before submitting (in this 3 seconds a div will slideup using jquery

     

    then the form will submit after the nice fancy removal of the div

     

    this is probably the wrong way to go about it? but its all i can think?

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