Jump to content

Alidad

Members
  • Posts

    57
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Alidad's Achievements

Member

Member (2/5)

0

Reputation

  1. i put this code on the top of page <?php ini_set ("display_errors", "1"); error_reporting(E_ALL); ?> but still not showing any errors. any other idea of errors! please help thanks. AM
  2. hi, I tried to change update query from mysql to mysqli, at first under mysql is works great to update into mysql database but when i changed to mysqli is not doing update it. can anyone tell me what did i missed! under mysql <?php include('db.php'); if(isset($_GET['status'])) { $status1=$_GET['status']; $select=mysql_query("select * from manage where id='$status1'"); while($row=mysql_fetch_object($select)) { $status_var=$row->status; if($status_var=='0') { $status_state=1; } else { $status_state=0; } $update=mysql_query("update manage set status='$status_state' where id='$status1' "); if($update) { header("Location:index.php"); } else { echo mysql_error(); } } ?> <?php } ?> and under mysqli <?php include('db.php'); $dbcs = new mysqli($mysql_hostname, $mysql_user, $mysql_password, $mysql_database); if(isset($_GET['status'])) { $status1=$_GET['status']; $sql = "select * from product where product_id='$status1'"; $result=mysqli_query($dbcs,$sql); while($row=mysqli_fetch_object($result)) { $status_var=$row->status; if($status_var=='0') { $status_state=1; } else { $status_state=0; } $mysqli->query("UPDATE product set status='$status_state' where product_id='$status1' "); if($mysqli) { header("Location:item.php"); } else { echo mysqli_error(); } } ?> <?php } ?>
  3. hi, I'm kind of confused and rookie about the delete image file name from database, I have five images file name in database and store image file in the folder, each table column name is (image_1, image_2, images_3, image_4, image_5). In html , each image have delete button under bottom of image for up to five images. Let say that I want to delete 'image_3" by pressing button, how can i write that code to make sure that i can delete that images file name ONLY from database instead of delete rest of row! i wrote code but not sure working right... button <a href='inventory_list.php?deleteid=$id'>delete</a>
  4. here is what i wrote in database connection include("connect.php"); $query = "SELECT id, display FROM dragdrop"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $id = stripslashes($row['id']); $display = stripslashes($row['display']); ?> <li id="arrayorder_<?php echo $id ?>"><?php echo $id?> <?php echo $text; ?> and in body there is five box and each box has number one number from 1 to five. <ul class="nav"> <li><a href="#">Link one</a></li> <li><a href="#">Link two</a></li> <li><a href="#">Link three</a></li> <li><a href="#">Link four</a></li> </ul> <div id="options"> and in checkbox form each checkbox assign to box number and if any box has checkone meaning to display, of not check on meaning not to display <form action="" method="get"><input name="one" type="checkbox" value="one" /> one<br /> <input name="two" type="checkbox" value="two" /> two<br /> <input name="three" type="checkbox" value="three" /> three<br /> <input name="four" type="checkbox" value="four" /> three<br /> <input name="five" type="checkbox" value="five" /> three<br /> </form> anyway, I use ajax meaning that every time checkone or not it will automatic update in database right away and refereshe it which is works great, but to display or not to display is i can't figure out ... doe any one can help me! AM
  5. Hi, I'm rookie in php checkbox and I'm trying to understand how to write the code , i have five checkbox in one form like this <form action="" method="get"><input name="one" type="checkbox" value="one" /> one<br /> <input name="two" type="checkbox" value="two" /> two<br /> <input name="three" type="checkbox" value="three" /> three<br /> <input name="four" type="checkbox" value="four" /> three<br /> <input name="five" type="checkbox" value="five" /> three<br /> </form> if checkbox on then show the box, if checkbox is not check, then not show the box, so i understand that need to use zero or one in mysql database in one column called "display". My question is that how can i write the code in checkbox form whether if is zero or one, but how to write code to show DISPLAY OR NOT DISPLAY when reatrieve from mysql database EVEN USING CSS OR NOT. please help thanks. AM
  6. Hi, I'm rookie in php and i tried to figure out myself how to write that code. A new member signup as new member and send data value to mysql database name 'temp_member' table aand then admin will need for approval. if admin approve this is just press button to transfer data value from 'temp_member' table to other table name 'per_member'. my question is that how can i write that code to transfer profile information from table to other table like from 'temp_member' to 'per_member'. please help thanks. AM
  7. hi, I wrote code that allow me to create email account outside of cpanel and works greats with one domain name. However I'm trying to change code for two domains to select domain name using menu. The forms that i wrote is come with one text fields for input user name and one drop menu for select domain which is: <input name="username" size="20" /> <select name="domain_select" id="domain_select"> <option value="realdeafworld.com">domain1.com</option> <option value="realdeafway.com">domain2.com</option> </select> and then is sending data to other page which is config.php and $username = 'username'; // This variable is the cPanel username $password = 'password'; // Please enter your cPanel password $domain_name = 'domain1.com, domain2.com'; // Please enter the domain name associated with the account $domain_select = $domain_name; $skin = 'x3'; and then it will process to other page which is "http://$username:$password@$domain_name:2082/frontend/$skin/mail/doaddpop.html?email=$_POST[username]&domain=$domain_name&password=$_POST[password]&quota=25"); For some reason is not working right, event i put $domain_name = 'realdeafworld.com, realdeafway.com'; between two domain im getting result of domain1.com. i also changed the variable name to $domain_name = '$domain_select '; and still not working. Can anyone help me how can i solve this by select one domain name from menu before create email account! please help thanks. AM
  8. It has three open and closing braces. and still get same erros message did i missed any things! please help thanks. <?php //connect to database. Username and password need to be changed mysql_connect("localhost", "root", ""); //Select database, database_name needs to be changed mysql_select_db("images"); if (!$_POST['uploaded']){ //If nothing has been uploaded display the form ?> <form action="<? echo $_SERVER['PHP_SELF']; ?>" method="post" ENCTYPE="multipart/form-data"> Upload:<br><br> <input type="file" name="image"><br><br> <input type="hidden" name="uploaded" value="1"> <input type="submit" value="Upload"> </form> <? }else{ //if the form hasn't been submitted then: //from here onwards, we are copying the file to the directory you made earlier, so it can then be moved //into the database. The image is named after the persons IP address until it gets moved into the database //get users IP $ip=$REMOTE_ADDR; //don't continue if an image hasn't been uploaded if (!empty($image)){ //copy the image to directory copy($image, "./temporary/".$ip.""); //open the copied image, ready to encode into text to go into the database $filename1 = "./temporary/".$REMOTE_ADDR; $fp1 = fopen($filename1, "r"); //record the image contents into a variable $contents1 = fread($fp1, filesize($filename1)); //close the file fclose($fp1); //encode the image into text $encoded = chunk_split(base64_encode($contents1)); //insert information into the database mysql_query("INSERT INTO images (img,data)"."VALUES ('NULL', '$encoded')"); //delete the temporary file we made unlink($filename1); } //end } ?> </body> </html>
  9. Hi, I"m trying to create insert images files name into the database and save images in folder, however, after i created databse connection, and excuted it... I'm getting error message said Parse error: syntax error, unexpected $end in C:\xampp\htdocs\ourdeaf\uploadimages\upload.php on line 76 That line 76 is at end of code after </html>, what went wrong! <form action="<? echo $_SERVER['PHP_SELF']; ?>" method="post" ENCTYPE="multipart/form-data"> Upload:<br><br> <input type="file" name="image"><br><br> <input type="hidden" name="uploaded" value="1"> <input type="submit" value="Upload"> </form> <? }else{ //if the form hasn't been submitted then: //from here onwards, we are copying the file to the directory you made earlier, so it can then be moved //into the database. The image is named after the persons IP address until it gets moved into the database //get users IP $ip=$REMOTE_ADDR; //don't continue if an image hasn't been uploaded if (!empty($image)){ //copy the image to directory copy($image, "./temporary/".$ip.""); //open the copied image, ready to encode into text to go into the database $filename1 = "./temporary/".$REMOTE_ADDR; $fp1 = fopen($filename1, "r"); //record the image contents into a variable $contents1 = fread($fp1, filesize($filename1)); //close the file fclose($fp1); //encode the image into text $encoded = chunk_split(base64_encode($contents1)); //insert information into the database mysql_query("INSERT INTO images (img,data)"."VALUES ('NULL', '$encoded')"); //delete the temporary file we made unlink($filename1); } //end } ?>
  10. hi, I have trouble to retreive the images file path name from mysql database. I have created database and create insert file path name into the database, and images file in one of folder name images. My question is that how do i can write that code to retreive images from folder using files path name from database! AM
  11. i tried use this code different way by put people who signup the forms in registration.php page or log in in login.php page and then create weathr session cookies by showing on other page such as index.php page. However, I have tried this code by put seprate page, and is not sending any cookie and not showing weather infomration in index.php page after redirect to other page. I have tested weather code to make sure that the weather zip code are sending data but for some reason is not sending. please use testig code as testing and see can anyone help me how to create weather session from two different pages! <?php $error_message = 'Welcome!'; extract($_POST); //Extract $_POST Array into normal variables, like $zip if(isset($zip)){ //form actually entered? if( preg_match( '#^\d{5}$#', $zip) ){ //valid 5 digits zip? $error_message = 'good'; }else{ $error_message = 'not valid zip code'; } if($error_message == 'good'){ //here we get the weather from Yahooo echo 'Get Weather!'; exit(); //end script after show weather } } ?> <form method="post" action=""> <input type="text" name="zip" maxlength="5"> ZIP CODE 5 Digits (like: 12345)<br /> <input type="submit" name="zipsubmit" value="GET Weather"> </form> <?php echo $error_message; ?>
  12. do not show your database user name and password in forum, they could break into your data. Alidad
  13. cwarn23; thanks so much for your help, both way is works great for me, i just made some changed and works great. and now i'm learning both of them to see what does differents between (seesion and cookies). I have learned lots, is amazing. again thanks so much for your help, i appreication. AM
  14. cwarn23; thank you for your help, im still learning abou the session and cookies, other member ialsoagree who wrote about the session and cookie and he is helpfull too just like you. Due to my time enemy, i was wondering if there is chance that you can write code in cookie to so i can undersand both side of cookie and session myself to see what does differents thanks. AM
×
×
  • 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.