Jump to content

Novice@PHP

Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by Novice@PHP

  1. I want to echo the php code for execution. So when it echos it executes the PHP based on the condition if user is logged in. Thanks
  2. Tried suggestions and now it just outputs the code as plain text. Any ideas? Thanks
  3. I think the OP wants to actually output php code. Could well be wrong though... Following his logic it made me believe otherwise. I find it weird why he does not just do twit_connect(); as he clearly wants to show the twitter connect login. Oh I just picked the first piece of code I had pasted in my notepad. Need to dsipplay the google friend connect which doesn't disappear when logged in. Thanks every1 for your advice. I'm off to try the new suggestions.
  4. It doesn't create an error now but nothing displays. Any suggestions thanks
  5. I'm trying to output php with PHP. Example. <?php if ( is_user_logged_in() ) { echo '[b]<?php if(function_exists('twit_connect')){twit_connect();} ?>[/b]'; } else { echo 'Welcome, visitor!'; }; ?> I know I'm way off in what I'm trying to do. What do I need to do? Thanks On a side note Google is fruitless as usual. Sum1 should design a smart search engines for programmers. It would go down a treat.
  6. Absolutely awesome. Thank you very much,
  7. Thank you so much. That's it and working up until the second part where refer appears. Do you know what to put in the line below also? <img border='0' src='".$config_baseHREF."logos/".$product["refer"]."' alt='".$product["name"]."' /> Also I knew it would be hard to understand me. I'm only really new to PHP and know none of the terminology. I just learn by looking through other peeps code. Thanks.
  8. Yes that's it and the second part where refer appears is like the same? <img border='0' src='".$config_baseHREF."logos/".$product["refer"]."' alt='".$product["name"]."' /> Also I knew it would be hard to understand me. I'm only really new to PHP and knownone of the terminology. I just lern by looking through other peeps code. Thanks.
  9. Hey everyone hope you're fingers aren't too tired after all your hard days coding. I've just coded a lot of a web application but have hit a dead end in regards of calling an image forward. The code uses a name stored in the database to check for a picutre named the same as what the value is in the databse. The problem is I can't figure out how to get it toc check for and disaply the image. The term "refer" in the code is what I need to be able to add .gif .jpg or .png to. So it can check and display the correct image. <?php if (file_exists("logos/".$product["refer"])) { print "<a target='_BLANK' href='".tapestry_buyURL($product)."'><img border='0' src='".$config_baseHREF."logos/".$product["refer"]."' alt='".$product["name"]."' /></a>"; } else { print " "; } ?> All help is appreciated. Also just to note I'm still a total noob so if my explanation doesn't make much sense I'll be more than glad to hear some advice on what way I should say this and answers any questions. Thanks.
  10. To add I am using localhost Hdirect1 and pass. My guess is that loclahost isn't correct as I'm using directory/project Hdirect1?
  11. Hi on recommendation of a fewllo php freaks member I got Wamp though am having an issue with getting my database connected with my CMS. I have a project called HDirect1 and a databse also called the same which I added a user with all privilidges to. Though when I add the database details into the config file it doesn't connect and always returns a 500 internal server error. I guess its something simple but await the answers from the experts. Thanks everyone,
  12. Super stuff all is working again. Thank you.
  13. Where abouts do I put it? Thanks else { if (EDIR_THEME) { } else { if ($extrastyle) { if (is_array($extrastyle)) { foreach ($extrastyle as $extra_style) { echo "<link href=\"".$extra_style."\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\n"; } } else { echo "<link href=\"".$extrastyle."\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\n"; } } }
  14. I'm new and looking a few pieces of advice in regards of coding. Firstly is the issue I'm having: Parse error: syntax error, unexpected $end in /home/martyharris/public_html/layout/header.php on line 172 It is something to do with this code. Note: My PHP Short Code in Php.ini is On. <?php header("Expires: Sat, 01 Jan 2000 00:00:00 GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", FALSE); header("Pragma: no-cache"); header("Content-Type: text/html; charset=iso-8859-1",TRUE); include(INCLUDES_DIR."/code/headertag.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" lang="en"> <head> <? $headertag_title = (($headertag_title) ? ($headertag_title) : (EDIRECTORY_TITLE)); ?> <title><?=$headertag_title?></title> <meta name="author" content="SisDir - Classificados" /> <? $headertag_description = (($headertag_description) ? ($headertag_description) : (EDIRECTORY_TITLE)); ?> <meta name="description" content="<?=$headertag_description?>" /> <? $headertag_keywords = (($headertag_keywords) ? ($headertag_keywords) : (EDIRECTORY_TITLE)); ?> <meta name="keywords" content="<?=$headertag_keywords?>" /> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="ROBOTS" content="index, follow" /> <? /* EDIRECTORY STYLES */?> <link href="<?=DEFAULT_URL?>/scripts/jquery/thickbox/thickbox.css" rel="stylesheet" type="text/css" media="all" /> <? if (EDIR_THEME) { include(THEMEFILE_DIR."/".EDIR_THEME."/".EDIR_THEME.".php"); } else { ?> <link href="<?=DEFAULT_URL?>/layout/general_structure.css" rel="stylesheet" type="text/css" /> <link href="<?=DEFAULT_URL?>/layout/preview.css" rel="stylesheet" type="text/css" /> <? } ?> <?=system_getNoImageStyle($cssfile = true);?> <? # ---------------------------------------------------------------------------------------------------- # * HEADER CONSTANTS # ---------------------------------------------------------------------------------------------------- // EXTRA STYLE SAMPLES // ONE CSS $extrastyle = DEFAULT_URL."/layout/xxx.css"; // TWO CSS $extrastyle = array(DEFAULT_URL."/layout/aaa.css", DEFAULT_URL."/layout/bbb.css"); if (EDIR_THEME) { } else { if (EDIR_THEME) { } else { if ($extrastyle) { if (is_array($extrastyle)) { foreach ($extrastyle as $extra_style) { echo "<link href=\"".$extra_style."\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\n"; } } else { echo "<link href=\"".$extrastyle."\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\n"; } } } ?> <? // SPECIFIC STYLESHEET TO MAC OS AND SAFARI BROWSER - FIX BUG WITH THE NAVBAR AND BUTTON if ((strpos($_SERVER['HTTP_USER_AGENT'], "Mac") !== false) or (strpos($_SERVER['HTTP_USER_AGENT'], "Safari") !== false)) echo "<link href=\"".DEFAULT_URL."/layout/general_macfix.css\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\n"; ?> <? // SPECIFIC STYLESHEET TO LINUX OS - FIX BUG WITH THE NAVBAR if (strpos($_SERVER['HTTP_USER_AGENT'], "Linux") !== false) echo "<link href=\"".DEFAULT_URL."/layout/general_linuxfix.css\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\n"; ?> <? /* EDIRECTORY THEME STYLESHEET */ ?> <link href="<?=DEFAULT_URL?>/layout/color/<?=LAYOUT_THEME_COLOR?>.css" rel="stylesheet" type="text/css" media="all" /> <? /* EDIRECTORY javascript */?> <script type="text/javascript"> <!-- DEFAULT_URL = "http://www.coolzones.net"; --> </script> <? /* EDIRECTORY Javascript */?> <script type="text/javascript"> <!-- DEFAULT_URL = "http://www.YOURWEBSITEHERE.com"; --> </script> <script src="<?=DEFAULT_URL?>/scripts/lang.js.php" language="javascript" type="text/javascript"></script> <script src="<?=DEFAULT_URL?>/scripts/common.js" language="javascript" type="text/javascript"></script> <script src="<?=DEFAULT_URL?>/scripts/location.js" language="javascript" type="text/javascript"></script> <script src="<?=DEFAULT_URL?>/scripts/advancedsearch.js" language="javascript" type="text/javascript"> </script> <script src="<?=DEFAULT_URL?>/scripts/contactclick.js" language="javascript" type="text/javascript"></script> <script src="<?=DEFAULT_URL?>/scripts/cookies.js" language="javascript" type="text/javascript"></script> <script src="<?=DEFAULT_URL?>/scripts/jquery.js" language="javascript" type="text/javascript"></script> <script src="<?=DEFAULT_URL?>/scripts/jquery/jquery.autocomplete.js" type="text/javascript"></script> <link href="<?=DEFAULT_URL?>/scripts/jquery/jquery.autocomplete.css" rel="stylesheet" type="text/css" media="all" /> <script src="<?=DEFAULT_URL?>/scripts/jquery/jquery.thickbox.js" type="text/javascript"></script> <script src="<?=DEFAULT_URL?>/scripts/review.js" language="javascript" type="text/javascript"></script> <link href="<?=DEFAULT_URL?>/scripts/jquery/thickbox/thickbox.css" rel="stylesheet" type="text/css" media="all" /> <link href="<?=DEFAULT_URL?>/layout/general_dynamic.php" rel="stylesheet" type="text/css" media="all" /> </head> <body> <div class="topNavbar"> <div class="wrapper"> <? include(EDIRECTORY_ROOT."/layout/langnavbar.php"); ?> </div> </div> <? include(EDIRECTORY_ROOT."/layout/subnavbar.php"); ?> <? if ((strpos($_SERVER["PHP_SELF"], "/".LISTING_FEATURE_NAME) !== false) || (strpos($_SERVER["PHP_SELF"], "claim.php") !== false)) { ?> <span class="isHidden" id="defaultURL"><?=DEFAULT_URL?></span> <? } ?> <? /* LAYOUT WRAPPER */ ?> <div class="wrapper"> <? /* HEADER */ ?> <div class="header" <?=system_getHeaderLogo();?>> <h1 class="logo"> <a href="<?=DEFAULT_URL?>/index.php" rel="nofollow" rel="nofollow" target="_parent" class="logoLink" title="<?=$headertag_title?>"><span><?=$headertag_title?></span></a> </h1> <? $banner = system_showBanner("TOP", $category_id, $banner_section); if ($banner) { ?> <div class="advertisement"> <div class="banner"><?=$banner?></div> <span class="advertisementLabel"><?=system_showText(LANG_ADVERTISER);?></span> <span class="advertisementLink"><a href="<?=((SSL_ENABLED == "on" && FORCE_MEMBERS_SSL == "on" && FORCE_ORDER_SSL == "on") ? SECURE_URL : NON_SECURE_URL)?>/order_banner.php?type=1"><?=system_showText(LANG_DOYOUWANT_ADVERTISEWITHUS);?></a></span> </div> <? } ?> </div> <? /* NAVBAR */ ?> <ul class="navbar"> <li><a href="<?=DEFAULT_URL?>/index.php" <?=((strpos($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"], $_SERVER["SERVER_NAME"].EDIRECTORY_FOLDER."/index.php") !== false) ? "class=\"menuActived\"" : "")?>><?=ucwords(LANG_BUTTON_HOME);?></a></li> <li><a href="<?=LISTING_DEFAULT_URL?>/" <?=((strpos($_SERVER["PHP_SELF"], "/".LISTING_FEATURE_NAME) !== false) ? "class=\"menuActived\"" : "")?>><?=ucwords(LANG_LISTING_FEATURE_NAME_PLURAL);?></a></li> <? if (EVENT_FEATURE == "on") { ?> <li><a href="<?=EVENT_DEFAULT_URL?>/" <?=((strpos($_SERVER["PHP_SELF"], "/".EVENT_FEATURE_NAME) !== false) ? "class=\"menuActived\"" : "")?>><?=ucwords(LANG_EVENT_FEATURE_NAME_PLURAL);?></a></li> <? } ?> <? if (CLASSIFIED_FEATURE == "on") { ?> <li><a href="<?=CLASSIFIED_DEFAULT_URL?>/" <?=((strpos($_SERVER["PHP_SELF"], "/".CLASSIFIED_FEATURE_NAME) !== false) ? "class=\"menuActived\"" : "")?>><?=ucwords(LANG_CLASSIFIED_FEATURE_NAME_PLURAL);?></a></li> <? } ?> <? if (ARTICLE_FEATURE == "on") { ?> <li><a href="<?=ARTICLE_DEFAULT_URL?>/" <?=((strpos($_SERVER["PHP_SELF"], "/".ARTICLE_FEATURE_NAME) !== false) ? "class=\"menuActived\"" : "")?>><?=ucwords(LANG_ARTICLE_FEATURE_NAME_PLURAL);?></a></li> <? } ?> <li><a href="<?=PROMOTION_DEFAULT_URL?>/" <?=((strpos($_SERVER["PHP_SELF"], "/".PROMOTION_FEATURE_NAME) !== false) ? "class=\"menuActived\"" : "")?>><?=ucwords(LANG_PROMOTION_FEATURE_NAME_PLURAL);?></a></li> <li><a href="<?=DEFAULT_URL?>/advertise.php" <?=((strpos($_SERVER["PHP_SELF"], "/advertise.php") !== false) ? "class=\"menuActived\"" : "")?>><?=ucwords(LANG_MENU_ADVERTISE);?></a></li> <li><a href="<?=DEFAULT_URL?>/contactus.php" <?=((strpos($_SERVER["PHP_SELF"], "/contactus.php") !== false) ? "class=\"menuActived\"" : "")?>><?=ucwords(LANG_MENU_CONTACT);?></a></li> </ul> <? /* CONTENT */?> <div class="content"> <? include(EDIRECTORY_ROOT."/search.php"); ?> The other question I have is about developing without a hosting account. Is that possible?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.