Jump to content

mme

Members
  • Posts

    65
  • Joined

  • Last visited

    Never

Everything posted by mme

  1. mme

    Security

    Hi, I am currently working on an Invoice System using PHP and MySQL. However I was just wondering if the system I am using is secure enough. The Client gets a link like this: mysite.com/?customerid=b3e470c55aad30eb38ee52eec1d8cb52 Each client has a unique "id" I also have an ID for the administrative back-end. I do clean the GET variable before querying the database though. Do I need to secure this with anything else or is this enough, as this is my first time creating anything with PHP and MySQL together. Thanks, mme
  2. mme

    Root Path

    Thanks so much! All solved now
  3. mme

    Root Path

    Sorry I misunderstood your question, Always strip the last 2. Thanks,
  4. mme

    Root Path

    Yes the same 'parts'
  5. mme

    Root Path

    I have a random string with a value of: /def/g/qaz/pol/cxz/cba/abc Now I wish to remove /cba/abc from the end.
  6. Hi, I have a dynamic variable like this: /def/g/qaz/pol/cxz/cba/abc I only wish to keep this: /def/g/qaz/pol/cxz How would I do this? Thanks, - mme
  7. I am trying to use functions to insert code into other pages I have a php file with multiple functions inside: function md_chef_record() { $md_chef_ip=$_SERVER['REMOTE_ADDR']; $md_chef_time=date("D M j G:i:s T Y"); } function md_chef_image() { $output .= "<img src='$siteurl/wp-content/uploads/wpsc/product_images/no-image-uploaded.gif' title='".$special['name']."' alt='".$special['name']."' /><br />"; } Then in multiple files I have this in the top of the php file if (file_exists('wp-content/plugins/md-chef/md-chef-f.php')) { require_once('wp-content/plugins/md-chef/md-chef-f.php');} else {echo("ERROR");} Then throughout the files different functions are placed to insert the pieces of code. However it doesn't seem to work any suggestions? Thanks MME
  8. Thanks for your quick reply and solution. All working now
  9. I am currently attempting to create a list of downloads using php arrays <?php $count=0; // Function function dwn($id,$name,$size,$link,$text) { $download_link[$id]=$link; $download_size[$id]=$size; $download_text[$id]=$text; $download_name[$id]=$name; $count+=1; } dwn(0,'Test 00','200KB','test.zip','This is testing 00'); dwn(1,'Test 01','210KB','test1.zip','This is testing 01'); dwn(2,'Test 02','220KB','test2.zip','This is testing 02'); ?> Then to display the information <?php if ($count!==0) { for ($i = $count-1; $i > -1; $i--) { echo('<div class="download"> <div class="download_button"><a href="' .$download_link[$i]. '"><img src="img/blank.gif" alt="Download" /></a></div> <div class="size">File Size:<br />' .$download_size[$i]. '</div> <div class="download_txt_h">' .$download_name[$i]. '</div><div class="download_txt">' .$download_text[$i]. '</div> </div> <p />'); } } else { echo('<div class="download_txt">No Downloads Found!</div>'); } ?> However it doesn't display anything and the variable $count is 0.
  10. Thanks so much all working now
  11. Hi I would like to make it only display 3 entries how would I do this? <?php require_once 'rss/rss_fetch.inc'; $url = 'http://mysite.com/rss' ; $rss = fetch_rss($url); if ( $rss and !$rss->ERROR) { foreach ($rss->items as $item ) { echo ' <p><a href="' . $item[link] . '" target="_blank"><b>' . $item[title] . '</b></a><br / >'; echo '<i>Publish Date: ' . $item[pubdate] . '</i><br / >'; echo $item[ description ] . ' </p>' ; } } else { echo '<b>RSS Error: ' . $rss->ERROR . ' </b><br / ><br />' ; } ?> Thanks
  12. How would I do that and what would I put in it? Thanks
  13. Hi I am trying to send a html email with dynamic text however I get an email filled with html code. in my index.php $msg_m="This is some dynamic text<br />this is amother line of random text"; require('email_template.php'); $ArrayLNTargets = array("\r\n", "\n\r", "\n", "\r", "\t"); $msg = str_replace($ArrayLNTargets, '', $msg); $header = "From: \"$site_name\" <$from_email>\n"; $header .= "Sender: $from_email\n"; Mail($addr, "$site_name Invitation", $msg, $header); in email_template.php <?php $msg='<html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=iso-8859-1"> <style type="text/css"> TD{FONT-FAMILY:Verdana,Tahoma,Arial,"Sans Serif";FONT-SIZE:10pt} BODY{FONT-FAMILY:Verdana,Tahoma,Arial,"Sans Serif";FONT-SIZE:10pt} a {color:#333333; text-decoration:underline; } a:hover { color:#666666; } .style2 { font-size: 8pt; font-style: italic; } .style7 { font-size: 12pt; font-weight: bold; } </style> <!-- HTML-FORMATTED MESSAGE BELOW The remainder of this message is in HTML format for use by email clients that can properly display it. If you are seeing this message, it is because your email client cannot properly display HTML. You can ignore the HTML code you will see below. --> </head> <body bgColor="#eeeeee"> <table cellSpacing="1" cellPadding="0" width="700" bgColor="#fff" border="0" align="center"> <tr> <td><img src="http://mydomain.com/email_header.jpg" alt="Header" border="0"></td> </tr> <tr> <td bgcolor="white"> <table cellSpacing="0" cellPadding="15" width="100%"><tr><td><hr size="0" color="#CCCCCC"> <table cellspacing="0" cellpadding="10" width="100%"><tr><td><table cellspacing="0" cellpadding="10" width="100%"> <tr> <td> <p><span class="style2">This is an automated email</span><br> <br> <span class="style7">A Title</span></p> <p>' .$msg_m. '<br> </strong></a></p> </td> </tr></table></td></tr></table> <hr size="0" color="#CCCCCC"> <center> <br><small>© <a href="#l">Site name</a></small><br> </center></td></tr> </table></td></tr></table> </body></html>'; ?> Thanks
  14. Hi I have a website where the main banner changes every 3-5 seconds and loads the next image from the array below is there any way to make it automatically display the next image in sequence without having to add it into the array manually? As all my banner images are stored in mysite.com/site/banners/ and all images are jpg files with the filename as a number eg; 1.jpg ,2.jpg ect... <script type="text/javascript"> countArticle = 0; var mySlideData = new Array(); mySlideData[countArticle++] = new Array('http://mysite.com/site/banners/1.jpg','http://mysite.com/site/shop/','',''); mySlideData[countArticle++] = new Array('http://mysite.com/site/banners/2.jpg','http://mysite.com/site/shop/','Item 2 Title','Item 2 Des'); </script> Thanks
  15. Thanks so much All working now
  16. Hi why doesn't this code work ? Its supposed to include the the relevant page with the .html extension except when it is the testimonials page then its a .php extension <? $pages = array("home","about","where","how","testimonials","contact","site_map"); $go=$pages[0] . ".html"; for ($i=0;$i<count($pages);$i++) { if (strtolower($_GET['page'])==$pages[$i]) { if ($pages[$i]="testimonials") {$go=$pages[$i] . ".php";} else { $go=$pages[$i] . ".html";} break; } } include($go); ?>
  17. mme

    Ajax and IE

    doesn't anybody have any solutions to this?
  18. You can also download and install STS this allows you to easily make templates for oscommerce http://www.oscommerce.com/community/contributions,1524
  19. Hi I am currently using this script from dynamic drive http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm however when using it locally it works with FF but not with IE. however when uploaded to a server it works with no problems. Thanks - MME
  20. I am currently working on a website template 'multimedia' This is my first "draft" http://mami.hoogetech.com/ma500/01/ What do you think? Thanks for any input
  21. Hi I am trying to see if javascript is turned off using php. <?php $java=1; ?> <noscript> <?php $java=0; ?> </noscript> Why isn't this code working? Thanks
  22. How would I access my servers command line? I have ftp access Control Panel Access - Plesk
  23. I am sorry but what is SSH?
  24. Hi My hosts control panel doesnt have an option to extract files. Is there a php script that can extract .tar.bz2 files as I am wanting to upload more than 7000 files and 800 folders and using ftp this would take a long time. So I could just upload the .tar.bz2 file then use a script to extract the files onto the server. Thanks
  25. Hi I am trying to make it when using grouped radio buttons the user either presses yes or no. When Yes is pressed it shows the content in div id "dn2" and when No is pressed it hides div id "dn2" and shows "dn" instead. But when the page is loaded neither div id "dn" or "dn2" are to be shown. <body> <script type="text/javascript"> if( document.getElementById ) { getElemById = function( id ) { return document.getElementById( id ); } } else if( document.all ) { getElemById = function( id ) { return document.all[ id ]; } } else if( document.layers ) { getElemById = function( id ) { return document.layers[ id ]; } } function showhide( el, id) { if ( el && el.style ) { getElemById( id ).style.display = (el.checked)? 'none' : ''; } } </script> <label> <input type="radio" name="q1" value="radio" id="q1_0" onclick="showhide(this, 'dn2');" /> Yes</label> <label> <input type="radio" name="q1" value="radio" id="q1_1" onclick="showhide(this, 'dn');" /> No</label> <br> <div id="dn" class="noshow">Text 1</div> <div id="dn2" class="noshow">Text 2</div> </body> Thanks
×
×
  • 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.