Jump to content

DarkSuperHero

Members
  • Posts

    342
  • Joined

  • Last visited

Posts 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. Maybe you meant:"Is there a difference between a webdeveloper and a webdesigner?"

    [...]

    As for knowing a bit of both worlds, even though the webdeveloper and webdesigner play different roles, they both need to communicate with each other and it's a good thing when you both speak the same language.

     

    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... :-)

  4. 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...

  5. 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 ???

  6. 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...

  7. FYI, .NET is a framework, not a language.

    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?

  8. 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...

  9. 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});
    
    }
    
    

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