Jump to content

raghu_tak

Members
  • Posts

    17
  • Joined

  • Last visited

About raghu_tak

  • Birthday 04/17/1993

Profile Information

  • Gender
    Male
  • Location
    Pune,Maharashtra
  • Interests
    Programming,Web development
    but sometimes did silly mistakes.
    lol
  • Age
    20

raghu_tak's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i have an array i want every element to be echoed but they should be echoed one by one with the gap of 3 second b/w them.
  2. Hello friends can anyone help me how to access array elements with some specific time. like if an array is defined $a with 3 elements in it. then o/p should be like that every element is echoed once for some second.then next element and then last. i am learning php so please help in php coding only. Thanks a lot Awaiting for your positive response.
  3. Hi friends I am trying to align a picture grabbed from database in right side within fieldset. but this is not working please help me in it friends. echo'<fieldset style="width:400;align=center;"><legend>Your Profile</legend>'; echo'<table>'; echo'<tr><td>Name: '.$row['firstname'].' '.$row['lastname'].'</td>'; if(!empty($row['picture'])) { echo'<td><img src=" '.upath.$pic.' " alt="Image not found" width="80" height="80" align="middle"></td></tr><br/>'; } else { echo'<td><img src="images1/nopic.jpg" alt="Image not found" width="80" height="80" align="middle"></td></tr><br/>'; }
  4. But following script causing another problem you see i get following errors Warning: move_uploaded_file() [function.move-uploaded-file]: The second argument to copy() function cannot be a directory in C:\xampp\htdocs\raghu\mismatch\edit.php on line 26 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\xampp\tmp\php121B.tmp' to 'images1/' in C:\xampp\htdocs\raghu\mismatch\edit.php on line 26 if(move_uploaded_file($_FILES['screenshot']['tmp_name'],$target)) { $query="SELECT * FROM mismatch_user WHERE user_id=$id1"; $result=mysqli_query($dbc,$query) or die('Error getting data'); if(mysqli_num_rows($result)==1) { $query1="UPDATE mismatch_user SET firstname='$fname', lastname='$lname', birthday='$bday',". "gender='$sex', country='$nation', picture='$screenshot' WHERE user_id='$id1'"; $result1=mysqli_query($dbc,$query1) or die('Error quering database'); echo'<br/><b>Profile Edited successfully</b>';
  5. hey thanks a lot it now updated i retried again and now this worked but i don't know what happened to it first time..lol Thanks a lot genius.
  6. i wrote this this session_start() in my script but nothing happened same output nothing. but when i write if(!isset($_SESSION['user_id'])) at place of if(isset($_SESSION['user_id'])) i got feedback 'profile updated successfully'. but when i saw my database nothing was updated.
  7. yes i have built a login system that redirects to edit page means current page but when we edit our information no data is updated in database and i have created a session using session_start(); so i didnt use it again in edit page because session_id is set now. i am attaching login script too please have a look on it too. loginx.php
  8. nothing is displayed just NULL is written on top left corner... why?
  9. Sorry but please explain what will var_dump will do and what it is?
  10. even this code not executed echo 'Form is submitted<br>';
  11. this is a file please see it once this code is get refreshed everytime when i click a submit button. edit.php
  12. friend i have did all this stuff but its not helping me
  13. friends,this is a code of head first php book it is used to edit a profile of user who has logged in but when i edit a profile the page displayed again with no feedback please help me friends!! <html> <head><title> Edit Profile </title></head> <body> <h1 style="color:brown;"><center>Please Edit your profile to find new mismatch.</center></h1> <form enctype="multipart/form-data" method="post" action="<?php echo$_SERVER['PHP_SELF']; ?>"> <p><i><center>This information would be seen by others and easily get connected to you.</center></i></p> <hr/> <img src="images1\mismatch.jpg" width="400" height="400" alt="mismatch image." align="right"> <fieldset style="width:250"> <legend>Edit your profile</legend> <table><tr> <td><label for="fname">Firstname:</label></td> <td><input type="text" id="fname" name="fname"><br/></td> </tr><tr> <td><label for="lname">Lastname:</label></td> <td><input type="text" id="lname" name="lname"><br/></td> </tr><tr> <td><label for="bday">Birthday:</label></td> <td><input type="text" id="bday" name="bday"><br/></td> </tr><tr> <td><label for="sex">Gender:</label></td> <td><input type="text" id="sex" name="sex"><br/></td> </tr><tr> <td><label for="nation">Country:</label></td> <td><input type="text" id="nation" name="nation"><br/></td> </tr><tr> <td><label for="screenshot">Picture:</label></td> <td><input type="file" name="screenshot" value="Choose image"><br/></td> </tr></table> </fieldset> <input type="submit" name="submit" value="Save"> <?php define('upath','mismatch/images1/'); define('msize',1024*50); if(isset($_SESSION['user_id'])) { $id1=$_SESSION['user_id']; if(isset($_POST['submit'])) { $dbc=mysqli_connect('localhost','root','','mismatch') or die('Error connceting database'); if((!empty($_POST['fname']))&&(!empty($_POST['lname']))&&(!empty($_POST['bday']))&& (!empty($_POST['sex']))&&(!empty($_POST['nation']))) { $fname=$_POST['fname']; $lname=$_POST['lname']; $bday=$_POST['bday']; $sex=$_POST['sex']; $nation=$_POST['nation']; if(!empty($_FILES['screenshot']['name'])) { $screenshot=$_FILES['screenshot']['name']; if(($_FILES['screenshot']['size']>0)&&($_FILES['screenshot']['size']<msize)) { $target=upath.$screesnhot; if(move_uploaded_file($_FILES['screenshot']['tmp_name'],$target)) { $query="SELECT * FROM mismatch_user WHERE user_id=$id1"; $result=mysqli_query($dbc,$query) or die('Error getting data'); if(mysqli_num_rows($result)==1) { $query1="UPDATE mismatch_user SET firstname='$fname', lastname='$lname', birthday='$bday',". "gender='$sex', country='$nation', picture='$screenshot' WHERE user_id='$id1'"; $result1=mysqli_query($dbc,$query1) or die('Error quering database'); echo'<br/><b>Profile Edited successfully</b>'; } } else { echo'<br/><b/>File cannot be uploaded'; } } else { echo'<br/><b/>Check size of Image.'; } } else { $query1="UPDATE mismatch_user SET firstname='$fname', lastname='$lname', birthday='$bday',". "gender='$sex', country='$nation' WHERE user_id='$id1'"; $result2=mysqli_query($dbc,$query2) or die('Error quering database'); echo'<br/><b>Profile Edited successfully</b>'; } } else { echo'<br/><b/>Please Enter all the information.'; } } } ?> </body></html>
×
×
  • 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.