Jump to content

dazz_club

Members
  • Posts

    103
  • Joined

  • Last visited

About dazz_club

  • Birthday 10/29/1982

Profile Information

  • Gender
    Male
  • Location
    Hull / Chester / Deeside / London

dazz_club's Achievements

Member

Member (2/5)

0

Reputation

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