Jump to content

MCrosbie

Members
  • Posts

    36
  • Joined

  • Last visited

    Never

Everything posted by MCrosbie

  1. Data is stored on a remote DB which checks the license number of the person with the script, if it matches it allows access to run the script in the DB. For instance if you called to Add a Page to your CMS then the internet address would be something like www.yoursite.com/cms/file.php?functid=100294, it would check that you were allowed to do this within your license rights and then give the file the script needed to add a page. Because I am running the mysql_query, mysql_fetch_array, functions often I thought making a function would be easier and save code. As I said, I am new to functions, so I don't really know how to best use them. To me they don't seem very flexible and I don't understand how people can run whole sites off them. If anyone knows a good tutorial on OOP that would be greatly appreciated, one with real applications, for instance ecommerce example based.
  2. I also tried to put "$callid =" infront of my function when it was called e.g. $callid = tablecall("DL_functions","and functid='$functid'","","funct"); This didn't work and neither did this $funct = tablecall("DL_functions","and functid='$functid'","","funct"); This returned "f" for every value asked for e.g. $funct['id'] would equal "f" when in fact it should equal 1
  3. When I did run the script as above, that is exactly what it did, called the function for infinity.
  4. Wouldn't this just repeat the function call forever? And just have it being repeated over and over again? [code]function tablecall($table,$wherecmd,$othercmd,$callid){ global $config; $que[$callid] = "SELECT * FROM $table where license='".$config['license']."' $wherecmd $othercmd"; $res[$callid] = mysql_query($que[$callid])or die("ERROR". mysql_error()." query: ". $que[$callid]); $test_call = mysql_fetch_array($res[$callid]); if($test_call['license'] <> $config['license']){ // echo  '<META HTTP-EQUIV="Refresh" Content="0; URL=index.php?error=license">'; exit;     } $callid = tablecall($table, $wherecmd, $othercmd, $callid); $$callid = mysql_fetch_array($res[$callid]); return $callid; }[/code]
  5. [code] function tablecall($table,$wherecmd,$othercmd,$callid){ global $config; $que[$callid] = "SELECT * FROM $table where license='".$config['license']."' $wherecmd $othercmd"; $res[$callid] = mysql_query($que[$callid])or die("ERROR". mysql_error()." query: ". $que[$callid]); $test_call = mysql_fetch_array($res[$callid]); if($test_call['license'] <> $config['license']){ echo  '<META HTTP-EQUIV="Refresh" Content="0; URL=index.php?error=license">'; exit;     } $$callid = mysql_fetch_array($res[$callid]); return $$callid; }[/code] Now the above code ... let us say that $callid = row Why can I not, after executing the function be able to go echo $row["id"] for example. Have I done something wrong? I am a newbie to using functions so I appologise if I'm asking a pathetically stupid question, which no doubt I am. Thanks
  6. Wow. You guys outdid yourselves. So, as long as I use $_GET,$_POST, $_REQUEST and define where the variable is coming from everything will work? And also this verification of all the variables, is there a way you can do this by not adding extra code for each $_GET, $_POST, $_REQUEST you have in your code? Is this what obsidians code was trying to achieve?
  7. Hi all. My server emailed me today telling me the following: " Currently PHP Register Globals is set to ON across our entire network of servers and will be changed to OFF. " I don't exactly know what this means. I use alot of address bar variables via $_GET e.g. the id of a page will dictate it's content mypage.php?id=100923 the id of the page would be 100923. Would this still work? I really have no idea what affect this will have and my server are not being cooperative with their responses. How would one drop the need for Register Globals to be set as ON? Thanks for your help! Michael
  8. So what's the solution then? What do I need to change/add to my stylesheet/html page? Cheers though for your suggestions!
  9. Hi, I'm having problems with my 100% height div. It works in Firefox, Camino and Safari but not in Internet Explorer.  The Whole_menu is the one that I want 100%. I also have a table inside this DIV with 100% height. My CSS file is as below: html{   height: 100%;   min-height:100%;   width: 100%;   margin: 0em;   padding: 0em; } body { height:100%; min-height:100%; background-image: url(../images/header_bg.png); background-repeat: repeat-x; background-position: 100px top; background-color: #5b6471; margin: 0px; } /* Menu info */ #Menu_whole { position:absolute; left:24px; top:51px; width:270px; height:100%; min-height:100%; z-index:0; } Help!
  10. Hi there I got this error: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Fatal error: Call to undefined function: imap_open() in /home/nxc/public_html/automail.php on line 25[/quote] with this code: [code] $server = "9thdesign.net"; echo "Server: ".$server." "; $user = "support@".$server.""; echo "User: ".$user." "; $pass = "supportpass; echo "Password: ".$pass." "; $conn = imap_open("\{$server/imap}INBOX", $user, $pass) or die("Connection to server failed ERROR: ". imap_last_error() ."");[/code] Any ideas why? Cheers, Michael
  11. Hi there, I am making an imap email reader which puts the data from the email into the database for a ticketing system. Most users will simply reply to the email and will send something like this back: "Hi, Thanks for your help, Bye. On 18/04/2006, at 2:24 PM, Michael Crosbie wrote: > You need to do this" I want to get rid of all of the email from "On ...." onwards. Different email programs use different text to show the start of a reply so I can't just say spilt it where it says "On --/ ..." Can you help? Thanks, Michael
×
×
  • 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.