-
Posts
151 -
Joined
-
Last visited
About subhomoy
- Birthday 02/09/1992
Profile Information
-
Gender
Male
-
Location
India, Kolkata
-
Interests
Html, Css, Php, Mysql, Javascript, jQuery, Bootstrap.....
-
Age
21
subhomoy's Achievements
Regular Member (3/5)
1
Reputation
-
Thank you everybody...
-
Thanks you @Jacques1, for the help.... Yeah definitely school projects doesn't need lots of space though.... Can you plz throw light on some indexing method which will help me in long run for my project... Thank you once again...
-
Hello everyone, I'm going to create my school project and I really need your advice. My Project Summary I need to create a new website where the user can add new schools in my site. After creating, they can add students, add teachers, add principal and hell lot of things from their admin panel. And in the frontend they will get their own urls and can display their schools. Ex1: example.com/st_sebastians/ <------- School name. Ex2: example.com/st_augustin/ <------- School name. When the user will visit those url they will see all the contents of their respective schools. My Questions How can I create those database. For that I've thought of two methods. 1) I will create multiple database for every user/school dynamically using php and saves the record in it. (I searched on google that it is very prone to mysql injection.) 2) I will create a single database with everything related to their (school id) and stores in the single database. Example Student table id | school_id | name | roll | ---------------------------------------------- 1 | 1 | Subho | 123456 ---------------------------------------------- 2 | 5 | xyz | 236566 ---------------------------------------------- 3 | 45 | asfgf | 778219 . . . . . . . . Please note that the database are going to store whole lot of records and I don't want to it slow down. Any Help will be highly appreciated. Thank You In advance...
-
Hello everybody I;m trying to post data to my facbook page (not on my profile wall) but whenever i try it keeps getting posted in my fan page but in different place . I want to post it using My Page name i the wall but it is getting posted in this section (in the left panel of my page..) I want to show in the page wall like all the posts is showing... Here is the script that i've used $touid = "xxxxxxxxxxxxxxxxx"; // This is the page id i'm using $token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // my access token of that page $msg = "Hello again"; $title = "TItle"; $uri = "http://www.google.com"; $desc = "description"; $pic = "http://i.imgur.com/JCdGh.png"; $action_name = "Google"; $action_link = "http://www.google.com"; echo FB_wallpost_wosdk($touid, $token, $msg, $title, $uri, $desc, $pic, $action_name, $action_link); function FB_wallpost_wosdk($touid, $token, $msg, $title, $uri, $desc, $pic, $action_name, $action_link){ if ( ($touid !="") && ($token !="") && ($msg != "") && ($title != "") && ($uri != "") && ($desc != "") && ($pic != "") && ($action_name != "") && ($action_link != "") ) { $url = "https://graph.facebook.com/".$touid."/feed"; $attachment = array( 'access_token' => $token, 'message' => $msg, 'name' => $title, 'link' => $uri, 'description' => $desc, 'picture'=>$pic, 'actions' => json_encode(array('name' => $action_name,'link' => $action_link)) ); // set the target url $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //to suppress the curl output $result = curl_exec($ch); curl_close ($ch); return $result; } else { return 0; } } My Access tokens have this scopes.. Whenever i post anything it getting posted as a visitors post in my fan page.... Pleas help guys... THank in advance....
-
hello every body, Currently i'm scraping web data for a demo project but i cant preg_match the value from this html. The html code is <div class="carouselContainer leftDisabled"> <ul class="carousel leftDisabled"> <li> <div class="thumbContainer"> <div class="thumb" style="background-image:url(http://img6a.flixcart.com/image/mobile/v/h/g/samsung-galaxy-core-2-sm-g355h-100x100-imadzb4ywyj25mw4.jpeg)" data-imageId="IMADZB4YWYJ25MW4"> </div> </div> </li> <li> <div class="thumbContainer"> <div class="thumb" style="background-image:url(http://img6a.flixcart.com/image/mobile/v/h/g/samsung-galaxy-core-2-sm-g355h-100x100-imadzb4zhk4855ny.jpeg)" data-imageId="IMADZB4ZHK4855NY"> </div> </div> </li> <li> <div class="thumbContainer"> <div class="thumb" style="background-image:url(http://img6a.flixcart.com/image/mobile/v/h/g/samsung-galaxy-core-2-sm-g355h-100x100-imadzwrpmdwhnxg7.jpeg)" data-imageId="IMADZWRPMDWHNXG7"> </div> </div> </li> <li> <div class="thumbContainer"> <div class="thumb" style="background-image:url(http://img6a.flixcart.com/image/mobile/v/h/g/samsung-galaxy-core-2-sm-g355h-100x100-imadzwvvz3deeh4c.jpeg)" data-imageId="IMADZWVVZ3DEEH4C"> </div> </div> </li> </ul> </div> The regex i've used is preg_match_all('|<div class="carouselContainer leftDisabled"+>(.*)</div+>|U',$txt,$matches3); I want only the images images url from that specific block. Can anybody help me in this plz...
-
Thanks for the reply @ QuickOldCar But i'm asking is there anything to protect direct access to the image directory... I dont want any1 to go directly and view all all the images www.yourdomain.com/images.. Rather it should show "ACCESS FORBIDDEN"
-
Hello every1, I'm trying to create a magazine wesite and I dont want anybody to access my images folder which is located in the root directory. I want some thing like this... I want to call the images in my website using <img> tag but I dont want any1 to access the directory directly. It should also protect from software bots also like (HTTrack or website Copier) It should show "Access forbidden". Any help will be greatly appreciated. Thank you...
-
Hello every body. Currently I am creating a quiz section but I'm facing some problem. The thing i want is that the questions which the user has played before should not come again. So here is my quiz table. +-------------+-------------------------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+-------------------------------------+------+-----+---------+----------------+ | qid | int(11) | NO | PRI | NULL | auto_increment | | questions | varchar(255) | NO | UNI | NULL | | | correct_ans | varchar(50) | NO | | NULL | | | option1 | varchar(50) | NO | | NULL | | | option2 | varchar(50) | NO | | NULL | | | option3 | varchar(50) | NO | | NULL | | | category | enum('Maths','Bollywood','Special') | NO | | NULL | | +-------------+-------------------------------------+------+-----+---------+----------------+ Then I have created another tablle where I stored their user id and the questions Iid they have played. Here is the table. +----------------+---------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------------+---------+------+-----+---------+-------+ | mid | int(11) | NO | PRI | NULL | | | quiz_questions | text | NO | | NULL | | +----------------+---------+------+-----+---------+-------+ In the above table, the ids are stored in this pattern 1,5,10,6,7,11,15,29,2 ------------------> Tis are the quiz id. I'm using this query but to bring the uinque questions but still the same questions are comming.. $q = $this->database()->prepare("SELECT quiz_questions FROM quiz_played WHERE mid = ?"); $q->bindParam(1, $mid,PDO::PARAM_INT); $q->execute(); $row = $q->fetch(PDO::FETCH_ASSOC); $q->closeCursor(); $q1 = $this->database()->prepare("SELECT * FROM quiz WHERE qid NOT IN (?) ORDER BY RAND()"); $q1->bindParam(1, $genre,PDO::PARAM_STR); $q1->bindParam(1, $row['quiz_questions'], PDO::PARAM_STR); $q1->execute(); return $q1->fetch(PDO::FETCH_ASSOC); Any help will be really appreciated.
-
If I add [L,R] in each RewriteRule then it redirects me to the another url Example I want to visits www.example.com/new_folder it took me to this url http://www.example.com/home3/superior/public_html/new_folder.php Is there anything that could solve the problem ???? plz help...
-
@requinix still not working, showing the same error.... 404 not found 've change the file as u have said RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]+)/$ $1.php RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$ RewriteRule (.*)$ /$1/ [R=301,L] RewriteCond %{HTTP_HOST} !^www.example.com$ [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] DirectoryIndex index.php Plz help me/......
-
Thanks for the help.....
-
Hello every body Currently I'm facing a new prbel with .htaccess. I've used this code to remove the .php extention and add a trailing '/' at the end. RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]+)/$ $1.php RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$ RewriteRule (.*)$ /$1/ [R=301,L] RewriteCond %{HTTP_HOST} !^www.superioradsmedia.com$ [NC] RewriteRule ^(.*)$ http://www.superioradsmedia.com/$1 [L,R=301] Everything is working fine except two things 1) If I use an image location like "www.abc.com/images/abc.jpg" it does'nt show up.. But if I use 'http://' in front of it it shows the image... 2) Suppose I have a directory in my root directory like 'new_folder' which contains an index.php page If i access like this www.abc.com/new_folder -------------------> It gives me 404 error... But if I use www.abc.com/new_folder/index.php ---------------------> it works... ANy help will be greatly appreciated.... Thank you...
-
duplicate records are getting inserted in the database
subhomoy replied to subhomoy's topic in PHP Coding Help
I'm runniig it from the IPN simulator using a sandbox account.... -
duplicate records are getting inserted in the database
subhomoy replied to subhomoy's topic in PHP Coding Help
No i'm using the script from paypal only.... Always it showing INVALID... ANY HELP.... -
duplicate records are getting inserted in the database
subhomoy replied to subhomoy's topic in PHP Coding Help
Thanks for the info... BTW the bindParam one I know.. It was done by mistake... Actually i found dis on net.. WHen ever i'm testing using IPN SIMULATOR, it always gives me invalid... ANY IDEAS??? <?php // STEP 1: read POST data // Reading POSTed data directly from $_POST causes serialization issues with array data in the POST. // Instead, read raw POST data from the input stream. $raw_post_data = file_get_contents('php://input'); $raw_post_array = explode('&', $raw_post_data); $myPost = array(); foreach ($raw_post_array as $keyval) { $keyval = explode ('=', $keyval); if (count($keyval) == 2) $myPost[$keyval[0]] = urldecode($keyval[1]); } // read the IPN message sent from PayPal and prepend 'cmd=_notify-validate' $req = 'cmd=_notify-validate'; if(function_exists('get_magic_quotes_gpc')) { $get_magic_quotes_exists = true; } foreach ($myPost as $key => $value) { if($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) { $value = urlencode(stripslashes($value)); } else { $value = urlencode($value); } $req .= "&$key=$value"; } // STEP 2: POST IPN data back to PayPal to validate $msg = json_encode($_POST); $ch = curl_init('https://www.sandbox.paypal.com/cgi-bin/webscr'); curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POSTFIELDS, $req); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_FORBID_REUSE, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close')); // In wamp-like environments that do not come bundled with root authority certificates, // please download 'cacert.pem' from "http://curl.haxx.se/docs/caextract.html" and set // the directory path of the certificate as shown below: // curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem'); if( !($res = curl_exec($ch)) ) { // error_log("Got " . curl_error($ch) . " when processing IPN data"); curl_close($ch); exit; } curl_close($ch); // STEP 3: Inspect IPN validation result and act accordingly if (strcmp ($res, "VERIFIED") == 0) { // The IPN is verified, process it: // check whether the payment_status is Completed // check that txn_id has not been previously processed // check that receiver_email is your Primary PayPal email // check that payment_amount/payment_currency are correct // process the notification // assign posted variables to local variables $item_name = $_POST['item_name']; $item_number = $_POST['item_number']; $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; $to = "superioradsmedia@gmail.com"; $subject = "Verified"; $message = "$otherstuff"; $from = "From: superior"; mail($to,$subject,$message,$from); // IPN message values depend upon the type of notification sent. // To loop through the &_POST array and print the NV pairs to the screen: foreach($_POST as $key => $value) { echo $key." = ". $value."<br>"; } } else if (strcmp ($res, "INVALID") == 0) { // IPN invalid, log for manual investigation echo "The response from IPN was: <b>" .$res ."</b>"; $to = "superioradsmedia@gmail.com"; $subject = "INVALID"; $message = "$msg"; $from = "From: superior"; mail($to,$subject,$message,$from); } ?>