Jump to content

Mattyspatty

Members
  • Posts

    76
  • Joined

  • Last visited

Posts posted by Mattyspatty

  1. people dont like to do code for you.

     

    function rname($dirpath,$oldFileName,$newFilename)
    

    that is a step in the right direction, its just a case of renaming variables to work with the functions input. if you have a try but have errors or cannot seem to get it working correctly then post again and people will take a look

  2. you need to name your check boxes like an array.

    <input name="fave[A]" type="checkbox" value="true">
    <input name="fave[b]" type="checkbox" value="true">
    <input name="fave[C]" type="checkbox" value="true">
    

     

    for the POST you should use a foreach to read through each submitted value

    if(isset($_POST['fave'])) {
    foreach($_POST['fave'] as $id=>$value) {
    	echo $id."<br/>";
    }
    }
    

     

    if i checked box A and box C then i would get the output

    A = true
    B = true
    

     

    where A is the index array and true is the value of the checkbox (in your case, $page)

     

     

     

    hope this helps. let me know if i misunderstood your question or need more help :)

  3. while ($row=mysql_fetch_assoc($result)
    

    missed a second ) :P

     

    and reguarding to the original problem, this should have your desired effect

    <?php
    $i=0;
    echo '<table>';
    while ($row=mysql_fetch_assoc($result)) {
    if($i==0) echo '<tr>';
    
    echo '<td>';
    // do rest of column
    echo '</td>';
    
    if($i==2) {
    	echo '</tr>';
    	$i=0;
    } else {
    	$i++
    }
    }
    echo '<table>';
    ?>

     

     

  4. this is an error of trying to assign a property of an object that does not exist (as the error suggests)

     

    assuming the error is on this page (without page name and line numbers its hard to tell).

    $mxservers[$i] = $pref;
    $mxservers[$i]->host = $host;
    

    this is the probably problem, because $pref is not an object/class and $mxservers will become the same type as $pref. (string, int etc.)

     

     

    perhaps you intended this:

    $mxservers[$i]->pref = $pref;
    $mxservers[$i]->host = $host;
    

  5. this piece of code will create a checkbox, $checked is either NULL or the word 'checked' which will cause the checkbox to be checked when the page is loaded

    shouldnt be too difficult for you to alter it.

    <?php

    if($row['checked']==1) {

        $checked = "checked";

    } else {

        $checked = "";

    }

    echo "<input name=\"image[$row['img]\" type=\"checkbox\" value=\"true\" $checked >"

    ?>

  6. $sql = mysql_query("SELECT `money` FROM `members` WHERE `username`='$username'");

    $new = $sql - 5000;

    $update = mysql_query("UPDATE members SET money='$new' WHERE username='$username'");

     

    $sql will be a resourceid. you need to do a mysql_fetch_array or mysql_fetch_rows first to get the actual value of money

  7. my friend has created this query

     

    $res = mysql_query(
    "SELECT `users`.`id`, `users`.`admin`, `users`.`exp`, `characters`.*, `villages`.`element`,`villages`.`explore`, 
    `villages`.`village` AS `villagename`, 
    `fight_styles`.`name` AS `fightstyle`, 
    `bloodlines`.`name` AS `bloodline` 
    FROM `users` INNER JOIN `characters`, `villages`, `fight_styles`, `bloodlines` ON (`users`.`username` = `characters`.`username`) 
    AND (`villages`.`ID` = `characters`.`village`) 
    AND (`fight_styles`.`ID` = `characters`.`fight`) 
    AND (`bloodlines`.`ID` = `characters`.`blood`) 
    WHERE `users`.`username` = '" . $_SESSION['username'] . "' 
    LIMIT 1"
    ) or die(mysql_error());

     

     

    he is having some problems working out why it no lnoger works after transferring to a new server.

    we have checked the database but keep getting this error:

     

    You have an error in your SQL syntax near ' `villages`, `fight_styles`, `bloodlines` ON (`users`.`username` ' at line 5

     

     

    does anyone know what could be a possible cause?

  8. [quote=mattyspatty]the user visits a page, they have cookie data and i want the image to be able to read the cookie data[/quote]

    the image is generated on counter.php. and the page image.php shows the image (yes i realise that i should have done it the other way round now!)
    i want the image on counter.php to be able to collect the cookie info from image.php
×
×
  • 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.