Jump to content

dazz_club

Members
  • Posts

    103
  • Joined

  • Last visited

Everything 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 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. Thanks teamatomic for your help. I'll get onto this and post the full script, so it may help others. Again, thank you.
  5. 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
  6. 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
  7. ...ok thank you for letting me know and thank you guys for all your help, very much appreciated.
  8. 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
  9. 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
  10. o right, thanks dude, really appreciate you coming back on this one.
  11. pardon my stupidity but whats a heredoc, are you pointing to where i should start the body of the message. So remove the line so it looks like this, $message="blah blah........"; kind regards Dazzclub
  12. Done some tweaking to the code. Snow the code looks like this. <?php $sql = mysql_query("SELECT * FROM contacts"); $num_rows = mysql_num_rows($sql); echo "$num_rows Rows\n"; ?> and it works...well need to double check but its good for me
  13. hmm could be that i have selected the contacts row rather than the data in that field. could be..... *note to Dazzclub, look closer der brain.
  14. Hi , I have set up a basic query, but i think i missing something as my result only retrieves 1 <?php $sql = "SELECT COUNT(*) FROM contacts"; $result = mysql_query($sql); echo mysql_num_rows($result); ?> kind regards Dazzclub
  15. Cheers Yesideez I will work on these and get back to you guys with my progress.
  16. 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
  17. 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
  18. Hi Lol, i know, just come back rom read a tut on sitepoint. cheers for the link aswell
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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.