PHP - Do I Have To Create A New Page For Every Single Category?
This is more of an SEO question. I have a site with couple hundred categories within each city. I was wondering what the best approach is to do them? www.mysite.com/browse/apples?city=new-york www.mysite.com/browse/new-york?category=apples Which one is the better way to do it for seo purposes? If it's the first method, that would mean I would have to create couple hundred pages for those categories yes? Similar Tutorialscreate_ckeditor.php <?php session_start(); date_default_timezone_set('Asia/Manila'); if($_SESSION['login']['Ad_UserName']==""||$_SESSION['login']['Ad_ExWrite']=="0"){ @header("Location:error.php"); }elseif($_SESSION['login']['Ad_ExWrite']!="1"){ echo "<script type='text/javascript'>alert('You don\'t have rights to access this panel. Please contact the Global Administrator!')</script>"; echo '<script type="text/javascript">history.go(-1)</script>'; } ?> <?php if($_SESSION['login']['Ad_ExWrite']=="1"){include("create_ckeditor_script.php");}; ?> <!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" xml:lang="en-gb" lang="en-gb" dir="ltr" id="minwidth" > <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>SRG Online Nursing Review</title> <script language="JavaScript" src="calendar_us.js"></script> <link rel="stylesheet" href="calendar.css"> <script type="text/javascript" src="js/calendar/calendar.js"></script> <link href="css/images/boss.ico" rel="shortcut icon" type="image/x-icon" /> <script type="text/javascript" src="js/tools.js"></script> <script type="text/javascript" src="js/validate.js"></script> <script type="text/javascript" src="js/deleteall.js"></script> <script type="text/javascript" src="js/clock.js"></script> <script type="text/javascript" src="js/popup/popup.js"></script> <link rel="stylesheet" type="text/css" href="css/main_import.css" /> <script type="text/javascript" src="js/menu.js"></script> </head> <body id="minwidth-body" onLoad="goforit()"> <?php include("includes/menu.html");?> <?php @include_once("class/class.php"); @$db=new DB(); @$db->connect(); $sql="SELECT * FROM tbl_coursecategory WHERE Course_IsAvailable=1 ORDER BY Course_Name ASC "; @$array=$db->get_as_array($sql); ?> <!--- menubar border STARTS ---> <div class="clr"></div> </div> <div id="content-box"> <div class="border"> <div class="padding"> <div id="toolbar-box"> <div class="t"> <div class="t"> <div class="t"></div> </div> </div> <div class="m"> <!--- ********************* title bar menu ********************* ---> <div class="toolbar" id="toolbar"> </div> <div class="header addexaminee48">Create Lecture</div> <div class="clr"></div> </div> <div class="b"> <div class="b"> <div class="b"></div> </div> </div> </div> <noscript></noscript> <div class="clr"> </div> </div> </div> </div> <div id="border"><div><div></div></div></div> <!--- Error Message---> <div class="m" style="margin-bottom:-10px;"> <?php if ($sw==1){ echo "<div class='errorMessage'><div class='error32'></div>"; echo "<div class='errorTxt'>"; echo "$msg</div></div><br />"; $sw=0; } ?> </div> <!--- End Error Message---> <!--- Menu Border Ends! ---> <!--- main Border STARTS ---> <div class="clr"></div> </div> <div id="content-box"> <div class="border"> <div class="padding"> <div id="toolbar-box"> <div class="t"> <div class="t"> <div class="t"></div> </div> </div> <div class="m" style="padding-left:20px; padding-right:20px;" > <br /><div style="font-size:12px"><b>Title of Lecture</b></div> <hr/><br /> <?php echo implode(file("http://localhost/SRG_MAIN/admin/ckeditor/_samples/srg.html")); ?> <?php include ("includes/menu_footer.html");?> </div> <div class="clr"></div> </div> <div class="b"> <div class="b"> <div class="b"></div> </div> </div> </div> <noscript></noscript> <div class="clr"> </div> </div> </div> </div> <div id="border-bottom"><div><div></div></div></div> <!--- main Border ENDS ---> <?php include("includes/footer.html");?> </body> <!--java script prompting sucessfully added!--> <?php if($_GET['popup']==1){ echo "<script type='text/javascript'>window.location='create_examinee.php';alert('Examinee Sucessfully Added!');</script>"; } ?> </html> create_ckeditor_script.php <?php @session_start(); @include_once("class/class.php"); @$db=new DB(); @$db->connect(); $sql="INSERT INTO tbl_lecture( orno, lecture ) VALUES( '$_POST[ORNo]', '$_POST[lecture]' )"; @$db->add_account($sql); @$db->close(); ?> I really need to change may table in database can someone guide mo how to enable a chapter or category each time i will save a content if i will save a content, it will only output continuously i wanted to make it per chapter or per category what do i need to do from here I do have a sql table named "module" and a parent module may have a sub module. Each parent module can have a maximum of 9 sub modules of three per <td>. This is how this "module" table looks like: +-----------+------------------+----------+------+--------+---------------------+ | module_id | name | page_url | icon | parent | created_date | +-----------+------------------+----------+------+--------+---------------------+ | 1 | User Modules | | NULL | NULL | 2021-07-21 11:46:16 | | 2 | Items | | NULL | 1 | 2021-07-21 11:46:16 | | 3 | Add New Item | | NULL | 2 | 2021-07-21 11:46:16 | | 4 | View Item | | NULL | 2 | 2021-07-21 11:46:16 | | 5 | Category | | NULL | 2 | 2021-07-21 11:46:16 | | 6 | Brand | | NULL | 2 | 2021-07-21 11:46:16 | | 7 | Unit | | NULL | 2 | 2021-07-21 11:46:16 | | 8 | Purchase | | NULL | 1 | 2021-07-21 11:46:16 | | 9 | Add New Purchase | | NULL | 8 | 2021-07-21 11:46:16 | | 10 | view Purchase | | NULL | 8 | 2021-07-21 11:46:16 | | 11 | Due Invoice | | NULL | 8 | 2021-07-21 11:46:16 | | 12 | Return | | NULL | 8 | 2021-07-21 11:46:16 | | 13 | Purchase Log | | NULL | 8 | 2021-07-21 11:46:16 | | 14 | Inventory | | NULL | 1 | 2021-07-21 11:46:16 | | 15 | Stock Transfer | | NULL | 14 | 2021-07-21 11:46:16 | | 16 | Stock Adjustment | | NULL | 14 | 2021-07-21 11:46:16 | | 17 | Batch Control | | NULL | 14 | 2021-07-21 11:46:16 | | 18 | Stock Take | | NULL | 14 | 2021-07-21 11:46:16 | +-----------+------------------+----------+------+--------+---------------------+ My desired HTML table layout looks somthing similar to this attach image.
I would like to know how we can do it in php, if is possible. Thank you. Edited July 23 by thara I've a code that can create category if not existed the category & add this to the post. If category already exist then it will select the category. Here is my code snippet example : $mcptitle = 'Lenevo xiaoxin pad pro 2021'; //Geting Brand Name $brands = $mcptitle; $arr = explode(' ',trim($mcptitle)); $brand= $arr[0]; //Notice Brand name Detected //category Slug $catlink=sanitize_title($brand); //Finding category by name & geting id if($term = get_term_by( 'name', $brand, 'category' ) ){ $cat_id= $term->term_id; }else{ //creating category for not exists category $terms= wp_insert_term($brand, // the term 'category', // the taxonomy array( 'slug' => $catlink )); //geting new category id $cat_id= $terms['term_id']; //post start $post = array( 'post_author' => 1, 'post_content' => $content, 'post_status' => "publish", 'post_title' => $title, 'post_type' => "post", ); $post_id = wp_insert_post( $post, $wp_error ); //seting category wp_set_object_terms( $post_id, $cat_id, 'category' ); That works for create/add one category But I want to add multiple categories in it. Category array will be like this: $mcptitle = array("Volvo", "BMW", "Toyota"); Plz Can anyone help me about my thoughts. Thanks in advance. Hello, I have been searching and trying all sorts of ways to get my sub categories drop down to show the correct info after selecting a category from the main drop down but im getting stuck. It's pulling the categories and sub categories from the mysql database fine but no matter which main category i pick it keeps showing the same result in the sub category. My brother said i need to use some sort of onchange do this so the sub category list refreshs but everything i have tried doesn't work.. PLEASE could some one help. MANY MANY THANKS This is the category form Code: [Select] <select name="job_cats" style="width:165px"> <?PHP $query1 = "SELECT * FROM job_cats"; $result1 = mysql_query($query1) or die ("query 1 failed"); $count1 = mysql_num_rows($result1); for ($i = 0; $i < $count1; $i++) { $row1 = mysql_fetch_array($result1); $job_cats_title1 = $row1['title']; $job_cats_id1 = $row1['id']; echo '<option value="'.$job_cats_id1.'">'.$job_cats_title1.'</option>'; echo $job_cats_id1; } ?> </select> this would echo this in the main category list: cat1 cat2 cat3 cat4 this is the sub category form Code: [Select] <select name="job_sub_cats" style="width:165px"> <?PHP $query1 = "SELECT * FROM job_sub_cats WHERE job_cats_id = $job_cats_id1"; $result1 = mysql_query($query1) or die ("query 1 failed"); $count1 = mysql_num_rows($result1); for ($i = 0; $i < $count1; $i++) { $row1 = mysql_fetch_array($result1); $sub_cats_id1 = $row1['id']; $sub_cats_title1 = $row1['subTitle']; $cats_id1 = $row1['job_cats_id']; echo '<option value="'.$sub_cats_id1.'">'.$cats_id1.'</option>'; } ?> </select> this should echo this: 1 2 3 4 but it keeps echoing just the number 4. THANKS PLEASE HELP ricky Hi everyone, newbie to site looking for help with my tag/category page formatting.
I recently bought a plugin for masonry and have been trying to make it the display for posts on my blog pages as you can see he http://www.enduringepilepsy.com/_blog/ and http://www.enduringe...m/archive/_2013
It's been helping my design and page load overall (Note: I do use Google Page Speed Service)
But I cannot figure out how to be able to use this customizable masonry for my tag/category pages since they do no show the ability to edit on the Wordpress admin bar.
I've looked at the php code in my files, and while I have become more familiar with php in the yr since I moved to Wordpress, am unsure how to edit these pages without making a mess.
The plugin is http://codecanyon.ne...-plugin/7563340 My theme, called Inzin, is no longer sold, and the developer disappeared from online. So I have lost all support. I would really appreciate any help anyone could offer. Thank you!
Hi. I’m hoping someone can help me pull the styling/formatting from a static page onto a category template. The content is pulling fine, but it's not formatted/styled. Code used to pull content from static page onto custom category template: <?php $page = get_page_by_title( 'page-name' ); $content = apply_filters('the_content', $page->post_content); echo $content; ?> With the above code, the content is being pulled, but the formatting and styling is not being pulled. The following code is adapted to pull the styling/formatting: <?php $page = get_page_by_title( 'Wedding Venues in Costa Rica' ); $content = apply_filters('the_content', $page->post_content); echo do_blocks( $content );> It did not pull the styling/formatting. We’re using GeneratePress Pro + Generate Blocks (no page builder). The static page is built with Gutenberg and GenerateBlocks. By the way, I'mm not a coder or a developer. I know a little about this and about that, but this isn't my field of expertise. Could someone please suggest what can be done to this code to get it to pull the styling form the static page onto the custom category template? Thank you very much. Could somebody please point me in the right direction.... I want to block the US, AUS, NZ, CAN, IRE from the index.php of my site. But not the rest of the site. The following site (like many others) provides a pretty neat list for the htaccess http://www.ipinfodb.com/ip_country_block.php I did a test. I got the list for blocking the UK. After copying the UK list to my htaccess i couldn't view my site. The thing i don't get is... my ip address was not in the list but i was still blocked, The 1st 2 sets from my ip are '2.100' The only ip's in the list starting with 2 a deny from 2.24.0.0/13 deny from 2.96.0.0/13 deny from 2.120.0.0/12 deny from 2.136.0.0/13 How exactly is this all working? And what's the best way of blocking the above countries from just my index.php? Any links to manuals or anything here would be great... Thank You. John Hi Guys, This is what I am trying to do. I have multiple link one 1 page and when a user clicks on that link it will print that file for them. Code: [Select] page.php containts 20+ images image1 - Print image2 - Print image3 - Print etc.... <a href="page.php?cid=1">Print</a> <a href="page.php?cid=2">Print</a> <a href="page.php?cid=3">Print</a> So what I need to do is if user clicks cid=2 then it goes to page.php?cid=2 shows the image and prints with javascript. That is not a problem I already to this with html but I am changing over to php mysql due to simplicity and ease of use. and also to reduce to pages from 30+ pages down to 1 page for this section. so this is what I am having trouble with Code: [Select] switch($cid) case $cid { echo image and print } default { echo all images and print link } So the problem I am having is the case $cid The problem is that this is so simple and I have been playing with it for so long I don't see the fix. Good day everyone! I know this is possible but I do not know how to do it. I have a single page, this page has no dynamic content. I have a set of links. What I need is to have content placed on the page based on the link the user clicks. Example: I have pictures of animals. When the user click a Zebra, the Zebra info is placed on the page. So the page does not change, meaning the content on the page changes but not the page it self. The idea is instead of creating different html pages for each animal profile, the profile is generated to the page from a php include file. Is is this possible? Can anyone, some one please point me to how I can get this going. Thanks everyone! IC This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=323045.0 Hello I am having problems setting some security to a prize page on my website. What I need, is to make sure that a user cannot just refresh and get the price again. The price page is loaded in a frame so redirection is no good, and that doesn't stop the user from just hitting the "back" button and then refresh. Anyone have an idea how to do this the simple way? Hello can anyone help me out with code to create a 2 dimension array from 2 single dimension array. for example $path = array('base', 'category', 'subcategory', 'item'); $location=array('india','USA','UK','RUSSIA',); now i need to have a @D array which have the following structure $final[0]=array('base','india'); $final[1]=array('category','USA'); $final[2]=array('subcategory','UK'); $final[3]=array('item','RUSSIA'); I am creating a user inbox system. I am retrieving all the unread messages. Each message row contains a "reply" form. So say I have 10 messages showing on a single page. That's 10 forms. What I would like to know is how can I submit any one of the 10 forms and not have it affect the remaining 9 forms? Here is the basic code. if(isset($_POST['submit'])) { $post_message = trim($_POST['message']); $errors = array(); $db->beginTransaction(); if(empty($post_message)) { $errors[] = 'The message field can not be empty!'; } if(empty($errors)) { $db->commit(); echo 'success'; } else { $db->rollBack(); } } <form action="" method="post"> <fieldset> <textarea name="message" maxlength="10000" placeholder="What would you like to say?"></textarea> </fieldset> <fieldset> <input type="submit" name="submit" value="Submit" /> </fieldset> </form>
PHP script return 20 UL LIST values like, < ul >
A < /ul > How to display UL LIST into row wise 5 columns like
A B C D Hi, I've been scratching my head for a while now about how to do this, I'm relatively new to php and mysql and perhaps foolishly taking on creating a user area for a website. I have everything else working, all of my register account functions and confirmations and all of the login scripts etc. I have created a profile page which returns various information to the user (this bit works fine) and I've got some nice show/hide toggles running with some javascript/css but my intention is to allow the user to change thier information (e-mail address, contact phone number and also whether they are subscribed to the e-mail list), it also displays any support tickets or messages. So after the long intro, here's what I'm struggling with... I have a form in a visibility toggled <div> which submits a 'change_email' script, so a user wants to change their e-mail, clicks on change, the <div> appears, they bang in the new e-mail and hit submit. My php script appears to work (because it doesn't throw up any errors), until you realise that actually it's not updated the record in the db... I'm using mysql_query("UPDATE users SET email='$new_email' WHERE username='$user'"); Do I need to setup variables for all of the information in the db (name, username, password, email, contno etc etc) and include them in the command to get it to work or should that just pick the correct record and then update it? If that is the case is there a way I can include 'blank' variables so I don't have to set them all up... e.g. mysql_query("UPDATE users SET user='',password='',email='$new_email', etc WHERE username='$user'"); Many thanks in anticipation i don't know what this would fall under, but it sounds like php..........is there a way to make a form make a new page from a template........like I have a picture page and I can upload pictures from a form with a picture name....and that name turns into a /name.php file? does this make sense? please can you help me in this question , imt confused about it
Create a dice page, that allow the user to enter an integer (from1 to 6) and the program must generate a random number (from1 to 6). if the random number equals the users’ entered number an image with smiley facemust be displayed if not another image with sad face must be displayed. Also,you have to display the integer user entered and the program generated integer in the page.
Hi guyz, I am looking to create a dymanic comment box for my website where already logged in users can comment on webpages. It is quite a challenge getting to dynamically display only the comments a particular user posted on a web page. What I mean is I would like to be able to click on a page, see only the comments logged users posted on that page, and then post my own comment on that page. At the moment I created a comment box for my webpages but the issue is my posted comments on one particular page is displaying on all web pages with is comment system..This is the problem and it is very difficult to find helpful material hopefully you guyz can come to the rescue. Please guys any help or suggestions are more than welcome. Thanks Kdiamonds I'm using a popular PHP script for my web site, which uses main_1.htm for the header and footer, and inner_index.htm for the main part of the home page. Also, of course it has index.php. How can I set up a duplicates of these files to work on and test changes to the home page, before I actually deploy the changes on to my live site's home page? Thanks Whats going on PHPfreaks? So this is what I've been trying to do for the whole weekend and just can't figure it out. I want to let users create new pages on my site like wiki style but dont want a wiki or drupal or joomla or any of that. I know its possible with: $text = $_POST['text']; $file = fopen($text . ".php","x"); fwrite($file,"Welcome to your new page!"); but I'm not sure how to integrate it. For further clarification here's an example: You come to the site and there is a list of previously made user pages all with their own user generated name. What I want to have is a create new page button that opens a new page allows the user to upload images then submit it to the database and upon refresh of the page their page is now in the list. The create new page resets and is available for another user and on and on. Any help will be appreciated. I need to get this done it's driving me crazy. |