Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 26
  1. #1
    New Coder
    Join Date
    Jun 2010
    Posts
    52
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Making a simple website w/ PHP

    I am new to PHP because my web server plans never included it til now...

    Also I bought a template...

    But i dont know how to use the php in my site!

    what is wrong with http://0324e96.netsolhost.com/ep.php

  • #2
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,536
    Thanks
    45
    Thanked 259 Times in 256 Posts
    Its exactly as the error says: the function is undefined. Why that is, have no idea. What is the template for? Are you using a standard CMS? There's no way we can guess or even help without details, and if its a non-standard CMS, you'll have to read code to figure out where it is.

    In all honesty, starting to learn PHP with prebuilt code is a terrible way... you'll stumble, you'll learn things strangely, sometimes wrong, etc. Start your own basic projects and learn them, after some lessons in the basics.

  • #3
    New Coder
    Join Date
    Jun 2010
    Posts
    52
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Its a template for my website from http://www.gabfirethemes.com/demos/blognews/

    I know this isnt a good idea, but i never knew it had php and now i HAVE to get this working because it is costing me.

    I dont know what is wrong with this code or what CMS even is

    Code:
    <!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>Untitled Document</title>
    <link href="http://0324e96.netsolhost.com/custom.css" rel="stylesheet" type="text/css" />
    <link href="http://0324e96.netsolhost.com/style.css" rel="stylesheet" type="text/css" />
    <link href="http://0324e96.netsolhost.com/styles/default.css" rel="stylesheet" type="text/css" />
    	<!--[if IE 6]>
    	<style type="text/css" media="screen" />
    		#subnews .subnewspost {margin-left:8px}
    		#primartTopMidCol {margin-right:0;}
    	</style>
    	<![endif]-->
    	
    	<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php if ( $bnews_options["feedlink"] <> "" ) { echo $bnews_options["feedlink"]; } else { echo bloginfo('rss2_url'); } ?>" />	
    	<link rel="alternate" type="text/xml" title="RSS .92" href="<?php if ( $bnews_options["feedlink"] <> "" ) { echo $bnews_options["feedlink"]; } else { echo bloginfo('rss_url'); } ?>" />	
    	<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />	
    	<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />	
    	<?php wp_get_archives('type=monthly&format=link'); if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
    	<?php wp_head(); ?>
    
    	<?php if($bnews_options['enCufon'] == 1) { ?>
    		<script type="text/javascript">
    			Cufon.replace('#logo');
    			Cufon.replace('.titleCatName');
    			Cufon.replace('.widgetbgTitle');
    			Cufon.replace('.widgetbgTitle');
    			Cufon.replace('#comments');
    			Cufon.replace('#leaveComment');
    		</script>
    	<?php } ?>
    </head>
    
    <body>
    
    <?php /* Define id number of current category for category based advertisement */
    	if(is_category() || is_single()) {
    		$category = get_the_category();
    		$currentcat = $category[0]->cat_ID;
    	}
    ?>
    
    <?php if($bnews_options['enable728'] == 1) { ?>
    	<div id="topad">
    		<?php
    			if(file_exists(TEMPLATEPATH . '/ads/sitewide_728x90/'.$currentcat.'.php') && (is_single() || is_category())) {
    				include_once(TEMPLATEPATH . '/ads/sitewide_728x90/'.$currentcat.'.php');
    			}
    			else {
    				include_once(TEMPLATEPATH . '/ads/sitewide_728x90.php');
    			}
    		?>
    	</div>
    <?php } ?>
    
    <div id="wrapper">
    
    	<div id="navpages">
    			<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Nav_Pages') ) : ?>
    				<?php /* NAV MENU 1 */
    					if($bnews_options['ennav1'] == 1) { 
    						wp_nav_menu( array('theme_location' => 'Header_Page_Nav', 'container' => false));
    					} else { ?>
    						<ul>
    							<?php wp_list_pages('sort_column=menu_order&title_li=&exclude='.$bnews_options["excludePageNav"]); ?>
    							<li><a href="#" class="gab_connect"><?php _e('Stay Connected','Blognews'); ?></a>
    								<ul>
    									<li><a class="gab_rss" href="<?php if ( $bnews_options["feedlink"] <> "" ) { echo $bnews_options["feedlink"]; } else { echo bloginfo('rss2_url'); } ?>" rel="nofollow" title="<?php _e('Subscribe to latest posts in RSS','Blognews'); ?>"><?php _e('Latest Posts in RSS','Blognews'); ?></a>
    										<ul>
    											<?php
    												$categories = get_categories('hide_empty=1');
    												foreach ($categories as $cat) 
    												{
    													echo '<li><a class="gab_rss" rel="nofollow" href="'.get_category_feed_link($cat->cat_ID, '').'">'. $cat->cat_name.'</a></li>';
    												}
    											?>				
    										</ul>
    									</li>
    									<li><a class="gab_rss" href="<?php bloginfo('comments_rss2_url'); ?>" rel="nofollow" title="<?php _e('Subscribe to latest comments in RSS','Blognews'); ?>"><?php _e('Latest Comments in RSS','Blognews'); ?></a></li>
    									<?php if($bnews_options['enableMailSubscribe'] == 1) { ?><li><a class="gab_email" href="<?php echo $bnews_options["emailSubscribeLink"]; ?>" rel="nofollow" title="<?php _e('Subscribe to latest posts via email','Blognews'); ?>"><?php _e('Subscribe by e-mail','Blognews'); ?></a></li><?php } ?>
    									<?php if($bnews_options['enabletwitterUp'] == 1) { ?><li><a class="gab_twitter" href="http://www.twitter.com/<?php echo $bnews_options["twitterusername"]; ?>" rel="nofollow" title="<?php _e('follow on twitter','Blognews'); ?>"><?php _e('Follow us on Twitter','Blognews'); ?></a></li><?php } ?>
    									<?php if($bnews_options['enablefacebook'] == 1) { ?><li><a class="facebook.png" href="<?php echo $bnews_options["linktofacebook"]; ?>" rel="nofollow" title="<?php _e('Connect on facebook','Blognews'); ?>"><?php _e('Connect on Facebook','Blognews'); ?></a></li><?php } ?>
    								</ul>
    							</li>
    						</ul>
    				 <?php } ?>
    			<?php endif; ?>
    
    		<div id="search">
    			<?php get_search_form(); ?>
    		</div><!-- /search -->
    		<div class="clear"></div>
    	</div>
    	
    	<div id="header">
    
    		<?php if($bnews_options['headerimage'] == 1) { ?>
    			<a href="<?php bloginfo('url'); ?>" title="<?php bloginfo(description); ?>">
    				<img src="<?php echo $bnews_options["himageurl"]; ?>" style="maximum-width:970px;" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('name'); ?>"/>
    			</a>
    		<?php } else { ?>
    	
    			<div id="logo" style="padding:<?php echo $bnews_options["logoMarginTop"]; ?>px 0 0 <?php echo $bnews_options["logoMarginLeft"]; ?>px;">
    				<!-- LOGO -->
    				<!-- If display Image Logo is activated -->
    				<?php if($bnews_options['enableLogo'] == 1) { ?>
    					<a href="<?php bloginfo('url'); ?>" title="<?php bloginfo(description); ?>">
    						<img src="<?php echo $bnews_options["logoUrl"]; ?>" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('name'); ?>"/>
    					</a>
    				<?php } ?>
    
    				<!-- If text is activated to be displayed as logo -->
    				<?php if($bnews_options['enableLogo'] == 0) { ?>
    					<h1>
    					<a href="<?php bloginfo('url'); ?>" title="<?php bloginfo(name); ?>">
    						<?php echo $bnews_options["titleSiteNameFirstRow"]; ?>
    						<span><?php echo $bnews_options["titleSiteNameSecondRow"]; ?></span>
    					</a>
    					</h1>
    				<?php } ?>
    			</div><!-- /logo -->
    		
    			<div class="banner">
    				<?php
    					if(file_exists(TEMPLATEPATH . '/ads/sitewide_468x60header/'.$currentcat.'.php') && (is_single() || is_category())) {
    						include_once(TEMPLATEPATH . '/ads/sitewide_468x60header/'.$currentcat.'.php');
    					}
    					else {
    						include_once(TEMPLATEPATH . '/ads/sitewide_468x60header.php');
    					}
    				?>
    			</div><!-- /banner -->
    		<?php } ?>
    	</div><!-- /header -->
    	
    	<div class="clear"></div>		
    	
    	<div id="navcats">
    		<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Nav_Cats') ) : ?>
    			<?php /* NAV MENU 2 */
    				if($bnews_options['ennav2'] == 1) { 
    					wp_nav_menu( array('theme_location' => 'Header_Category_Nav', 'container' => false));
    				} else { ?>
    					<ul>
    						<li class="first<?php if(is_home() ) { ?> current-cat<?php } ?>"><a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('description'); ?>"><?php _e('Home','Blognews'); ?></a></li>
    						<?php wp_list_categories('orderby='.$bnews_options["orderBy"].'&order='.$bnews_options["order"].'&title_li=&exclude='.$bnews_options["excludeCategories"]); ?>
    					</ul>
    			 <?php } ?>
    		<?php endif; ?>
    	</div>
    	
    	<div class="clear"></div>	
    
    
    <?php get_header(); ?> 
    	<div id="primaryTopWrapper">
    		<div id="featuredContent">
    
    			<div id="featuredNav">
    				<div id="paginate-featured-slider"></div>
    				<span class="featuredViewAll"><a href="<?php echo get_category_link($bnews_options["featuredCatID"]);?>"><?php _e('View All','Blognews'); ?></a></span>
    				<div class="clear"></div>
    			</div>
    			
    			<?php if (intval($bnews_options["feaPostCount"]) > 0 ) { ?>
    				<!-- featured entries -->
    				<div id="featured-slider" class="sliderwrapper">
    					<?php 
    					$count = 1;
    					$gabquery = new WP_Query();$gabquery->query('showposts='.$bnews_options["feaPostCount"].'&cat='.$bnews_options["featuredCatID"]); 
    					while ($gabquery->have_posts()) : $gabquery->the_post();
    					?>
    					<div class="contentdiv">
    						<div class="sliderPostPhoto">
    
    							<?php 
    							gab_media(array(
    								'name' => 'blgn-featured', 
    								'enable_video' => '1', 
    								'enable_thumb' => '1', 
    								'media_width' => '480', 
    								'media_height' => '270', 
    								'thumb_align' => 'alignnone', 
    								'enable_default' => '1',
    								'default_name' => 'featured.jpg'
    								)); 
    							?>
    
    							<?php if (($gab_flv == '') and ($gab_video == ''))  { ?>
    								<div class="sliderPostInfo">
    									<h2 class="featuredTitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    								</div>
    							<?php } ?>
    						</div><!-- end of sliderphoto/video -->
    
    						<!-- Slider Post Excerpt -->
    						<div class="featuredPost lastPost">
    							<p>
    								<?php if($bnews_options['enableAName'] == 1) { ?>
    									<span class="author"><?php the_author_posts_link(); ?></span> 
    								<?php } ?>
    								
    								<?php if($bnews_options['enableDate'] == 1) { ?>
    									<span class="date"><?php the_time($bnews_options["timeFormat"]); ?> | </span>
    								<?php } ?>
    								
    								<?php print string_limit_words(get_the_excerpt(), 50); ?>&hellip;
    							</p>
    							
    							<span class="featuredPostMeta">
    								<?php the_time($bnews_options["dateFormat"]); ?> / <?php comments_popup_link(__('No Comment','Blognews'), __('1 Comment','Blognews'), __('% Comments','Blognews'));?> / <a href="<?php the_permalink() ?>" rel="bookmark"><?php _e('Read More &raquo;','Blognews'); ?></a><?php edit_post_link(__('Edit','Blognews'),' / ',''); ?>
    							</span>
    						</div><!-- end of featuredpost (post excerpt) -->
    						
    					</div><!-- end of contentdiv -->
    					<?php $count++; endwhile; wp_reset_query(); ?>
    				</div><!-- end of #featured-slider -->
    
    				<script type="text/javascript">
    					featuredcontentslider.init({
    						id: "featured-slider", //id of main slider DIV
    						contentsource: ["inline", ""], //Valid values: ["inline", ""] or ["ajax", "path_to_file"]
    						toc: "#increment", //Valid values: "#increment", "markup", ["label1", "label2", etc]
    						nextprev: ["<?php _e('Prev','Blognews'); ?>", "<?php _e('Next','Blognews'); ?>"], //labels for "prev" and "next" links. Set to "" to hide.
    						revealtype: "<?php if($bnews_options['revealtype'] == 1) { echo 'click'; } else { echo 'mouseover'; } ?>", //Behavior of pagination links to reveal the slides: "click" or "mouseover"
    						enablefade: [true, 0.4], //[true/false, fadedegree]
    
    THATS PART OF IT, OVERALL ITS TOO LONG

  • #4
    New Coder
    Join Date
    Jun 2010
    Posts
    52
    Thanks
    3
    Thanked 0 Times in 0 Posts
    <b>Fatal error</b>: Call to undefined function bloginfo() in <b>/data/20/2/10/40/2336692/user/2565619/htdocs/ep.php</b> on line <b>16</b><br />

    LINE 16:

    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php if ( $bnews_options["feedlink"] <> "" ) { echo $bnews_options["feedlink"]; } else { echo bloginfo('rss2_url'); } ?>" />

  • #5
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,536
    Thanks
    45
    Thanked 259 Times in 256 Posts
    This is a wordpress template. Is your wordpress running ok?

  • #6
    New Coder
    Join Date
    Jun 2010
    Posts
    52
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Its a wordpress template?

    I heard it was but didnt understand wordpress.

    What do i do from here for the wordpress template? I am lost

  • #7
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,536
    Thanks
    45
    Thanked 259 Times in 256 Posts
    This is what I meant by getting ahead of yourself. Wordpress is a blogging software/CSM.

    http://wordpress.org/

    Its kinda like tryin to use the internet without realizing you need need a modem. Wordpress is thankfully easy to setup, and themes are easy to install. But if you bought the template to use as a site template, you have A LOT of work to do.

  • #8
    New Coder
    Join Date
    Jun 2010
    Posts
    52
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Ok, I downloaded that folder but where do i start off?

    Do I use my dreamweaver?

  • #9
    Regular Coder poyzn's Avatar
    Join Date
    Nov 2010
    Posts
    266
    Thanks
    2
    Thanked 61 Times in 61 Posts
    you should start wordpress installation.
    just upload wordpress to your host and open your site. Wordpress will ask several questions and install itself, then
    put your theme directory into /wp-content/themes/ and choose taht theme in admin account
    Last edited by poyzn; 11-15-2010 at 12:32 PM.

  • #10
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,502
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    Neoweatherguy,
    PM me about this.
    More info on your webhost, and what your site is going to be about.

  • #11
    Regular Coder
    Join Date
    Oct 2010
    Location
    San Antonio Tx
    Posts
    251
    Thanks
    12
    Thanked 11 Times in 11 Posts
    installing wordpress isn't that hard usually, alot of hosts have 1 click installation with themes already installed all you gotta do is pick one and installing a theme isn't hard either if you've purchased a premade...I would invest in a host that has the 1 click installation since you are completly lost it'll save you alot of frustration and headaches and like you said money as well

  • #12
    Regular Coder
    Join Date
    Jul 2010
    Posts
    149
    Thanks
    0
    Thanked 5 Times in 5 Posts

    Include wp-load.php file

    When i am looking your site it's display error like below

    Fatal error: Call to undefined function bloginfo() in /data/20/2/10/40/2336692/user/2565619/htdocs/ep.php on line 16

    bloginfo() is inbuilt wordpress function but it not call or find this function.

    So please check you main folder in wordpress wp-load.php file is exists or not.
    If it exists then include wp-load.php file in your ep.php file with correct path and then check it its included perfectly or not.

    Hope your error is sorted after this.

  • #13
    New Coder
    Join Date
    Jun 2010
    Posts
    52
    Thanks
    3
    Thanked 0 Times in 0 Posts
    I will upload my wordpress files to my host. But what do I do because the host doesnt have any material on the supposive homepage, so how would uploading wordpress files make it different.

    Also do I upload these in the >CGIBIN or >HTDOCS?
    And if it is the HTDOCS folder (where i uploaded everything else page wise) do I make a folder in their called wordpress or just upload them?

    Thanks.

    (PS: The host is "Network Solutions" nsHosting Shared)

  • #14
    Regular Coder poyzn's Avatar
    Join Date
    Nov 2010
    Posts
    266
    Thanks
    2
    Thanked 61 Times in 61 Posts
    upload to htdocs,
    make sure you have wp-admin, wp-content, index.php and other files immediately in htdocs

    then try to open your site. wordpress must invite you to start the installation
    Last edited by poyzn; 11-15-2010 at 06:28 PM.

  • #15
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,536
    Thanks
    45
    Thanked 259 Times in 256 Posts
    Wait, quick question: do you have/have access to a database? If not, you're out of luck (I don't think WP has a flat-file setup).

    If you do, you upload it to whatever your websites home directory is (or sub directory if you want it somewhere other then your home page), then just follow the instructions as listed on the WP website.


  •  
    Page 1 of 2 12 LastLast

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •