Hi, i have was make small social network website and now i need to use RESTful API for hybrid application. Social network website i make in php, mysql. How to make API now? Do you have some tutorial for API that integrate in existing website? Thanks!

Member Avatar
Member Avatar
+0 forum 2

Hi I have problem to get data when insert with ajax. I have ajax.js file and here is this code: $('#text-content').keypress(function(e){ if(e.which == 13) { if($('input#enter-click').prop('checked', true)) { $('#live-send').click(); e.preventDefault(); } } }); $('#live-send').click(function(){ var message = $.trim( $('#text-content').val() ); if($('#text-content').val()!="") { $.ajax({ type: 'POST', dataType: "json", url: './includes/conversation.php', data: { message: message }, cache: false, success: function(data) { $('.commentArea').load( 'Messages.php.'); $('.bubbledRight').val(""); } }); // setInterval(function(){ // $('.commentArea').load( 'Messages.php.'); // },1000); return false; } else { //notify the user they need to enter data alert("Please write messages!"); } }); $('.max-height').scrollTop($('.max-height')[0].scrollHeight); //show messages on bottom In index page I have <div …

Member Avatar
Member Avatar
+0 forum 2

Hi I have problem to get data when insert with ajax. I have ajax.js file and here is this code: $('#text-content').keypress(function(e){ if(e.which == 13) { if($('input#enter-click').prop('checked', true)) { $('#live-send').click(); e.preventDefault(); } } }); $('#live-send').click(function(){ var message = $.trim( $('#text-content').val() ); if($('#text-content').val()!="") { $.ajax({ type: 'POST', dataType: "json", url: './includes/conversation.php', data: { message: message }, cache: false, success: function(data) { $('.commentArea').load( 'Messages.php.'); $('.bubbledRight').val(""); } }); // setInterval(function(){ // $('.commentArea').load( 'Messages.php.'); // },1000); return false; } else { //notify the user they need to enter data alert("Please write messages!"); } }); $('.max-height').scrollTop($('.max-height')[0].scrollHeight); //show messages on bottom In index page I have <div …

Member Avatar
Member Avatar
+0 forum 2

Hi i get all information what i need but i dont know how to get facebook profile image and save to file and in mysql save path. Here is my code for call fb api : <?php session_start(); include_once("config.php"); // facebook id include_once("includes/functions.php"); //destroy facebook session if user clicks reset if(!$fbuser){ $fbuser = null; $loginUrl = $facebook->getLoginUrl(array('redirect_uri'=>$homeurl,'scope'=>$fbPermissions)); echo '<a href="'.$loginUrl.'"><img src="images/fb_login.png"></a>'; }else{ $user_profile = $facebook->api('/me?fields=id,first_name,last_name,email,gender'); $user = new Users(); $user_data = $user->checkUser('facebook',$user_profile['id'],$user_profile['first_name'],$user_profile['last_name'],$user_profile['email'],$user_profile['gender']); if(!empty($user_data)){ $_SESSION['userdata'] = $user_data; header("Location:account.php"); }else{ die('Some problem occurred, please try again.'); } } ?>

Member Avatar
Member Avatar
+0 forum 1

How to make popup login and register from index.php to work and to parse data in mysql I have: Index.php, login.php, register.php In index.php I have modal popup and I want to user can login and register from popup. I try with ajax but not working. Here is my code: ajax.php: function validLogin(){ var email=$('.email').val(); var password=$('.password').val(); $.ajax({ type: "POST", url: "sign-in.inc", data: "name="+username+"&pwd="+password, success: function(html){ if(html=='true'){ alert ("Correct"); } else{ alert ("Wrong"); } } }); } and here is popup form : <div id="login"> <form class="form login-form" name="login-popup" > <a class="btn-facebook" href="#"><span><i class="fa fa-facebook"></i> </span><span>Login with Facebook</span></a> <a class="btn-google" …

Member Avatar
+0 forum 0

Hello i have problem on mobile device to prevent on click to another image to hide first. This is for hover effect and work fine : $("div.mitarbeiterfoto") .mouseenter(function() { var id = $(this).attr("id"); var idInfo = $(this).attr("id").substr(5); ($(this).find('img').css('display', 'none')); ($('#' + id + '_o').css('display', 'block')); showInfo(idInfo); }) .mouseleave(function() { var id = $(this).attr("id"); var idInfo = $(this).attr("id").substr(5); ($(this).find('img').css('display', 'block')); ($('#' + id + '_o').css('display', 'none')); hideInfo(idInfo); }); but for mobile i try in this way: var clickOrTouch = (('ontouchend' in window)) ? 'touchend' : 'click'; $('div.mitarbeiterfoto').on(clickOrTouch, function(e) { var id = $(this).attr("id"); var idInfo = $(this).attr("id").substr(5); ($(this).find('img').css('display', 'none')); ($('#' + …

Member Avatar
+0 forum 0

How to make in admin page to see in navigation Badge with number of post. Autors make new post and administrator see like in this image example: ![aebb9fd23d41b5677781d14c3d116dcd](/attachments/small/3/aebb9fd23d41b5677781d14c3d116dcd.jpg "align-left") Thanks!!!

Member Avatar
Member Avatar
+0 forum 4

How to share sigle post when click on button ex. fbshare, twitshare and show them in facebook. Do you know some examples or tutorial?

Member Avatar
Member Avatar
+0 forum 1

How to insert image name in database and image store in folder image with move_uploaded_file usign PDO: this is my query: $stmt = $db->prepare('INSERT INTO blog_posts_seo (postTitle,postSlug,image,postDesc,postCont,postDate) VALUES (:postTitle, :postSlug, $filename, :postDesc, :postCont, :postDate)') ; $stmt->execute(array( ':postTitle' => $postTitle, ':postSlug' => $postSlug, '$filename' => $image, ':postDesc' => $postDesc, ':postCont' => $postCont, ':postDate' => date('Y-m-d H:i:s') ));

Member Avatar
Member Avatar
+0 forum 1

How to when click on share button share on facebook post from website example: my website url : blog.com/name_of_post in my url show only title of post. How to share from every post on facebook?

Member Avatar
+0 forum 0

How to upload images into database with pdo or only image name and image move into folder

Member Avatar
Member Avatar
+0 forum 3

How to make searching for my blog with pdo? I try like this: <?php require('include/config.php');?> <?php $query = $_GET['query']; // gets value sent over search form $min_length = 3; // you can set minimum length of the query if you want if(strlen($query) >= $min_length){ // if query length is more or equal minimum length then $query = htmlspecialchars($query); // changes characters used in html to their equivalents, for example: < to &gt; $query = mysql_real_escape_string($query); // makes sure nobody uses SQL injection $raw_results = mysql_query("SELECT * FROM articles WHERE (`title` LIKE '%".$query."%') OR (`text` LIKE '%".$query."%')") or die(mysql_error()); // * …

Member Avatar
Member Avatar
+0 forum 5

How to meta description get value from post?

Member Avatar
Member Avatar
+0 forum 2

How to select image from folder by name in mysql. This is mysql query for other rows $query = "SELECT `posts`.`id` AS `post_id`, `categories`.`id` AS `category_id`,`title`,`contents`,`date_posted` ,`categories`.`name` FROM `posts` INNER JOIN `categories` ON `categories`.`id`= `posts`.`cat_id`"; how to select row 'image' where is name of image and call that image from folder?

Member Avatar
Member Avatar
+0 forum 5

How to upload image to database and move into image folder this is my function for other rows: <?php function add_post($title, $contents, $category) { $title = mysql_real_escape_string($title); $contents = mysql_real_escape_string($contents); $category = (int) $category; //var_dump($category); mysql_query("INSERT INTO `posts` SET `cat_id` = '{$category}', `title` = '{$title}', `image` = '{$image}', `contents` = '{$contents}', `date_posted` = NOW()"); } und this is post page: <?php include_once('../resources/init.php'); if ( isset($_POST['title'], $_POST['contents'], $_POST['category']) ) { //var_dump($_POST); $errors = array(); $title = trim($_POST['title']); $contents = trim($_POST['contents']); if ( empty($title)) { $errors[] = 'You need to supply a title'; } else if ( strlen($title) > 255 ){ $errors[] …

Member Avatar
Member Avatar
+0 forum 3

I have problem with this code show mi error Warning: mysql_result() expects parameter 1 to be resource, boolean given in C:\wamp\www\blogcode\resources\func\blog.php on line 34 function category_exists($name){ $name = mysql_real_escape_string($name); $query = mysql_query("SELECT COUNT(1) FROM 'categories' WHERE 'name'= '{$name}'"); return (mysql_result($query, 0)=='0') ? false:true; } How to fix this problem?

Member Avatar
Member Avatar
+0 forum 6

How to make meta tag for each post in php using post for meta description?

Member Avatar
+0 forum 0

How to make that Users on my website first click on youtubevideo open fb for share and then automatic play youtubevideo? Example link: http://video.yuvesti.net/

Member Avatar
+0 forum 0

The navigation must be styled using the :hover pseudo class, while the active menu point must use the body class. How to make this? Thanks!

Member Avatar
Member Avatar
+0 forum 3

How to show some articles from another website with API example: from this web site http://shopper.cnet.com/buy-pc-games/ name of game,pictures and price to show on my website, with automatic update?

Member Avatar
Member Avatar
+0 forum 1

I have problem with css when use this htacces code RewriteEngine On RewriteRule ^([^/]*)/([^/]*)$ /index.php?id=$1&page=$2 [L] mode_rewrite work ok but css is not :( How to fix?

Member Avatar
Member Avatar
+0 forum 5

I have this url:http://localhost:8080/skolski_portfolio/index.php?id=main&page=portfolio and i want to be http://localhost:8080/skolski_portfolio/portfolio then i make this rule in .htaccess RewriteEngine On RewriteRule ^([^/]*)/([^/]*)\.html$ :8080/skolski_portfolio/index.php?id=$1&page=$2 [L] i have error! How to fix this?

Member Avatar
Member Avatar
+0 forum 1

I need help for my code when i login successfly i have error this is my code: <?php session_start(); $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="portfolio_baza"; // Database name $tbl_name="skole_login"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from form $email=$_POST['email']; $login_pass=$_POST['login_pass']; // To protect MySQL injection (more detail about MySQL injection) $email = stripslashes($email); $login_pass = stripslashes($login_pass); $email = mysql_real_escape_string($email); $login_pass = mysql_real_escape_string($login_pass); $sql="SELECT * FROM $tbl_name WHERE email='$email' and login_pass='$login_pass'"; $result=mysql_query($sql); $count=mysql_num_rows($result); if($count==1){ session_register("email"); session_register("login_pass"); header("location:login_success.php"); …

Member Avatar
Member Avatar
+0 forum 5

This is my links in website: mywebsite.com/index.php?id_1=main&id_2=kontakt mywebsite.com/index.php?id_1=main&id_2=onama How to remove from url that be like this mywebsite.com/index.php/onama mywebsite.com/index.php/kontakt This is my index.php and in template pocetna.php <li><a href="index.php?id_1=main&id_2=kontakt">КОНТАКТ</a></li> <li><a href="index.php?id_1=main&id_2=onama">О НАМА</a></li> <?php session_start(); require_once("configuration.php"); require_once("functions.php"); require_once("session_load.php"); //require_once("connection.php"); $url_id = get_url_value(); // ucitavanje pocetne strane, homepage if (($url_id['grupa'] == "0") and ($url_id['stranica'] == "0")){ include_once ("includes/pocetna.php"); } // ucitavanje formi za logovanje i registraciju profesora i admina skola if ($url_id['grupa'] == "form"){ // ucitavanje zajednickog headera za forme za logovanje i registrovanje include_once ("includes/form_login_register_header.php"); if ($url_id['stranica'] == "login_profesor"){ include_once ("includes/form_login_profesor.php"); } if ($url_id['stranica'] == "login_skola"){ include_once ("includes/form_login_skola.php"); } if ($url_id['stranica'] …

Member Avatar
Member Avatar
+0 forum 10

Dears, how to make dynamic webpage with php for example: website.com/pagename website.com/gallery website.com/page4/page6 How to do in code how to call pages?

Member Avatar
Member Avatar
+0 forum 3

Dears, how to get div or content informations text and pictures from another website and show in my webpage? Please help!

Member Avatar
Member Avatar
+0 forum 4

How to show on my website ,content from this web page (cdkeyshere.com) i try with simple DOM code but show oonly text of liks of image i need image and text and links?How to do that please help?

Member Avatar
Member Avatar
+0 forum 1

Dears, i have question how to in my website put google adsence by category in meny for example: menu for computer ads when click opet page with google adsense of computing? Please help!

Member Avatar
Member Avatar
+0 forum 3

How to store 3000 image in mysql fast not one by one?

Member Avatar
Member Avatar
+0 forum 7

I need websites for ads people put some free ads in my website. Example: sell car or mobile. Do you know some php script or opensourse?

Member Avatar
Member Avatar
+0 forum 1

The End.