Jump to content

IlaminiAyebatonyeDagogo

Members
  • Posts

    64
  • Joined

  • Last visited

Everything posted by IlaminiAyebatonyeDagogo

  1. ohh can also use google as well to get more tutorials
  2. good day i think what you need is a tutorial on how to do this. A video tutorial will do the magic just copy this link This other part is an advance tutorial from tutorialzine Advance tutorial From tutorialZine Hope this helps
  3. yoo! Boss You are good alaways getting my back I love you. And i mean it thank you phpfreak for Ch0cu3r
  4. try echoing out the value of $add_point then kill the script. If you get your required result then check your pdo query over again if it dosen't then try declearing your company variable in this same file i think it is returning empty ie the company variable also redeclear the company variable here in this script i think the conditional statement is runing into an empty condition ie the company variable
  5. Hello everyone I need your assitance a great deal, so I have a form which i submitted to a php file throug ajax and jquery. It is working A ok but I want to be able to submit it with javascript instead, so i don't load any lib. And it is now a problem. The method I use to get the form field names and values in jquery is so simple and dynamic hence if changes are made on the html form i don't have to edit my jquery file to effect the change ie in respect to changing the name of the fields or adding more fields. But I don't know to archieve this using javascript. So i want to post my jquery script, for you all my mighty programmers to assist me get a javascript Clone for me, thank you very much for Helping Jquery file $("form.ajax").on("submit", function(){ var that= $(this); that.find('[name]').each(function(index,value){ var that = $(this), name =that.attr('name'), value =that.val(); data[name]=value; }); return false;}); Now the above code is just my major focus of the script. What it does is that select the form with an ajax class attribute and run a function after the user submits the form. The var that get reference to the above form throug the (this) reference. Next i use find fuction to look through out the open and close of our form.ajax form for any element that has the name attribute and set it into array using the .each(function (index,value){}) this is my main focus how to ilterate through the form looking for name attribute and set my finding into array using javascript. The next that var reference to the find statement and then we steal the name attribute and value from our findings and set an array called data with the stolen name variable as its index n value attribute as its value. Thank you once more my aim again is with the find and array setting statement.
  6. could you please point me to web page where i get tutorials for ajax beginers
  7. I have a form, that is a chat apps am building for project. Now everything seems to be working fine to the best of my ability. I want to submit the data from the form into my php script without any form of reload. That means i don't want redirection, to the action page and back to the chat page. What i want is for the page to submit the form at the background. And i know i need ajax to this bt i cnt get it right. Here is my form <form method="post" id='chatbox' action="reply.php"> <input type="text" id="text" name="adchat"/> <input type='hidden' id='user_id' name='id' value='1'> <input type='hidden' id='user_name' name='id' value='Ben'> <input type='submit' id='submit' name='chat' value='send'></form> What i need is an ajax code to submit d variable to the reply.php scrit and maybe a message to display when the form it been submitted say something like (sending...). Thanks for assiting. Pls i don't know anything when it comes to AJAX. Please forgive me and help me. Don't borther about displaying the user input just make it submit it to the php script. Thank you once again.
  8. the tables contain a id auto increment field as index, a username field varchar, a body longtext field to store post, a subject field longtext as well
  9. Please i assistance in selecting the last 8 inserted value into a database. For instance I want to select the last 8 post insterted into database *test* table *forum * field (*). Explaing : what i need is the mysql or mysqlite code to select the last 8 value in database test table forum and all the data we have in that field. Thank you all in advance
  10. av any 1 eva remove powered by codologic in freichat plz show me how did it
  11. thanks all it z working perfectly well cn u teach hw to remove the powered by codologic
  12. yes 2 all i pass the user sesion with the var session id and i declare a session start
  13. I have done that create a session with the id and nothing is working code <?php $ses = null; if(isset($_SESSION['id'])) { if($_SESSION['id'] != null) // Here null is guest { $ses=$_SESSION['id']; //LOOK, now userid will be passed to FreiChat } } if(!function_exists("FreiChatx_get_hash")) { function FreiChatx_get_hash($ses){//And the rest of the code as it is . . if(is_file("C:/wamp/www/Dagogo_temp/freichat/hardcode.php")){ require "C:/wamp/www/Dagogo_temp/freichat/hardcode.php"; $temp_id = $ses . $uid; return md5($temp_id); } else { echo "<script>alert('module freichatx says: hardcode.php file not found!');</script>"; } return 0; } } ?> <script type="text/javascript" language="javascipt"src="http://localhost/Dagogo_temp/freichat/client/main.php?id=<?php echo $ses;?>&xhash=<?php echo freichatx_get_hash($ses); ?>"></script> <link rel="stylesheet" href="http://localhost/Dagogo_temp/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css">
  14. Is not working at all i add the session start <?php session_start(); $ses = null; // Return null if user is not logged in if(isset($_SESSION['username'])) { if($_SESSION['username'] != null) // Here null is guest { $ses=$_SESSION['username']; //LOOK, now userid will be passed to FreiChat } } if(!function_exists("FreiChatx_get_hash")) { function FreiChatx_get_hash($ses){//And the rest of the code as it is . . if(is_file("C:/wamp/www/Dagogo_temp/freichat/hardcode.php")){ require "C:/wamp/www/Dagogo_temp/freichat/hardcode.php"; $temp_id = $ses . $uid; return md5($temp_id); } else { echo "<script>alert('module freichatx says: hardcode.php file not found!');</script>"; } return 0; } } ?> <script type="text/javascript" language="javascipt"src="http://localhost/Dagogo_temp/freichat/client/main.php?id=<?php echo $ses;?>&xhash=<?php echo freichatx_get_hash($ses); ?>"></script> <link rel="stylesheet" href="http://localhost/Dagogo_temp/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css"> <!--===========================FreiChatX=======END=========================-->
  15. I have a website that i integrate a chat app into it (FREICHAT ) now i wanted to make the user that log in to my the site to chat with user name, according to freichat this idea is 100% possible and they have solution for it. I have done all the want me to do but it is not working, so i came meet my gurus to please help me out below are my code. <?php $ses = null; // Return null if user is not logged in if(isset($_SESSION['username'])) { if($_SESSION['username'] != null) // Here null is guest { $ses=$_SESSION['username']; //LOOK, now userid will be passed to FreiChat } } if(!function_exists("FreiChatx_get_hash")) { function FreiChatx_get_hash($ses){//And the rest of the code as it is . . if(is_file("C:/wamp/www/Dagogo_temp/freichat/hardcode.php")){ require "C:/wamp/www/Dagogo_temp/freichat/hardcode.php"; $temp_id = $ses . $uid; return md5($temp_id); } else { echo "<script>alert('module freichatx says: hardcode.php file not found!');</script>"; } return 0; } } ?> <script type="text/javascript" language="javascipt"src="http://localhost/Dagogo_temp/freichat/client/main.php?id=<?php echo $ses;?>&xhash=<?php echo freichatx_get_hash($ses); ?>"></script> <link rel="stylesheet" href="http://localhost/Dagogo_temp/freichat/client/jquery/freichat_themes/freichatcss.php" type="text/css"> <!--===========================FreiChatX=======END=========================--> the next file i change is the hardcore.php <?php /* Data base details */ $con = 'mysql'; // MySQL , Oracle , SQLite , PostgreSQL $username='root'; // Database username $password=''; //Database password $client_db_name='online'; //Database name $host='localhost'; //host $port=''; //optional port for some servers using different port $driver='Custom'; //Integration driver $db_prefix=''; //prefix used for tables in database $uid='52b2c4244f15f'; //Any random unique number $PATH = 'freichat/'; // Use this only if you have placed the freichat folder somewhere else $installed=true; //make it false if you want to reinstall freichat $admin_pswd='adminpass'; //backend password $debug = false; /* email plugin */ $smtp_username = ''; $smtp_password = ''; /* Custom driver */ $usertable='users'; //specifies the name of the table in which your user information is stored. $row_username='username'; //specifies the name of the field in which the user's name/display name is stored. $row_userid='id'; //specifies the name of the field in which the user's id is stored (usually id or userid) $avatar_field_name = 'avatar'; Please help me out
  16. I have a script to upload image to a folder and store image name in the database but there seems to be something wrong with my scripting and me please some one help me out. <?php //start a session for error reporting. session_start(); //call our connection file. require("include/conn.php"); // check to see if the type of file uploaded is valid image type. function is_valid_type($file) { //This is an array that holds the valid image MIME Types $valid_types=array("image/jpg","image/gif","image/png","image/swf","image/jpeg","image/x-ms-bmp","image/x-png"); if (in_array($file["type"],$valid_types)) return 1; return 0; } //just a short function that print out the content of an array in mannerthat is easy to read // set some constants //this variable is the part to the image folder where all the images are going to be stored //Note that there is trailing forward slash $target_path="upload_images/"; //Get our Posted variables $name=$_POST["name"]; $phone=$_POST["phone"]; $address=$_POST["address"]; $email=$_POST["email"]; $username=$_POST["username"]; $password=$_POST["password"]; $pin=$_POST["pin"]; $family=$_POST["family"]; $image=$_FILES["image"]; //***sanitizing our inputs // $name=mysql_real_escape_string($name); $name=stripslashes($name); // end sanitizing name input $phone=mysql_real_escape_string($phone); $phone=stripslashes($phone); // end sanitizing phone input $address=mysql_real_escape_string($address); $address=stripslashes($address); // end sanitizing address input $email=mysql_real_escape_string($email); $email=stripslashes($email); // end sanitizing $email input $username=mysql_real_escape_string($username); $username=stripslashes($username); // end sanitizing username input $password=mysql_real_escape_string($password); $password=stripslashes($password); // end sanitizing password input $pin=mysql_real_escape_string($pin); $pin=stripslashes($pin); // end sanitizing pin input $family=mysql_real_escape_string($family); $family=stripslashes($family); // end sanitizing family input $image['name']=mysql_real_escape_string($image['name']); $image['name']=stripslashes($image['name']); // end sanitizing image name input //Build our target path full string. this is where the filewill be moved to. $target_path.=$image['name']; // make sure all the fields are entered if (empty($name)||empty($phone)||empty($address)||empty($email)||empty($username)||empty($password)||empty($pin)||empty($family)||empty($image["name"])) { $_SESSION["error"]="All Fields Are Required"; header("location:register.php"); exit; } //check to make sure that our file is actually an image //we check the file type instead of the extension because the extension can easily be faked. if(is_valid_type($image)==False) { $_SESSION["error"]="You Must Upload a Jpeg,gif,png,swf or jpg image file "; header("location:register.php"); exit; } // here we check to see if a file with that name already exists and we rename it //we just rename all file $rand=rand(0,9999999999); $new_image=$rand.$image["name"]; if(file_exists($target_path)) {$_SESSION["error"]="Please Rename Your Image And Try Again "; header("location:register.php"); exit; } // attempting to move the file from its temporary directory to its new home if(move_uploaded_file($new_image["tmp_name"],$target_path)) { // we are putting a reference to the file in the database. $sql=mysql_query("INSERT INTO facilitators(name,phone,address,email,username,password,pin,family,image)VALUE('$name','$phone','$address','$email','$username','$password','$pin','$family','"$new_image['name']."')")or die("Could Not Insert into the Data Base:".mysql_error()); header("location:index.php"); exit; } else { {$_SESSION["error"]="Could Not Register You Please contact Web Master on 08132841856 "; header("location:register.php"); } ?> It display a prase error on 114 Parse error: parse error in C:\wamp\www\Teens Site\check.php on line 114 and this line 114 $sql=mysql_query("INSERT INTO facilitators(name,phone,address,email,username,password,pin,family,image)VALUE('$name','$phone','$address','$email','$username','$password','$pin','$family','"$new_image['name']."')")or die("Could Not Insert into the Data Base:".mysql_error()); Thanks a lot for all the assistance i have been receiving.
×
×
  • 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.