PHP - Retrieve Pages, Ads, Leads From Multiple Facebook Accounts With Graph Api - Help Needed
Retrieve Pages, Ads, Leads from multiple facebook accounts with Graph API - Help needed Similar TutorialsFor the life of me, I cannot find a way to delete, cancel or remove facebook events I created & updated using the FB PHP SDK & the Graph API. I've tried every single permutation found on facebook's documentation & stack overflow... Here are some of the clues I have found on my quest.. https://developers.facebook.com/docs/reference/api/#deleting https://developers.facebook.com/docs/reference/api/event/ https://developers.facebook.com/docs/reference/rest/events.cancel/ http://stackoverflow.com/questions/2931387/facebook-sdk-and-graph-api-comment-deleting-error http://stackoverflow.com/questions/2858748/facebook-api-delete-status http://stackoverflow.com/questions/3832405/facebook-graph-api-delete-like Here is what I have tried so far. function delete_fb_event($event_data, $data) { //load the user for offline access and userid $user = $this->load_user($data['aid']); if(!empty($user[0]['fb_offline_access'])) { //instantiate Facebook API require 'facebook.php'; $facebook = new Facebook(array( 'appId' => 'BLAHBLAHBLAH', 'secret' => 'BLAHBLAHBLAHBLAHBLAHBLAH', 'cookie' => true, )); $fb_event = array( "access_token" => $user[0]['fb_offline_access'], ); $result = $facebook->api('/'.$event_data['fb_event_id'], 'DELETE', $fb_event); //Uncaught GraphMethodException: Unsupported delete request //$result = $facebook->api('/'.$user[0]['fb_id']."_".$event_data['fb_event_id'], 'POST', array('access_token' => $user[0]['fb_offline_access'], 'method' => 'delete')); Uncaught OAuthException: (#803) Some of the aliases you requested do not exist //$result = $facebook->api('/'.$event_data['fb_event_id']."_".$user[0]['fb_id'], 'POST', array('access_token' => $user[0]['fb_offline_access'], 'method' => 'delete')); Uncaught OAuthException: (#803) Some of the aliases you requested do not exist //$result = $facebook->api('/'.$event_data['fb_event_id'], 'POST', array('access_token' => $user[0]['fb_offline_access'], 'method' => 'delete')); Uncaught GraphMethodException: Unsupported post request //$result = $facebook->api('/'.$user[0]['fb_id']."_".$event_data['fb_event_id'], 'POST', array( 'access_token' => $user[0]['fb_offline_access'], 'method' => 'delete' )); Uncaught OAuthException: (#803) Some of the aliases you requested do not exist return $result; } else { echo "error3"; //no FB offline access } } Hello everyone, I'm new here
My website was working fine until a few days ago, Up until then my str_replace('s130x130', 's800x800') and str_replace('_s', '_o') solved the picture thing. Now the images are broken (or very small) and I can find no documentation on how to enlarge the pictures. Thus my question: how do I retrieve larger pictures from the Facebook PHP SDK?
Code
foreach($pagefeed['data'] as $post) { if ($post['type'] == 'status' || $post['type'] == 'link' || $post['type'] == 'photo') { if ($post['type'] == 'photo') { echo "<div class='col-md-6 col-sm-6'>"; echo "<div class='thumbnail'>"; echo "<img src=" . str_replace('s130x130', 's800x800', str_replace('_s', '_o', $post['picture'])) . " />"; echo "<div class='caption'>"; echo "<sup>Geplaatst op: " . date("d-m-Y, (strtotime($post['created_time']))) . "</sup>"; if (empty($post['message']) === false) { echo "<p><span class='glyphicon glyphicon-comment'></span> " . $post['message'] . "</p>";} echo "</div>"; echo "</div>"; echo "</div>"; $i++; } } }Thanks in advance! Anyone can help me with plotting of multiple line graph in php. I have researched on multiple line graph online and I would like to plot the graph by taking data from my database but the example below is inserting the graph data manually. Anyone can teach me how to use a for loop inside an array? Code: [Select] <?php //Include the code require_once 'phplot.php'; //Define the object $plot = new PHPlot(800,600); //Set titles $plot->SetTitle("A 3-Line Plot\nMade with PHPlot"); $plot->SetXTitle('X Data'); $plot->SetYTitle('Y Data'); //Define some data $example_data = array( array('a',3,4,2), array('b',5,3,1), array('c',7,2,6), array('d',8,1,4), array('e',2,4,6), array('f',6,4,5), array('g',7,2,3) ); $plot->SetDataValues($example_data); //Turn off X axis ticks and labels because they get in the way: $plot->SetXTickLabelPos('none'); $plot->SetXTickPos('none'); //Draw it $plot->DrawGraph(); ?> I'm making a checklist. One table holds the list with IDs. There are about 224 rows, each with its own ideas. Now I have another table to hold user accounts. When you create an account, it shows you a fresh new checklist that you need to start checking off. Could anyone please share techniques so I can have multiple accounts have their own list they need to check off? (ie, when a new person creatures a new account they should have their own list with NOTHING checked) The only way I can think of doing this is making 224 fields for the user account with the IDs of the checklist table to check if I checked it or not. Surely there's an easier way? Thanks I need Delete Duplicate Email Records That Are Attached To One Account But Can Be Found In Multiple Accounts I have a table, consumer_mgmt. It collects consumer information from various forms. These forms are available through different pages that are part of a business package. A business can offer these signups to gather names and emails from consumers for various types of specials they may offer. So a consumer my be in the consumer_mgmt table 5, 10, 15 times for that particular business. But, that consumer may be in the consumer_mgmt table multiple times for a different business. So multiple times for multiple businesses. I need to remove duplicates for each business account so the consumer is only the consumer_mgmt only once for each business. There are approximately 15,000 rows currently in the consumer_mgmt table. I'm not sure where to begin on the logic. Since there are multiple business accounts that the emails are attached to, would one have to build a case for each loop? This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=346715.0 Hi, I want to be able to retrieve records from db tables to build an xml file. The problem I am having is that I don't know how to retrieve a value after using foreign key to get appropriate value. You see below I want to make a new attribute to store to var $newAttr. Code: [Select] <?php $doc=new DOMDocument(); mysql_connect("localhost","root"); mysql_select_db("xmlDB"); $edges=mysql_query("SELECT * FROM edge"); while($row=mysql_fetch_assoc($edges)) { if($row['flag']=='val') { $curValue=mysql_query("SELECT val FROM value,edge WHERE val.edge_id=edge.edge_id"); if($curRowIsAttribute=mysql_query("SELECT is_Attribute FROM value,edge WHERE value.is_Attribute='Y' AND value.edge_id=edge.edge_id")) { //create attribute node $newAttr=$dom->createAttribute();//HELP HERE PLEASE THEN I SHOULD BE ABLE TO COMPLETE NEXT TWO LINES BELOW! //set attribute value ... //append attribute to current element ... }//END IF }//END IF }//END BIG WHILE ?> Any help much appreciated! I insert multiple id from my checkbox to mysql database using php post form. in e.x i insert id (checkbox value table test) to mysql. no i need to any function for retrieve data from mysql and print to my page with my e.x output.(print horizontal list name of table test where data = userid) my checkbox value ( name table is test ) : Code: [Select] 01 ---id----- name ---- 02 ---1 ----- test1 ---- 03 ---2 ----- test2 ---- 04 ---3 ----- test3 ---- 05 ---4 ----- test4 ---- 06 ---5 ----- test5 ---- 07 ---6 ----- test6 ---- 08 ---7 ----- test7 ---- 09 ---8 ----- test8 ---- 10 ---9 ----- test9 ---- mysql data Insert ( name of table usertest ): Code: [Select] 1 ---id----- data ---- userid ----- 2 ---1 ----- 1:4:6:9 ---- 2 ----- 3 ---2 ----- 1:2:3:4 ---- 5 ----- 4 ---3 ----- 1:2 ---- 7 ----- example outout : ( print horizontal list name of table test where data = userid ) print? Code: [Select] 1 user id 2 choise : test1 - test4 - test6 - test9 Thanks Hi everyone, I am having trouble passing/displaying the values inside of a selected list. I created a add/remove list using Jquery and I tried to display the values passed using foreach and for loops but it is still not working. The values I am trying to get are $existing_mID[$j], which is inside of the option value attribute. Please kindly let me know what should I do in order to get the values and I really appreciate your help. <?php $selected = $_POST['selectto']; if(isset($selected)) { echo "something in selected<br />"; for ($i=0;$i<count($selected);$i++) echo "selected #1 : $selected[$i]"; foreach ($selected as $item) echo "selected: item: $item"; } ?>This is the form hey i am using a MySql database and i need to create a dynamic HTML table with one of its columns as checkboxes.so i have to create multiple checkboxes.but these checkbox values are to be stored in a mysql table and then later retrieved when form reloads.and depending on previous state when form was submitted, the newly created checkboxes have to be checked in the same manner.so how do i store multiple checkbox values in my table and also how do i retrieve them? please help. I have not created any code for this as I dont know where to start, or what its even called. I am on about trying to create a page dynamically depending on the id which is selected. Parts of the URL will change depending on what id is selected for example: 'http://www.facebook.com/home.php?sk=h. i am wanting to create a video website, where when the thumbnail of a video is clicked, a new page is loaded with that more details of the video and the video itself, and im guessing the url would change to identify the id of the video. I cannot create a page for every video by hand, as i will have many videos and this is not very efficient. I am just after the name of this technique or a pointer to a tutorial for how to achieve this. Thanks, Matlab Hey all, Quick sum up: I have a social website where users can follow/post/vote etc. I am adding a new facebook-like activity wall feature to each users profiles. I have worked on this bit for a few days now and can't seem to get it to work properly. What I want is, well, exactly like the facebook wall as I mentioned...When a visitor visits a user's profile, that user's activity will display, whether they recently "voted" on a post, commented, or posted something of their own, I would like it to display on their profile and of course, have the most recent entries on top. The problems I am having right now a it's displaying some things twice and it's not sorting them by the most recent. I am working with 3 tables here (I only posted the columns that I am using): Code: [Select] Table structure for table votes_posts Field Type Null Default indexer int(11) No post_id int(11) No vote int(11) No user_name varchar(250) No date varchar(255) No Table structure for table posts Field Type Null Default id int(11) No name varchar(30) No content text No datetimerss varchar(255) No category int(11) No Table structure for table comments Field Type Null Default id int(12) No post_id int(12) No name varchar(30) No content text No type varchar(30) No datetimerss varchar(255) No $users is just $_GET['user'] The timeAgo() function, simply displays the very popular "posted xx ago" date time. <ul class="streamActivity"> <?php $checkActivity = "SELECT votes_posts.post_id, votes_posts.user_name, votes_posts.vote, votes_posts.date, posts.id, posts.content, posts.name, posts.datetimerss, categories.category, comments.post_id AS comm_postid, comments.content AS comm_content, comments.name AS comm_name, comments.datetimerss AS comm_date, comments.type FROM `votes_posts` LEFT OUTER JOIN `posts` ON votes_posts.post_id = posts.id LEFT OUTER JOIN `comments` ON posts.id = comments.post_id LEFT OUTER JOIN `categories` ON posts.category = categories.cat_id WHERE (votes_posts.post_id = posts.id AND user_name = '$user') OR (comments.post_id = posts.id AND comments.name = '$user') OR (posts.name = '$user') ORDER BY votes_posts.date, posts.datetimerss, comments.datetimerss ASC"; $checkActivityResult = mysql_query($checkActivity); if (mysql_num_rows($checkActivityResult) > 0) { while ($sessionAct = mysql_fetch_array($checkActivityResult)) { $category = strtolower($sessionAct['category']); $dateVote = timeAgo($sessionAct['date']); $datePost = timeAgo($sessionAct['datetimerss']); $dateComm = timeAgo($sessionAct['comm_date']); $namePost = $sessionAct['name']; $nameComm = $sessionAct['comm_name']; $nameVote = $sessionAct['user_name']; $idVote = $sessionAct['post_id']; $idPost = $sessionAct['id']; $idComm = $sessionAct['comm_postid']; $contentPost = $sessionAct['content']; $contentComm = $sessionAct['comm_content']; $typeComm = $sessionAct['type']; if ($namePost == $user) { $classList = 'storyPost'; $classIcon = 'iconMuttr'; $name = $namePost; $content = $contentPost .' ... read more'; $datetime = $datePost; } elseif ($nameComm == $user && $typeComm == "Comment") { $classList = 'actionPost'; $classIcon = 'iconComment'; $name = $nameComm; $content = 'Commented "'. $contentComm .'"'; $datetime = $dateComm; } elseif ($nameComm == $user && $typeComm == "Advice") { $classList = 'actionPost'; $classIcon = 'iconAdvice'; $name = $nameComm; $content = 'gave Advice "'. $contentComm .'"'; $datetime = $dateComm; } elseif ($nameVote == $user) { if ($sessionAct['vote'] == "1") { $classList = 'actionPost'; $classIcon = 'iconLaughed'; $name = $nameVote; $content = 'Laughed at "'. $contentPost .'"'; $datetime = $dateVote; } elseif ($sessionAct['vote'] == "2") { $classList = 'actionPost'; $classIcon = 'iconLoved'; $name = $nameVote; $content = 'Showed Love on "'. $contentPost .'"'; $datetime = $dateVote; } elseif ($sessionAct['vote'] == "3") { $classList = 'actionPost'; $classIcon = 'iconIdiot'; $name = $nameVote; $content = 'called '. $namePost .' an Idiot for "'. $contentPost .'"'; $datetime = $dateVote; } } ?> <li class="row-activity <?php echo $classList; ?>"> <a href="" class="avatar"><img src="/images/avatars/default_male.jpg" /></a> <div class="info"> <div class="userName"> <a href=""><?php echo $name; ?></a> </div> <span class="msgBody"><?php echo $content; ?></span> <div class="imgTimeStream"> <span class="img <?php echo $classIcon; ?>"></span> <span class="source"><?php echo $datetime; ?></span> </div> </div> </li> <?php } } else { echo '<p>This user has no recent activity.</p>'; } ?> </ul> I am by no means an expert programmer...everything I know I have pretty much taught myself over the past year or two, so I can only imagine how ugly this truly is lol. I am learning each and everyday though, and I hope to continue Also, within each type of activity, there will be slightly different CSS classes on some things. Example: if the result row is a post then the css class of the list item would be "post" if the result row is a vote then the css class of the list item would be "vote" etc. Any help would be appreciated! what is dificult in creating this tables... CREATE TABLE `pois` ( `id` bigint(20) unsigned NOT NULL, `lat` float(10,7) NOT NULL, `lon` float(10,7) NOT NULL, PRIMARY KEY (`id`) ) CREATE TABLE `pois_tag` ( `poisid` int(11) NOT NULL DEFAULT '0', `tagname` varchar(45) NOT NULL DEFAULT '', `tagvalue` varchar(255) DEFAULT NULL, PRIMARY KEY (`poisid`,`tagname`) )i get back the following error ; MySQL meldet: Dokumentation #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CREATE TABLE `pois_tag` ( `poisid` int(11) NOT NULL DEFAULT '0', `tagname`' at line 8many thanks for any and all help Hello, I work for a non-profit agency and I have been up all night trying to fix a registration form that has suddenly stopped working after a php upgrade from v 5.0 to v 5.2. The server admin says it is my coding. When you hit submit the form actually does what it is supposed to however the missing link here is that I am not being emailed after each registration with the registraiton informationl. You can see the form in action at www.nctt.net/coreTest.php I have also cut and pasted the contents of that file below and have attached it to this email. There is also the last version of the form I used still up on the website that I never took down after our summer program. There are a few modifications to this page to meet the program requirements but in July www.nctt.net/SIReg.php was working fine. Any assitance, hints, suggestions, anything at all is welcome and I thnk you in advance for taking a loot. Jennifer <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>NCTT Registration Form</title> <style type="text/css"> body { margin: 10px padding: 0; font-size: 100%; } * { } h1.register { text-align: center; padding: 18px; background: #cc0033; color: #ffffff; font: 160% Arial, Helvetica, sans-serif; font-weight: bold; text-transform: uppercase; } h1.costs { margin: 10px 0 0 0; padding: 0; border-bottom: 5px solid #cccccc; font: 320% Arial, Helvetica, sans-serif; color: #0071b7; font-weight: bold; text-transform: uppercase; line-height: 1.5em; text-align: left; } h1.title { margin: 10px 0 0 0; padding: 0; border-bottom: 5px solid #cccccc; font: 180% Arial, Arial, Helvetica, sans-serif; color:#0071b7; font-weight: bold; text-transform: uppercase; line-height: 1.5em; text-align: left; } h1.regbox { color: #cc0033; font: 200% Trebuchet Ms, Arial; letter-spacing: -1px; margin: 0; padding: 0; text-align: center; } h1.side { letter-spacing: -1px; text-align: center; font: 140% Arial, Helvetica, sans-serif; font-weight: bold; color: #ffffff; padding: 0; margin: 0; } h2 { text-align: left; margin: 0; padding: 0; line-height: 1.8em; color: #cc0033; font-size: 170%; font-family: trebuchet ms; } h2.regbox { color: #0071b7; font: 140% Trebuchet Ms, Arial; letter-spacing: -1px; font-weight: bold; margin: 5px 0 0 0; padding: 0; text-align: center; } h2.enroll { color: #0071b7; font: 120% Trebuchet Ms, Arial; font-weight: bold; text-align: left; border-bottom: 3px solid #cccccc; margin: 15px 0 0 0;} h3 { margin: 0; padding: 0; line-height: 1.8em; color: #cc0033; font-size: 110%; font-family: trebuchet ms; } h4 { margin: 0; padding: 0; line-height: 1.8em; color: #cc0033; font-size: 90%; font-family: trebuchet ms; } p.normal { text-align: left; font: 75% Arial, Helvetica, sans-serif; line-height: 1.4em; margin: 5px; padding: 0; color: #000000; } .prices { border-bottom: 1px solid #ccc; color: #cc0033; line-height: 2em; font: 80% Arial, Helvetica, sans-serif; margin: 0; padding: 5px; } p.special { text-align: left; padding: 10px; margin: 5px 0 5px 0; background-color: #efefef; border: 1px solid #0071b7; font: 80% Arial, Helvetica, sans-serif; line-height: 1.5em; } p.normal1 { text-align: center; font: 75% Arial, Helvetica, sans-serif; line-height: 1.4em; margin: 5px; padding: 0; color: #000000; } span.price { border-bottom: 1px solid #ccc; color: #0071b7; line-height: 2em; font: 80% Arial, Helvetica, sans-serif; margin: 0; padding: 5px; } td.reg { background: #0071b7; border-bottom: 5px solid #0071b7; color: #ffffff; font-family: Arial, Helvetica, sans-serif; font-size: 150%; font-weight: bold; text-transform: uppercase; letter-spacing: -1px; } td.reg-line { border-bottom: 5px solid #0071b7; } td.title { font: 100% Arial, Helvetica, sans-serif; color: #000000; font-weight: bold; } label { font: 100% trebuchet ms, arial; color: #0071b7; font-weight: bold; } input { margin: 0; padding: 5px; } input.sub { padding: 10px; font-family: arial; color: #000033; font-size: 12pt; font-weight: bold; background: #ccc; text-transform: uppercase; } .success { color: #ffffff; background: #0071b7; font-weight: bold; font: 100% arial; border: 1px solid #000; padding: 10px; } .error { color: #fff; background: #FF0000; padding: 10px; border: 1px solid #990000; font: 90% arial; } a:link { text-align: left; font: 125% Arial, Helvetica, sans-serif; line-height: 1.4em; font-weight: bold; padding: 0; color: #cc3333; text-decoration: underline; } a:active {text-align: left; font: 125% Arial, Helvetica, sans-serif; line-height: 1.4em; font-weight: bold; padding: 0; color: #ff9933; text-decoration: none; } a:visited {text-align: left; font: 125% Arial, Helvetica, sans-serif; line-height: 1.4em; font-weight: bold; padding: 0; color: #009933; text-decoration: underline; } a:hover {text-align: left; font: 125% Arial, Helvetica, sans-serif; line-height: 1.4em; font-weight: bold; padding: 0; color: #0099ff; text-decoration: none;} p.check {text-align: left; font: 110% Arial, Helvetica, sans-serif; line-height: 1.4em; font-weight: bolder; padding: 0; color: #cc0033; } </style> </head> <body> <center> <? if($_POST['submit']) { $first = $_POST['first_name']; $last = $_POST['last_name']; $middle = $_POST['middle_name']; $dob = $_POST['dob']; $module_1 = $_POST['module_1']; /*$module_2 = $_POST['module_2'];*/ $province = $_POST['province']; $address_1 = $_POST['address_1']; $address_2 = $_POST['address_2']; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip']; $school = $_POST['school']; $country = $_POST['country']; $taught = $_POST['taught']; $grade = $_POST['grade']; $home = $_POST['home']; $work = $_POST['work']; $email = $_POST['email']; if(!empty($first) && !empty($last) && !empty($address_1) && !empty($city) && !empty($state) && !empty($zip) && !empty($home) && !empty($email)) { if($module_1) { $cost = $cost+195; $add_email .= "<li>December 5, 2014: YES ($195)</li>"; } /* if($module_2) { $cost = $cost+1075; $add_email .= "<li>Week II: YES ($1075)</li>"; } if(date("n") <= 15) { $before = $cost*.05; $before = round($before,2); $cost = $cost-$before; } */ $msg .= "<body style=\"font-family: arial; font-size: 10pt; line-height: 1.5em;\">"; $msg .= "<p>These are the registration details submitted from the website.</p>"; $msg .= "<ul>"; $msg .= $add_email; $msg .= "<li><strong>Name:</strong> " . $first . " " . $middle . " " . $last . "</li>"; $msg .= "<li><strong>Address One:</strong> " . $address_1 . "</li>"; $msg .= "<li><strong>Address Two:</strong> " . $address_2 . "</li>"; $msg .= "<li><strong>City:</strong> " . $city . "</li>"; $msg .= "<li><strong>State:</strong> " . $state . "</li>"; $msg .= "<li><strong>Zipcode:</strong> " . $zip . "</li>"; $msg .= "<li><strong>Province:</strong> " . $province . "</li>"; $msg .= "<li><strong>Country:</strong> " . $country . "</li>"; $msg .= "<li><strong>School:</strong> " . $school . "</li>"; $msg .= "<li><strong>Grade Taught:</strong> " . $grade . "</li>"; $msg .= "<li><strong>Field/Subject Taught:</strong> " . $taught . "</li>"; $msg .= "<li><strong>Home Phone:</strong> " . $home . "</li>"; $msg .= "<li><strong>Work Phone:</strong> " . $work . "</li>"; $msg .= "<li><strong>Email:</strong> " . $email . "</li>"; $msg .= "</ul>"; $msg .= "<p>Total Cost: $" . $cost . "</p>"; /* if($before) { $msg .= "<p>This was sent before April 15, 2013, so 5% has been taken off the total.</p>"; }*/ $msg .= "</body>"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; $headers .= 'From: donotreply@nctt.net'; $to = "info@nctt.net"; $subject = "Registration Form | " . $first . " " . $middle . " " . $last; mail($to,$subject,$msg,$headers); ?> <div class="success"> We have successfully sent your registration details to NCTT. Please click on "Add to Cart" below, and checkout with Paypal to complete your resgistration. <strong>Space will not be held for registration without payment unless you have contacted the office at 417-773-1654 and spoken to Jennifer to make special arrangements.</strong> <br /> <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="business" value="info@nctt.net"> <input name="item_name" type="hidden" class="title" value="Registration: Critical Thinking, Reading, Writing and the Common Core "> <input type="hidden" name="amount" value="<? echo $cost; ?>"> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="no_shipping" value="1" /> <input type="hidden" name="on0" value="name"> <input type="hidden" name="os0" maxlength="60" value="<? echo $first . " " . $middle . " " . $last; ?>"> <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> <input type="hidden" name="add" value="1"> </form><!--<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="business" value="info@nctt.net"> <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_viewcart_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> <input type="hidden" name="display" value="1"> </form>--> </div> <? } else { echo "<div class=\"error\">Sorry, please fill out all of the required fields.</div>"; } } else { ?> <form action="core.php" method="post"> <table border="0" cellpadding="5" cellspacing="0" width="80%"> <tr> <td colspan=3><h1 class="costs"><div align="center">REGISTER ONLINE</div></h1></td> </tr> <tr> <td width=10%></td> <td width="90%" valign="top"> <table border=0 cellpadding=3 cellspacing=0 width="100%"> <tr> <td class="prices" align="left"><a href="core.htm">Critical Thinking, Reading, Writing and the Common Core</a> <br /><p>December 5, 2014</p></td> <td width="30%" align="right" class="prices"><p style="font-weight:bold; color:#cc3300; font-size:14px;">$195.00</p></td> </tr> </table> </td> <td width=20%></td> </tr> </table> <table border="0" cellpadding="5" cellspacing="0" width="80%"> <tr> <td width="50%" align="center" class="reg">Registration</td> </tr> </table> <table border="0" cellpadding="5" cellspacing="0" width="80%"> <tr> <td width=17%></td> <td width="66%" valign="top"> <div align="center"><h1 class="title">Critical Thinking, Reading, Writing and the Common Core</h1></div> <p class="check">You <i>must check</i> the box below for your registration to be valid. Thank you.</p> <input type="checkbox" name="module_1" value="1" /> <label for="module_1">Critical Thinking, Reading, Writing and the Common Core</label> <!--<table border="0" cellpadding="3" cellspacing="1" width="100%"> <tr> <td width="25%" valign="top"> <p style="font-weight:bold; font-size:14px; color:#cc3300;">December 6, 2013 $150.00</p> </td> <td width="25%"></td> </tr> <tr> <td width="25%"><input type="checkbox" name="module_1" value="1" /> <label for="module_1">Critical Thinking, Reading, Writing and the Common Core</label></td> <td></td> </tr> <tr> <td width="25%" valign="top"> <h4>Week II ($1075.00)</h4> </td> <td width="25%"></td> </tr> <tr> <td width="25%"><input type="checkbox" name="module_2" value="1" /> <label for="module_2">Summer Institute Week II</label></td> <td></td> </tr> </table>--> <hr size=1 width=100% noshade /> <table border="0" cellpadding="2" cellspacing="0" width="100%"> <tr> <td width="33%" align="center"><input type="text" name="first_name" size="30" /></td> <td width="33%" align="center"><input type="text" name="middle_name" size="30" /></td> <td width="33%" align="center"><input type="text" name="last_name" size="30" /></td> </tr> <tr> <td width="33%" align="center"><p class="normal1">First Name</p></td> <td width="33%" align="center"><p class="normal1">Middle Initial</p></td> <td width="33%" align="center"><p class="normal1">Last Name</p></td> </tr> </table> <table border="0" cellpadding="5" cellspacing="0" width="100%"> <tr> <td><p class="normal">Address 1</p></td> <td colspan="3" align="left"><input type="text" name="address_1" size="94" /></td> </tr> <tr> <td><p class="normal">Address 2</p></td> <td colspan="3" align="left"><input type="text" name="address_2" size="94" /></td> </tr> <tr> <td><p class="normal">City</p></td> <td align="left"><input type="text" name="city" size="20" /></td> <td><p class="normal">State</p></td> <td align="left"><input type="text" name="state" size="20" /></td> </tr> <tr> <td><p class="normal">Zip</p></td> <td align="left"><input type="text" name="zip" size="20" /></td> <td><p class="normal">Province</p></td> <td><input type="text" name="province" size="20" /></td> </tr> <tr> <td><p class="normal">School/College</p></td> <td align="left"><input type="text" name="school" size="56" /></td> <td><p class="normal">Country</p></td> <td><input type="text" name="country" size="20" /></td> </tr> <tr> <td><p class="normal">Field/Subject Taught</p></td> <td align="left"><input type="text" name="taught" size="56" /></td> <td><p class="normal">Grade</p></td> <td><input type="text" name="grade" size="20" /></td> </tr> <tr> <td><p class="normal">Telephone (H)</p></td> <td align="left"><input type="text" name="home" size="20" /></td> <td><p class="normal">(W)</p></td> <td><input type="text" name="work" size="20" /></td> </tr> <tr> <td><p class="normal">Email Address</p></td> <td colspan="3"><input type="text" name="email" size="94" /></td> </tr> <tr> <td colspan=4 align=center><input type="submit" name="submit" value="Submit Form" class="sub" /></td> </tr> </table> <td width=17%></td> </td> </tr> </table> </form> <? } ?> </center> </body> </html>Attached Files coreTest.php 15.99KB 2 downloads SIReg.php 15.08KB 2 downloads Hey guys, how is everyone today? I am needing a little help with this one. I have a database that updates itself and the display page for it with every form submission on the website. I am wondering how I go about getting it to display across multiple pages? For example, once it hits 25 submissions, it would make a page 2, once page two hits 25 submissions, it creates page 3, etc. etc. Much like you see on something like a forum, it hits so many replies before it creates a new page, to limit one long page of results. Thanks in advance!! I've read through a few examples of how to paginate query results, but with my currently php skills I don't understand them, or they do not fit into my code. I wondered if I could make my own, and the logic behind this code makes sense to me, but it's still not working. Here is the code: <?php if (!$Start) { $Start = 0; } else { $Start=$_POST['Start']; } $crittercount = 120; $numpages = $crittercount / 30; $pagei = 1; $pagereit = 1; echo '<p><center> <FORM method=POST action=testpagination.php> <SELECT NAME="Start"> <OPTION>Page 1'; while ($pagereit < $numpages) { $pagei = $pagei + 30; echo '<OPTION value='.$pagei.'>'; $pagereit = $pagereit + 1; echo "Page: " .$pagereit; } echo '</SELECT>'; echo'<input type=submit value=Go></FORM><p>'; echo $Start; ?> The test site is he http://lab-lib.com/felishorns/Felishorns/websitetest/testpagination.php $crittercount is a variable that changes depending on the main $query. This query is invisible, and is used to pull a count for all the results in total. I am modifying it with $Start to create a second query which the viewer sees. $queryF = $query . " LIMIT " . $Start . ", 30"; The idea is that $Start changes depending on the value selected, thereby changing the query. In this test code, I've simply echoed the $Start value of that page, to see if the code is working, and it's not changing. What's wrong with this code? Is it not possible to have a form lead to the same link of the page it's on? Does the variable not become updated? Thanks in advance. HY I have index.php and pictures.php. In index.php I have 3 columns: - left (for menu) - right (for advertising) - center (where I want to include pictures.php) What is the best way to include pictures.php in center of index.php Code: [Select] if($_get[pictures]){ include ("pictures.php"); } I ask this because I have multiple variable like "pictures" and I will have multiple "If". Or to include in DB all this variables "pictures" and just add ".php" extension. It is secure in this way ? Thanks Hello. I'm coding myself an small webpage, In the internet you can see that there is pages like index.php?id=223923 <- for example or index.php?=news. So, I'm trying to create similar to that myself. I tried googling and searching youtube how to do this but didn't really find anything. I figured it out that it needs some database etc. I tried myself doing some table in my mysql db. And in the table some 'id, title, content' and in the id would be the url, (index.php?='id') the title would be the <title> </title> and the content would be all the code inside the webpage. I got no idea how to link these to an php or whatever it should be done So would anyone kindly tell me howto do this or give some link to an tutorial? |