Jump to content

spires

Members
  • Posts

    492
  • Joined

  • Last visited

Everything posted by spires

  1. Just worked it out thanks. I created a hidden input field in the form called submit. This posted with the form, so I could check to see if submit exists. Thanks for your help
  2. OK, thanks for that. How can I then check to see if a form has been submitted using PHP? My Code: if (isset($_POST['submit'])){ } Thanks
  3. Hi I have found a solution. Not to sure why it works, but it does Place a comment in the div: <div id="outerHead"><!-- --></div> Thanks for your help anyway
  4. hi, thanks for your help. I copied the code and saved it into a file called: resetCSS.css I then added the line: @import url(resetCSS.css); to the top of my existing css code. However, this had no effect on the IE versions of my website. The 7px height DIVs were still about 10-12px high Am I doing something wrong? Thanks
  5. Hi. I have a graphic that I want to use instead of a standard input button to submit a form. The image works in every browser except IE6 (maybe later versions also) Is there anyway around this? Thanks <input name="submit" type="image" src="images/forms/bt_free_quote.jpg" id="inputButton" value="submit" />
  6. Hi I have a DIV set to height="7px" in every browser this works fine, but in IE6 the DIV is about 12px high. Is there any way around the issue? Thanks div#outerHead { position: relative; background-image:url(images/wrapper/top.jpg); height:7px; width:963px; }
  7. Thanks for your help guys. Thia is the final block of code. It was item_contract_length IN('','$clSearch') that I was after. $item_sql = "SELECT * FROM csv_item WHERE item_group='$iSearch' && item_network='$netSearch' && item_contract_length IN('','$clSearch') ORDER by item_internal_name ASC"; I needed to select both black AND month at the same time.
  8. Yes, I just tried. It either gives me '24 Month' OR 'blank' I need to be able to select both at once: '24 Month' AND 'blank' Any more ideas?
  9. Thanks for your help OR will not work. What i'm trying to do is; In the database there are 5 options in the column - '', '6 Month', '12 Month', '24 month', '36 Month' I have a dropdown list that has all of the options apart from the blank one. If the field is empty, I want it to select the selected option i.e 24 Month AND all rows that have a black field Other wise, all rows that are black will never show up in the list. Here is the full code: SELECT * FROM csv_item WHERE item_group='$iSearch' && item_network='$netSearch' && item_contract_length='' && item_contract_length='$clSearch' ORDER by item_internal_name AS Any more ideas would be a great help.
  10. Hi, I want to select all from my database where the months column is set to '24 Month' and also set to ''. SELECT * FROM csv_item WHERE item_contract_length='' && item_contract_length='24 Month' However, every time I try it, it just brings back no results, even though both of them work on there own. Any ideas please, as I really stuck. Thanks
  11. Hi I found a forum post to do with umask. So I gave it a go and it worked. I'm not to sure why it worked but it did. If anyone could explain what happened, that would be great $old_umask = umask(0); mkdir('pdffiles/'.$user, 0777, true); umask($old_mask);
  12. Hi I have just created a new directory using php: mkdir('pdffiles/'.$user, 0777, true); however, the permissions are still set to 0755 not 0777? So I have also tried the following: chmod('/var/www/html/businessmobiles.com/comcalc/pdffiles/'.$user', 0777); Which also as no effect. Any ideas why? Thanks
  13. Thanks you comment guys. It's been a great help
  14. Yeah sure, www.smartmac.co.uk the links in the navigation at the top. Safari only goes about 80% across FF goes about 90% across IE somewhere in between. Thanks
  15. Hi Guys, Getting everything to look right in all browser seems to be an increasingly difficult job. Currently, I am suck on trying to get the font to act the same in each browser. I'm using 'em' instead of 'px' and even tried '%', but can't seem to get it to work. FF, IE & safari all do something different. Is there a way of correcting this? Thanks for your help.
  16. Hi I am just starting build my first full CSS website. http://www.smartmac.co.uk/template.php I have managed to put the header together so far, but am having problems with the three columns within he main section. I have removed the left and right column for the moment to make my life easier. But I can't seem to be able to get the center column to react in the way I want it to. The div does not seem to acting as if it's inside of the outer div. This section of the code: <div id="outerBodyColumn"> <div id="titles"> <H1>Pay Per Click (PPC)</H1> <H2>Increase Your Sales! Get Your Business Onto The Front Page Of Google Using Pay-Per-Click Advertising. It's Now Fast & Easy</H2> </div> <!-- titles --> </div> Is in the center of the page, even though the CSS left: 0; Also, the main background (white) is not sitting around the background, it's only around the navigation. CSS Code: /* CSS Document */ body { background-color:#ebebeb; text-align:left; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; color:#222; line-height:16px; } h1 { font-family:Arial, Helvetica, sans-serif; margin:0; font-size:18px; color:#26a7e0; font-weight:normal; line-height:22px; } h2 { font-family:Arial, Helvetica, sans-serif; margin:0; font-size:16px; color:#333; font-weight:normal; line-height:20px; } img { border:none; } p { margin: 1ex 0; } p.first { text-indent: 2em; } h1.first { color:#333; text-indent: 2em; } /* ====== Class Selector ====== */ .first { text-indent: 2em; } .highlights { font-weight:bold; background-image:url(images/wrapper/navi_selected.jpg); } /* ====== Out Wrappers ====== */ div#outerHead { position: relative; background-image:url(images/wrapper/head.jpg); height:19px; width:1062px; } div#outerBody { position: relative; background-image:url(images/wrapper/bg.jpg); background-repeat:repeat-y; width:1062px; } div#outerBottom { position: relative; background-image:url(images/wrapper/bottom.jpg); height:17px; width:1062px; } /* ====== Header & Navi ====== */ #header { position: relative; height:136px; width:1062px; } #logo { position: absolute; background-image:url(images/wrapper/logo.jpg); background-repeat:no-repeat; width:212px; height:115px; margin:0; top:15px; left:30px; } #headTextLeft { position: absolute; width:300px; height:115px; top:15px; left:252px; text-align:left; font-family:Arial, Helvetica, sans-serif; margin:0; font-size:16px; color:#333; font-weight:normal; line-height:20px; } #headTextRight { position: absolute; width:348px; height:115px; top:15px; left:562px; text-align:right; font-family:Arial, Helvetica, sans-serif; margin:0; font-size:16px; color:#333; font-weight:normal; line-height:20px; } #headSecondImg { position: absolute; background-image:url(images/wrapper/header_image.jpg); background-repeat:no-repeat; width:112px; height:123px; margin:0; top:15px; left:920px; } /* ====== Main Menu ====== */ #header #mainNavi { position: absolute; background-image:url(images/wrapper/main_navi.jpg); background-repeat:no-repeat; padding-left:24px; left:30px; top: 140px; height:38px; width:979px; z-index:1; } #mainNavi ul { line-style: none; list-style-type: none; margin: 0; padding: 0; } #mainNavi li { float:left; margin-left:0; padding: 0; } #mainNavi li a:link, #mainNavi li a:visited { font-family:Verdana, Arial, Helvetica, sans-serif; display:block; padding: 0 17px 0 17px; margin:0; font-size:12px; color:#fff; font-weight:normal; text-decoration:none; line-height:38px; background-image:url(images/wrapper/navi_bg.jpg); background-repeat:no-repeat; border:none; } #mainNavi li a:hover, #mainNavi li a:active { background-image:url(images/wrapper/navi_rollOver.jpg); background-repeat:no-repeat; border:none; } #mainNavi li a.current { background-image:url(images/wrapper/navi_selected.jpg); background-repeat:repeat-x; border:none; } #mainNavi li a.current:hover { cursor:default; } .verticalLineMain { padding: 0; margin:0; font-size:20px; color:#fff; font-weight:normal; text-decoration:none; line-height:28px; vertical-align:sub; } /* ====== Sub Navi ====== */ #header #subNavi { position: absolute; left:30px; top: 178px; background-image:url(images/wrapper/navi_2nd.jpg); background-repeat:no-repeat; padding-left:20px; height:28px; width:983px; z-index:1; } #subNavi ul { line-style: none; list-style-type: none; margin: 0; padding: 0; } #subNavi li { float:left; margin-left:0; padding: 0; } #subNavi li a:link, #subNavi li a:visited { font-family:Verdana, Arial, Helvetica, sans-serif; display:block; padding: 0 8px 0 8px; margin:0; font-size:10px; color:#fff; font-weight:normal; text-decoration:none; line-height:28px; } #subNavi li a:hover, #subNavi li a:active { color:#CCC; } .verticalLine { padding: 0; margin:0; font-size:10px; color:#fff; font-weight:normal; text-decoration:none; line-height:28px; vertical-align:middle; } /* ====== 3 Columns ====== */ div#outerBodyColumn { position: relative; width:598px; top:100px; left:0; } /* ====== Main Body Content ====== */ #outerBodyColumn div#titles { float:left; width:598px; margin:0; padding:0; } #titles { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; color:#222; line-height:16px; } /* ====== Banners ====== */ /* ====== Classes ====== */ .2ndColour15 { font-family:Arial, Helvetica, sans-serif; margin:0; text-align:left; font-size:16px; color:#26a7e0; font-weight:normal; line-height:20px; } /* ====== Miscellaneous Styles ====== */ .clear { clear:both; } HTML Code: <div id="outerHead"></div> <div id="outerBody"> <div id="header" align="center"> <div id="logo"></div> <div id="headTextLeft"><br />Online Marketing Experts<br /> For Businesses That Want The Best</div> <div id="headTextRight"><br />We're PPC Experts<br />Free Quote - Call Today On: <span class="2ndColour15">0208 9085088</span></div> <div id="headSecondImg"></div> <div id="mainNavi"> <ul> <li><a href="#">What We Do</a></li> <li><a href="#">Web Design</a></li> <li><a href="#" class="current">Pay Per Click</a></li> <li><a href="#">SEO</a></li> <li><a href="#">Online Videos</a></li> <li><a href="#">Training Courses</a></li> <li><a href="#">Why Choose Us</a></li> <li><a href="#">Contact Us</a></li> <li><a href="#">About Us</a></li> </ul> </div> <div id="subNavi"> <ul> <li><a href="#">Pay Per Click Management</a></li> <li class="verticalLine">|</li> <li><a href="#">Advanced PPC Campaigns</a></li> <li class="verticalLine">|</li> <li><a href="#">What is Pay Per Click</a></li> <li class="verticalLine">|</li> <li><a href="#">How Does PPC Wprk</a></li> <li class="verticalLine">|</li> <li><a href="#">Benefits Of PPC Campaigns</a></li> <li class="verticalLine">|</li> <li><a href="#">Why Choose Us</a></li> <li class="verticalLine">|</li> <li><a href="#">Training & Consultancy</a></li> </ul> </div> </div> <!-- hreader --> <div id="outerBodyColumn"> <div id="titles"> <H1>Pay Per Click (PPC)</H1> <H2>Increase Your Sales! Get Your Business Onto The Front Page Of Google Using Pay-Per-Click Advertising. It's Now Fast & Easy</H2> </div> <!-- titles --> </div> <P class="clear"> </div> <!-- outerBody --> <div id="outerBottom"></div> Any help would be much appreciated.
  17. Hi guys. I am getting an error: Parse error: syntax error, unexpected T_PUBLIC in /var/www/html/businessmobiles.com/OOP/photo_gallery/includes/user.php on line 103 But, I can't see anything wrong with my code. I'm hoping that a fresh pair of eye would do the trick. My code (HTML page) <?php $user = new User(); $user->username = "johnsmith"; $user->password = "abcd12345"; $user->first_name = "John"; $user->last_name = "Smith"; $user->create(); ?> My code (Function being called) public function create() { global $database; $sql = "INSERT INTO photo_gallery_users ("; $sql .= "username, password, first_name, last_name"; $sql .= ") VALUES ('"; $sql .= $database->escape_value($this->username) ."', '"; $sql .= $database->escape_value($this->password) ."', '"; $sql .= $database->escape_value($this->first_name) ."', '"; $sql .= $database->escape_value($this->last_name) ."')"; if ($database->query($sql)) { $this->id = $database->insert_id(); return true; } else { return false; } } line 103 is - public function create() { Thanks for any help.
  18. Hi guys, I'm trying to change the permissions of a file on my server using PHP. I'm on a Linux server. The file is currently 0644 and I'm trying to change it to 0777. chmod('file_permissions.php', 0777); echo substr(decoct(fileperms('file_permissions.php')), 2); However, it's still echoing out 0644. I've even checked the file permissions on the server and they are still 0644 also. Any ideas? Thanks
  19. Whoo hoo I've got it, thanks everyone for all your help, I couldn't have done it without you Error: I was using different variable names than the database names. public $photo_id; public $photo_user; public $photo_pass; public $photo_Fname; public $photo_Lname; Thanks once again.
  20. Hi Thanks for all your help. I've posted the full code for the page below. I think it could be something to with the database name are different to the object names, but i'm not to sure how to get around that other than changing the database. Full Code: <?PHP // Users Class require_once('database.php'); class User { public $id; public $username; public $password; public $first_name; public $last_name; public static function find_all() { return self::find_by_sql("SELECT * FROM photo_gallery_users"); } public static function find_by_id($id=0) { $result_array = self::find_by_sql("SELECT * FROM photo_gallery_users WHERE photo_id={$id}"); return !empty($result_array) ? array_shift($result_array) : false; } public static function find_by_sql($sql="") { global $database; $result_set = $database->query($sql); $object_array = array(); while ($row = $database->fetch_array($result_set)) { $object_array[] = self::instantiate($row); } return $object_array; } public function full_name() { if(isset($this->first_name) && isset($this->last_name)) { return $this->first_name . " " . $this->last_name; } else { return ""; } } private static function instantiate($record) { // Could check that $record exists and is an array $object = new self(); // Simple, long-form approach: /*$object->id = $record['photo_id']; $object->username = $record['photo_user']; $object->password = $record['photo_pass']; $object->first_name = $record['photo_Fname']; $object->last_name = $record['photo_Lname'];*/ //echo $record['photo_id']; // More dynamic, short-form approach: foreach($record as $attribute=>$value){ $object->$attribute = $value; } return $object; } private function has_attribute($attribute) { // get_object_vars returns an associative array with all attributes // (incl. private ones!) as the keys and their current values as the value $object_vars = get_object_vars($this); // We don't care about the value, we just want to know if the key exists // Will return true or false return array_key_exists($attribute, $object_vars); } } ?> Any more help would be great, I was getting right in to OOP untill I came across this bug. Thanks
  21. Hi, has_attribute() is just to check to see if it has an attribute. I'm not to sure why the video have done it this way, but below is the comments that he made about this section. // We don't care about the value, we just want to know if the key exists // Will return true or false If I remove 'if($object->has_attribute($attribute)) {' It still does not return the values. However, if you check out the var dump now, it is also show an extra array that has one row of the database values showing. Not to sure why that is? var dump: array(2) { [0]=> object(User)#3 (15) { ["id"]=> NULL ["username"]=> NULL ["password"]=> NULL ["first_name"]=> NULL ["last_name"]=> NULL ["0"]=> string(1) "1" ["photo_id"]=> string(1) "1" ["1"]=> string(6) "spires" ["photo_user"]=> string(6) "spires" ["2"]=> string(7) "ss165le" ["photo_pass"]=> string(7) "ss165le" ["3"]=> string(4) "Jeff" ["photo_Fname"]=> string(4) "Jeff" ["4"]=> string(6) "Spires" ["photo_Lname"]=> string(6) "Spires" } [1]=> object(User)#4 (15) { ["id"]=> NULL ["username"]=> NULL ["password"]=> NULL ["first_name"]=> NULL ["last_name"]=> NULL ["0"]=> string(1) "6" ["photo_id"]=> string(1) "6" ["1"]=> string(7) "livesey" ["photo_user"]=> string(7) "livesey" ["2"]=> string(7) "ss165le" ["photo_pass"]=> string(7) "ss165le" ["3"]=> string(4) "Tina" ["photo_Fname"]=> string(4) "Tina" ["4"]=> string(7) "Livesey" ["photo_Lname"]=> string(7) "Livesey" } } As you can see, they are all NULL till to gets to the end. Any ideas? Thanks
  22. Hi I am currently learning OOP, I am going through a training video but have come across a bug. I would be great if someone could point me in the right direction so I can continue my training. $record has been given it's value in another function. $record: $row = mysql_fetch_array($result_set); Now for the bug: private static function instantiate($record) { $object = new self(); foreach($record as $attribute=>$value){ if($object->has_attribute($attribute)) { echo 1; $object->$attribute = $value; } else { echo 2; } } return $object; } private function has_attribute($attribute) { $object_vars = get_object_vars($this); return array_key_exists($attribute, $object_vars); } What's going wrong is the foreach loop echo's out 2, which means it is returning false. However, this works fine: private static function instantiate($record) { $object = new self(); $object->id = $record['photo_id']; $object->username = $record['photo_user']; $object->password = $record['photo_pass']; $object->first_name = $record['photo_Fname']; $object->last_name = $record['photo_Lname']; return $object; } Why will it not loop through and place the values inside the object? I can't see what's wrong, the code is exact to the training videos code. Here is the web page: http://www.businessmobiles.com/OOP/photo_gallery/public/user3.php As you can see, I'm doing a var dump, but every value is NULL. Any pointers would be much appreciated
  23. Hi guys. I'm doing a a simple equation, all I want to do is add to value together. However, instead of adding the are concatenating. Both value are numeric so it should work fine, when I replace the variable with a static numeric number it works fine. but when I use the variable it keeps concatenating. Any ideas? My Code: var joinedProduct=productarray[1]+productarray[2]; alert(joinedProduct); productarray[1] = 60 productarray[2] = 60 output = 6060 not = 120 Thanks
  24. Excellent, first one is working 2nd var dump: resource( of type (mysql result)
×
×
  • 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.