Jump to content

dazz_club

Members
  • Posts

    103
  • Joined

  • Last visited

Posts posted by dazz_club

  1. I think, after digging around..is that I need to use a multidimensional array..

     

    The problem I've got is that the image sizes that have been selected don't match or file under the same image (when it's displayed to the user)..so I'm looking at using a multidimensional associative array..?

     

    Because each image selected (chosen by the user) comes with an option of having a large or small size or both...

     

    so I'm looking at something like this;

     

    $photograph_selected = array( 'Name of photograph' => $photograph_name, 
                          'Large Size Selected' => $large,
                          'Smal Size Selected' => $small 
                        );
    

     

    So now it's just a case how constructing the code and putting it where it seems fit...

     

    Thanks

  2. Hi,

     

    thanks for you post...I don't think I've sold it, just pointed out how it currently works, not how I would like it to work...

     

    If you take a look at the image embedded, the sizes don't match the photograph, because obviously it only shows what sizes have been selected..

     

    How do i got the sizes to be in the right position...

     

    Here's the code the produces the image about

     

     

    $how_many = count($photographs);
     
    //echo $how_many;
     echo '<p><strong>Quantity chosen:</strong> <em>'.$how_many.'</em></p>'. "\n";
        if ($how_many>0) {
            echo '<p>You chose the following photograph/s: <strong>Now please select the size/s you would like</strong></p>'. "\n";
        }
        echo '<ul class="basic_gallery">'. "\n";
        for ($i=0; $i<$how_many; $i++) {
            echo '<li><a href="" ><img src="../order/photo/'.$photographs[$i].'" /></a>'. "\n";
            echo '<input type="text" name="photographs[]" value = "'.$photographs[$i].'"  />';
            
            echo "<div id='options'> ". "\n";
            echo "<ul>
            <li><label>" . ($i+1) . '- ' . $photographs[$i] ."</label></li>
            </ul> ". "\n";
            echo '<ul class="photograph_size">';
           echo "<li><h4>Selected Sizes:</h4></li>";
           
           echo '<li>'.$large[$i].'</li>';
           echo '<li>'.$small[$i]. '</li>';
           echo "</ul>
     
     </div>
      </li>". "\n";
        }
            echo "</ul>". "\n";
     
    

     

    If you share your wisdom with me, I'll be grateful or point out where I;m going wrong and I can have a go..

     

    Thanks

  3. Hi there,

     

    I'm working on a photograph order form. The idea is to let the user select what photographs they want, proceed to the next page where they select the sizes and then on the last page complete their order with their details...(still working on this part)

     

    You can see a quick demo here http://flexdanceinc.co.uk/order/

     

    on the last page (if you go through the stages of choosing a photograph and size) you will see that the size's selected don't really match up to the correct photograph..

     

    Here is a screen shot of what I mean order-final.png

     

     

    I've made the scripts available too..

     

    I think I can understand what's going wrong or what's happening..it's displaying only the sizes that have been selected which makes sense but when it presents it on the next page (as seen above) it's not in the correct place, under the photograph it's meant to be...

     

    What am I doing wrong..

     

    Thanks

    size.phpfinal.phpindex.php

     

     

     

  4. Hello,

     

    I'm creating a questionnaire to try and get better at understanding sessions but I've stupidly fallen at the first hurdle.

     

    My problem is that I can't successfully pass variables from one page to another. You see, I'm trying to split my questionnaire into smaller questions, rather than having really long list of questions.

     

    Here is what the php code in my first page looks like;

     

    session_start();
    $_SESSION['contact_us'] = $contact_us;
    $_SESSION['response_time_email'] = $response_time_email;
    
    //checks to see if form is submitted and a question (tick box) has been checked
    if(isset($_POST['submitted'])) {
    if(!isset($_POST['contact_us'])) {
    
                    //if check box empty display
    	$must_complete = "<div id=\"fail\"><p>Please select a contact method; <strong>email, tel, fax or post</strong></p></div> ";
    
    }else{
                     //if checked take them to the next page
    	if(isset($_POST['contact_us'])){
    
    	//$confirm = 'yes '.$contact_us.'';
    	header('Location:page2.php');
    	}
    }
    }
    
    

     

    the two variables $contact_us and $response_time_email are there to store the variables and then pass them to the next page.

     

    Here is the php code in my second page, that receives it

     

    session_start();
    $contact_us = $_POST['contact_us'];
    $response_time_email =  $_POST['response_time_email'];
    
    //if previous button is submitted go to previous page
    if(isset($_POST['previous'])) {
    
    header('Location:index.php');
    
    }
    
    

     

    I think I could have it all mixed up here. If anyone can point in the right direction I would be grateful.

     

    Many thanks

  5. Hi all,

     

    I've got a function which selects some new items, but i am running into some bother

     

    the warning is:Warning: mysqli_error() expects exactly 1 parameter, 0...

     

    the line it specifies is;

    $result = mysqli_query($dbc, $query)or die(mysqli_error() . "<p>With query:<br>$query");
    

     

    Here is the whole function

     

    function InTheNews()
    {
    global $dbc;
    $query = "SELECT id, title, content, date FROM news_headlines ORDER BY id";
    $result = mysqli_query($dbc, $query)or die(mysqli_error() . "<p>With query:<br>$query");
    while ($row = mysqli_fetch_array($result))
    //need to format the date on this function
    {
    //get NewsID 
    echo '<div class="headline">
               <a href="in_the_news.php?headlines='.$row['id'].'">'.$row['title'].'</a>
    	   <span class="date_of_article">'.date("m.d.y",strtotime($row['date'])).'</span>
    	   <p>'.$row['content'].'</p>
               </div>
            
    ';
    }
    }
    

     

    Any pointers on this at all will be very helpful :)

  6. Hi,

     

    Thanks for getting back to me...When i removed error_reporting the problem was still there...

     

    What i done sort this out was to comment out the DEFINEs in my script  like this;

     

     

    ---------------------------------------

    //DEFINE('DB_USER', 'root');

    //DEFINE('DB_PASSWORD', 'xxxx');

    //DEFINE('DB_HOST', 'xxxx');

    //DEFINE('DB_NAME', 'xxxx');

    ---------------------------------------

     

    Why wasnt this a problem with the other php version??

     

     

    Whats happneded now is that some of my functions display this warning...

     

    -------------------------------------------------------------

    Warning: mysqli_error() expects exactly 1 parameter, 0 given in

    -------------------------------------------------------------

     

    function

    function InTheNews()
    {
    global $dbc;
    $query = "SELECT id,title, content,date FROM news_headlines ORDER BY id";
    $result = mysqli_query ($dbc, $query)or die(mysqli_error() . "<p>With query:<br>$query");
    while ($row = mysqli_fetch_array($result))
    //need to format the date on this function
    {
    //get NewsID 
    echo '<div class="headline">
               <a href="in_the_news.php?headlines='.$row['id'].'">'.$row['title'].'</a>
    	   <span class="date_of_article">'.date("m.d.y",strtotime($row['date'])).'</span>
    	   <p>'.$row['content'].'</p>
               </div>
            
    ';
    }
    }
    

     

    again, these problems arised when i updated my php version.

     

    Thank you

     

     

  7. Hi Guys,

     

    I have updated my latest version of PHP to 5.2.9 as I am about to upload my project to a host that uses that version.

     

    So i thought it be best to test the site locally as there could be some issuse.....

     

    When i went to the site i got a notice (i have error_reporting(E_ALL) )saying

     

    ------------------------------------------------------------------------------------

    Notice: Constant DB_USER already defined in C:\wamp\www\hallcrest\includes\mysqli_connect.php on line 9

     

    Notice: Constant DB_PASSWORD already defined in C:\wamp\www\hallcrest\includes\mysqli_connect.php on line 10

     

    Notice: Constant DB_HOST already defined in C:\wamp\www\hallcrest\includes\mysqli_connect.php on line 11

     

    Notice: Constant DB_NAME already defined in C:\wamp\www\hallcrest\includes\mysqli_connect.php on line 12

    ------------------------------------------------------------------------------------

     

    This never happened with the other php version i used, 5.2.1...

     

    Any help would be greatly appreicated...

     

    Thanks

     

  8. Hi guys,

     

    I've got a database full of members, and what i would like to do for my admin page is to have a paragraph that informs me with updated info.

     

    What i want to know, or if someone can direct me to a good tut, is have a script that reads the amount of members i a from my table and simply have it displayed as a number.

     

    over all this is what i want to achieve and the number in bold are driving by a script the present the data as a number.

     

    ---------------------

    We have 14 enquiries, 2 new ones from Darren Azzopardi

     

    We have recieved 7 feedback comments

     

    Only 2 people have had problems loggin in

    ----------------------

     

    kind regards

    Darren

  9. Hi,

     

    After reading the tut, i realised what headers are needed and then implement them. I need to go over it again for clarity but so far i have been successfull. Below is the script i am using;

     

    sendTo  =  "email@hotmail.com";
    $subject = "welcome";
    
    $headers  =  "From:$company_email \n ";
    $headers .= " $first_name $surname \r\n";
    $headers .= "Reply-To: $company_email \r\n";
    $headers .= "MIME-Version: 1.0\n"; 
    $headers .= "Content-type: text/html; charset=iso-8859-1\n"; 
    $message =
    "Hi Linda,
    This email is sent to you to inform you that <span style=\"font-weight:bold;\">$first_name $surname</span> has become a member.
    For more details please click <a href=\"http://www.mysite/bulletins/private/\">here to login</a>.
    
    From
    Administrator";
    
    mail($sendTo, $subject, $message, $headers);
    

     

    Kind regards

    Dazzclub

  10. I have a simple email script and i would like to put a link inside the body of the message, like click here or something, but im runin into trouble. As what appears is the actual code. I added the backward slash in the right places where quotes are found, but no luck.

     

     

    here is the script

    $sendTo  =  "my@email";
    $subject = "Thank you";
    
    $headers  =  "From:$company_email \n ";
    $headers .= " $first_name $surname \r\n";
    $headers .= "Reply-To: $company_email \r\n";
    $message =
    "Hi $member,
    
    This email is sent to you to inform you that <span style=\"font-weight:bold;\" >$first_name $surname</span> has become a member.
    For more details please click <a href=\"http://www.mysite.com/email/private/\">here to login</a>.
    
    From
    Administrator";
    
    mail($sendTo, $subject, $message, $headers);
    

     

    kind regards

    Dazzclub

  11. well here is the existing coding i am using;

    $query = "SELECT * FROM  contacts WHERE first_name LIKE \"%$search%\" OR surname LIKE  \"%$search%\" OR company_name LIKE  \"%$search%\" OR position LIKE \"%$search%\" ORDER BY id  DESC" . " LIMIT $offset, $rowsPerPage" ;
    

     

    i searching a table thats full of members, their name, where they live, you know the boring stuff. Well if i do type in dog in my search term in theory it shouldnt return anything, should it? As i have no members called dogs at all.

     

    kind regards

    Darren

  12. Hi guys,

     

    Ive come to the point of adding a search facility for my project. I've got one, but i think its a but loose. What i mean by this, if i type in dog, it will pull out everything that has d,o,g.

     

    would it be better to use match instead of like?

     

    if anyone has read useful search tutorials that they could post a link to, i would be most grateful.

     

    kind regards

    Darren

  13. Hi all, I have created a function that deletes a record by using ID, I am now trying to use this function in the link but im running into some trouble.

     

    Here is the function;

    //these functions on this page will be exported out to a function outsource when i get the time
    function delete_order(){
    if ( (isset($_GET['ID'])) && (is_numeric($_GET['ID'])) ) { //correctly accessed 
    $id=$_GET['ID']; 
    } else { 
    $errors[] = 'You have accessed this page incorrectly.'; 
    } 
    $query = "DELETE FROM order_enquiries WHERE id =$id";
    $return = mysql_query($query);
    echo "File ID $id has been removed from the database";
    } 
    
    

     

    and here is the link i am trying to put the function in;

    <a href=\"<?php echo delete_order(); ?>\" >DELETE CONTACT</a>
    

     

    kind regards

    Dazzclub

  14. hello back again, I was reading somewhere that innoDB, the way it handles auto incrementing columns can cause issues,

    "... it certainly does limit scalability."

     

    The problem is the members table. considering it has over 3 thousands users, this could the problem.

     

    So my plan of action is to change over (the table engine) innoDB to Myisam and see what comes of it.

     

     

     

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