Jump to content

LeadingWebDev

Members
  • Posts

    79
  • Joined

  • Last visited

    Never

Posts posted by LeadingWebDev

  1. correct will be like that

    $query=mysql_query("SELECT * FROM `CES` WHERE `Name` IS NOT NULL");
    while($row = mysql_fetch_array($query)) {
    echo "<option value=\"$row[server]\">$row[Name]</option>";

     

    pay attention, you were chosen only Name from DB, where from you getting server?

    second thing SELECT * works faster that SELECT `row`, `row` etc...

    3rd, if you post name like ".$row[name]." its should be ".$row['name']." with quotes around index.

    you can also use inside double quotes ("...") as echo "<option value= \"$row[server]\"> $row[NAME]</option>"; and so you won't  quote index inside [].

    also row name must be exactly as inside db, if your column named NAME it should be $row[NAME], if name $row[name], etc... else you will have blank result and notice undefined index.

     

    sorry for soo bad english ^_^

  2. try this

    function
      create_dropdown($identifier,$pairs,$firstentry)
         {
             // start dropdown list with the <select> element and title
             $dropdown = "<select name=\"$identifier\" method=\"post\" onchange=\"showtemplate(this.value)\">";
             $dropdown .= "<option value=\"\">$firstentry</option>";
             
             // Create the elements for inside the drop down box
             foreach($pairs AS $value => $tempname)
             {
                 $dropdown .="<option value=\"$value\">$tempname</option>";
             }
             
             //end the dropdown function and return it as html
             echo "</select>";
             return $dropdown;
         }
          

     

  3. check

    $_FILES["field_name"]["tmp_name"] != "none"

     

    :shy:;)

    this should work, as if file not uploaded, tmp name by default will come "none", and not null =)

    also u can check filesize or name as u did before. name becomes null, size becomes 0

  4. look...

    this 1 is completely working on mimun-ishi.com

    $name = $fname." ".$lname; //senders name
    $tel = "$phone"; //senders phone
    $recipient = "mimun.ishi@gmail.com"; //recipient
    $rec_copy = "mimun.leads@gmail.com";
    $mail_body = "A new customer left his contact information for you to call him back \n";
    $mail_body .= "First Name: $fname \n";
    $mail_body .= "Last Name: $lname \n";
    $mail_body .= "Passport Number: $tz \n";
    $mail_body .= "Phone Number: $tel \n"; //mail body
    $subject = date("l d F Y")." New client want you to call him "; //subject
    $header = "From: ". $name . " <" . $tel . ">\r\n"; //optional headerfields
    
    //ini_set('sendmail_from', 'me@domain.com'); 
    
    mail($recipient, $subject, $mail_body, $header); //mail command 
    mail($rec_copy, $subject, $mail_body, $header); 

     

  5. Try this.

    also in Header(); use a full path to url.

     

    				<?php
    				if(isset($_SESSION['myusername'])) {
    				echo "
    						<form method='post' action='#Profile_comment'>
    							<table class='pro_addcomment'>
    								<tr>
    									<td class='pro_add_h' colspan='3'>Add a profile comment</td>
    								</tr>
    								<tr>
    									<td class='pro_add_text' colspan='2'>
    									<textarea name='profilecomment' class='pro_add_input'></textarea>
    									</td>
    									<td rowspan='2' class='pro_view_pic' valign='top'>
    									<img src='../Profile_pics/".$image."' style='width:50px; height:50px;' />
    									</td>
    								</tr>
    								<tr>
    									<td class='pro_add_max'>Max 200 characters</td>
    									<td class='pro_add_button'>
    									<input class='acc_alerts_accept' name='add_comment' type='submit' value='Add Comment' />
    									</td>
    								</tr>
    							</table>								
    						</form>
    						";
    
    						if(isset($_POST['add_comment'])){
    
    						include("config.php");
    
    						$Comment_user=$_GET['username'];
    						$Comment_sender=$_SESSION['myusername'];
    						$Comment_comment=$_POST['profilecomment'];
    						$Profile_picture=$_SESSION['myavatar'];
    
    						$sql="INSERT INTO biggartfp9_profile_comments_tempt (Comment_user, Comment_sender, Comment_date, Comment_content, Profile_picture)VALUES('$Comment_user','$Comment_sender',  NOW(),'$Comment_comment', '$Profile_picture')";
    						$result=mysql_query($sql);
    
    
    						if($result){
    						header("Location: profile.php?username=$Comment_user#Profile_comment");
    						}
    						else{
    						}
    
    				}
    				else{
    				echo"<h1 class=status_red>Please Login to submit a comment!</h1>";
    				}		
    
    			}
    			?>

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