Jump to content

DarkSuperHero

Members
  • Posts

    342
  • Joined

  • Last visited

Everything posted by DarkSuperHero

  1. Your code is littered with extra empty else statements....try to make your code easier to read, it makes it easier for people to want to help.... Looks like you may have figured out your problem.... No changes to your original code other than cosmetic <?php $staffQuery = mysqli_query($staffConnected, "SELECT `name`, `email`, `department`, `position` FROM `staff` WHERE `class`=2 ORDER BY `department`, `name` ASC") if($staffQuery){ $rowNum=1; $cellNum=0; $amountOfStaffReturned=mysqli_num_rows($staffQuery); if($amountOfStaffReturned>0){ $departmentHeader=false; $content.='<div class="emailHeader">Staff Contacts</div>'; while($staff=mysqli_fetch_array($staffQuery, MYSQLI_ASSOC)) { $staffName=$staff['name']; $staffEmail=$staff['email']; $staffDepartment=$staff['department']; $staffPosition=$staff['position']; $rowName=rowName($rowNum); if($rowNum>1){ $rowEmailClassAdd=' emailRow'; } else { $rowEmailClassAdd=''; } if($cellNum%2==0){ if($departmentHeader!=$staffDepartment) { $content.='<div class="departmentHeader">'.$staffDepartment.'</div>'; $departmentHeader=$staffDepartment; } if($cellNum != 0){ $content.='</div>'; } $content.='<div class="overflowclear'.$rowEmailClassAdd.'" id="emailStaff'.ucfirst($rowName).'Row">'; $rowNum++; } $content .='<div class="emailCell"> <div class="emailTitle">'.$staffName.'</div> <div class="emailSubTitle">'.$staffPosition.'</div> <div><a class="contactemail" href="mailto:'.$staffEmail.'">'.escapeemail($staffEmail).'</a></div> </div>'; if($amountOfStaffReturned%2 != 0 && $cellNum+1 == $amountOfStaffReturned) { $content.='<div class="emailCell"> </div> </div>'; } $cellNum++; } //end while } }
  2. <?php $pizzaS['slice1']='meat'; $pizzaS['slice2']='meat'; $pizzaS['slice3']='meat'; $pizzaS['slice4']='veg'; $pizzaS['slice5']='veg'; $pizzaS['slice6']='veg'; $pizzaS['slice7']='veg'; $pizzaS['slice8']='meat'; foreach($pizzaS as $key=>$value){ if($value== "meat"){ // This line needed to have `meat` in quotes echo "I'll take that slice<br/>"; } else { echo "You can have that one<br/>"; } } //original snippet missing closing brace ?>
  3. datePieces = explode("2010-01-02", "-"); dateDesired = datePieces[2] .".".datePieces[1] .".".datePieces[0] ."."; echo(dateDesired); Something of that sort should do the trick also
  4. I must say I agree with this and other thing said here also, at the moment, Im teamed up with a designer who creates the clients vision, and I bring it to life through PHP/HTML/CSS and sometimes flash... its definitely important to be able to do more than just one thing.... Going on what Dj Kat said, what is the motivation that you hold for learning PHP ? I recall my very first attempt at PHP was because I hated having to hardcode all the pages in HTML...hahahaha...although it soon evolved into much more... :-)
  5. since this is more of js problem whats the gerated source look like after php's been parsed and all the variables have been echoed?
  6. im very lost in the code, Are you using jQuery? php? plain javascript with method you created?
  7. I agreee with chmpdog, PHP is practically Best friends for life with HTML, although it can do without it, the only reason someone would need to hire a php person, would be to use them on a project based for the web. Unless your doing programming from scratch like building a framework ect. your going to need some HTML knoledge, since sometimes they can both be mixed in depending on the programmers style...
  8. think of it this way.... PHP FILE 1 RUN RUN RUN RUN PHP FILE 2 INCLUDED RUN RUN RUN BACKTO FILE 1 RUN RUN RUN RUN RUN EOF; hope that small diagram makes you see something, but that how php includes work...is that what your looking for ???
  9. div#container { margin-left: 50px; margin-right: 50px; margin-top: 50px; } div#header { margin-right: 0px; background-color: #CCC; } div#header p { padding: 0px; text-align: right; padding-right: 5px; } div#header p a { color: #a00000; text-decoration: none; } div#header p a:hover { color: #000; text-decoration: underline; } #content { float:right; width:82%; paddin-left:15px; margin-top: 15px; min-width:600px; background-color: #CCC; padding:0px; } div#nav { float:left; text-align: left; width: 15%; min-width:200px; background-color: #CCC; margin-top: 15px; padding:0px; } div#nav a { color: #a00000; text-decoration: none; } div#nav a:hover { color: #000000; text-decoration: underline; } div#nav h3 { padding-top: 0px; margin-top: 0px; padding-bottom: 3px; margin-bottom: 3px; } a { color: #a00000; text-decoration: none; } a:hover { color: #000; text-decoration: underline; } try that out, although it might not be exctly what your looking for....i would suggest looking into positioning things absolutly....and the page it too wide on my screen.... 1600pixels wide...so i would prolly not stay on your page too long if it was a done site...
  10. <?=$minpay?> to '. $minpay .' Read up on some syntax, specially concatenating and single vs double quotes
  11. very common mistake, I did not know what .net was till i began picking up c#... Anyways on topic... How about how PHP has transformed and the direction it might be heading PHP-GTK ? i donno.. What about php intrest you the most?
  12. also, you could remove the login check if you want it to appear the same to all user i suppose...
  13. works fine for me on chrome(MORE OF A ZOOM rather than a text enlarge) and IE6 (ie6 text doesnt change size)... What browser are you using ?
  14. you can probably find answers to many of your command line questions here: http://technet.microsoft.com/en-us/library/cc778084.aspx
  15. try... //Javascript: setTimeout(setHeight('id ', 'dec', objHeight[id]),(timer * speed)); I suspect it was the quotes around the function....
  16. you need to rethinking your if statements one of hem is echoing false, and not echoing the top half of your source which includes your linkage to the css u specified.
  17. If i understand correctly look into SWFAddress (comes in AJAX Flavor)....it uses JS and html anchor links to create a deep-linked page... a url like this: http://www.asual.com/swfaddress/samples/ajax/#/history/ get it here: http://www.asual.com/swfaddress/
  18. what does your curl script look like so far ? and whats the url your trying to get into? Possible Reasons for people not replying might be that they want to see code (you making an attempt) and maybe even the URL of the page you might be trying to cURL.....because without either, its almost like asking someone to write code from scratch for you for a URL we dont even know... I'm willing to help you out because im a bit intrigued by cURL....we can figure this out...if your up for it...
  19. i say we mark it unsolvable.....hes not being receptive to our suggestion, nor is he providing more detail on how it does not load..... i give this one up...
  20. reg ex is the real powerhouse behind this solution.... PHP could have done this in a very similar fashion, using file(); and then preg_match(); .... but yeah def solved now i feel... I would post a php script but im short on time right now... Cheers!
  21. how much JS do you know ? See the comments below for a suggested solutions function saveChanges(obj){ var new_content = escape($F(obj.id+'_edit')); obj.innerHTML = "Saving..."; cleanUp(obj, true); var success = function(t){editComplete(t, obj);} var failure = function(t){editFailed(t, obj);} var url = 'edit.php'; //this variable holds your parameters, the ones being sent to PHP script... //Modify this and you should be good to go...just concatenate the parameters & values you need to this line var pars = 'id='+obj.id+'&content='+new_content; //this line// var myAjax = new Ajax.Request(url, {method:'post', postBody:pars, onSuccess:success, onFailure:failure}); }
  22. I agree with all the points before mine, also i got felt your 3 pages are a bit disconnected....the copyright/blog(articles)/ and index...navigation is not consistent..... also on your index page your home button links to: http://www.purencool.com/index.html which is a broken link for me...
  23. Suggestion: SWFObject - http://code.google.com/p/swfobject/ (Thanks to haku suggestion) Help: What about your flash doesnt work ? Does it not show? does not load? does not embed object properly? are the paths correct? how big is the swf file?
×
×
  • 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.