Jump to content

leeming

Members
  • Posts

    93
  • Joined

  • Last visited

    Never

Everything posted by leeming

  1. I have been struggling with this problem since i first started creating this layout (ages ago, but for development reasons, i stuck static width/heights in, just to work on my screen). I have searched google numerous times, but with no avail, as sites go on about something which is irrelevant to what im wanting (so maybe vague/bad use of keywords in search). any way i did a quick search on here, and any help given, does not seem to fix up my layout. My first basic problem is having a side navigation bar to fill the height of the screen, plus the header which is a static height. All this without creating scroll bars for the browser My second problem, which may be more or less the same as the above (miss-understanding of css), having a 100% height which includes padding. Link: http://dlym.net/testing/css_help.php Source (html) <html> <body> <div id="container"> <div id="top">header</div> <div id="sidebar">laaa<br>laaa<br>laaa<br>laaa<br>laaa<br>laaa<br>laaa<br>laaa<br>laaa<br>laaa<br>laaa<br>laaa<br>laaa<br>laaa<br></div> <div id="content"> <div id="childcontainer"> <div id="paddedbox"> <div id="test1">title</div> <div id="test2"> <div id="myElement"><a onclick="">main content</a></div> </div> </div> </div> </div> </div> </div> </body></html> CSS html, body { margin:0px; padding:0px; width:100%; height:100%; } #container { width: 100%; height:auto !important; /* real browsers */ height:100%; /* IE6: treaded as min-height*/ max-height:100%; /* real browsers */ background-color:grey; position: relative; } #top { width: 100%; height: 100px; background-color:pink; } #main { width:100%; height:100%; } #sidebar { background-color:red; width: 150px; height: 100%; float: left; } #content { background-color:blue; overflow:hidden; padding:10px; height:auto !important; /* real browsers */ height:100%; /* IE6: treaded as min-height*/ max-height:100%; /* real browsers */ } #childcontainer { background-color:white; padding:10px; } #paddedbox { background-color:green; margin-bottom:0px; margin-top:0px; overflow:hidden; } #test1 { width:100%; height:20px; background-color:yellow; } #test2 { width:100%; height:100%; background-color:lime; } The above is a simplified version of my site's layout, but they are the core div containers which i am trying to get positioned correctly. I seriously will thank any one who gives any help which leads me to fix this problem, as i am not too skilled with css, and this has been troubling me for some time. Thank you
  2. One thing holding me back from doing the addon domain way, is that users will not be able to use the cPanel. Not too bad as most of it is just shortcuts and easy steps for users (.htaccess shorcuts etc). But the other things such as creating mail accounts i have found in custom php classes. But... This is the thing which holds me back the most. I can not find any classes or a way of controlling the cron tabs. Does any one know if this is possible from outside of cPanel? I know how i could use a work around for regular tasks, such as per minute|hour|day|week|month, but nothing which allows custom cron tabs such as: 1pm, on 20th of month. davidz's idea sounded really good untill i saw the security flaw. I am unsure if any file or ftp functions can be worked in such a way to 'extract' these files and execute but not store.
  3. download the sample ipn php script, and just add some code where it tells you to. such as, db connection, then add a record into your database with a random username and password, then send them an email with this data. should be simple enough. Oh and make sure you enable ipn on paypal's side, and direct it to the url of this script
  4. I think require/include could call an external script's code, since it will be compiled before sent to me? (because of the http request, instead of a full server path).** Any way my host has also disabled that also. But maybe i could fiddle around with ini_set() later. Edit: ** Ah yes, i reread the example, so i could add some random extension instead of php, and it would be included like any other text. I see where you are coming from with the security problem. Maybe if i set up a gateway type file to include which you need a password to get via, //to call include("http://site.com/dir/gateway.php?user=leeming&&password=123456"); //in gateway.php on other account if($_GET['password'] == $correct) { include("path/to/file.weird"); } else { //log some kinda of security alert? } edit 2: ah yes, but this still shows the source, defeats the purpose of not distributing it.
  5. I thought i would get this problem sooner or later, which is my host blocking access to other accounts. Such as, "/home/{user1}/www/file.php" trying include "/home/{user2}/www/file2.php". Both accounts are owned by me, and under a reseller so i thought that "owner" setting for CHMOD was for this. My question is, since i can not do this no more, is how can i still access this file from another user's area? would ftp do this, or would that just return the source in a string? My other idea was to run all the other accounts as addon domains. But this removes the option of having a cPanel for the users. The file which is included is a set of classes/functions, and is used by a few users (not just my accounts, but still under my reseller), so i am not really able to distribute this file for all the accounts to host them selves. Any ideas how i could do it, or extend on what ive suggested? Any help is welcomed Thank you
  6. Basically i am wanting to have an extra area of a class (kinda like a module) kind of like class user { } class admin extends user { } but if i use the user class, and later in my code i find out the user is an admin, i create a new object admin... but there is my problem. This will be a new object, and thus all the methods in the user class will need to be set up again. Is there a way to add on this extended class to the current object (the same object) The original solution i thought of was this: class user { .. user functions etc function isStaff() { //set true or false } if($this->isStaff()) { //extra staff functions } } but obviously this did not work, and the only other way around this would be to add to each staff function if(!$this->isStaff()) return FALSE; which honestly would look very messy, and due to this been quite a large class would get VERY messy and confusing very fast.
  7. Nope i am now forced to do this function for one of my custom tags //References $tag = '/\[ref\](.*)\[\/ref\]/'; $html = '<sup><a href="#ref${1}">[${1}]</a></sup>'; $text = preg_replace($tag, $html, $text); It is an page to add articles, and [ref] just anchors to the bottom where the references are all listed (by number) i get the same annoying output as before... text [ref]1[/ref] middle [ref]2[/ref] end which outputs text <sup><a href="#ref1[/ref] middle [ref]2">[1[/ref] middle [ref]2]</a></sup> end is there no way to get preg_replace (or similar function) to go thru left to right instead of skipping to the last tag?
  8. exactly what im trying to explain... oh well, i will just use a simple string replace, and still wonder why i get that error
  9. The class looks impressive but, i would like to add that this code i have custom tags, due it been made for some one (its part of my coursework, even though i use php quite a bit any way). And also i'd have to document all this external code. (like previously said, im wanting to understand why it is doing this... i can still use str_replace)
  10. I thank you for the help, but... does not fix any thing... my code still takes the 1st and last (ignoring middle tags) and applying formatting to the whole lot. But i may add, this seems to be only in sections (maybe lines?) I am not fimilar with the syntax, which is why i was enclosing the [ b ] tags (i got hold of the bbs for [ url ] and changed it to do the rest of the tags for myself)
  11. Im trying to create a copy of BBS codes. i know i can do replace on these type of tags, but i have come across an error, and would like to understand it. //BOLD text $tag = '/(\[b\])(.*)(\[\/b\])/'; $html = '<b>${2}</b>'; $text = preg_replace($tag, $html, $text); The problem i have with the above is... [b]bold[/b] normal [b]bold[/b] Shows as: Just without the obvious spaces Basicly, it is catching the 1st bold tag, and matching it with the last one it can find (thus the middle is missed out)
  12. no, would will have do what sspoke said... when saving the password, in the insert query just put md5($password) instead of $password.. this will save a thing called a hash, this means you can only go 1 way to encrypt it (you cant decrypt it)... why do this? well.. when people log in, instead of searching for the loging details using the where clause "WHERE user='$user' AND password = '$password'" you put "WHERE user='$user' AND password = '".md5($password)."' " All this basicly means is (using "adam" as the password) its not checking the database for the password typed in by the user (as the hash will be some thing with what seems to be random letters and numbers) but its checking the hash to the user's input for password, and the real hash for the password saved (the hashes will be the same)
  13. [quote author=jesirose link=topic=119596.msg491963#msg491963 date=1167198309] Have you tried other hotmail accounts? [/quote] You caught me as i was adding an edit.. yes i have tried more hotmail accounts... its the reason it popped up in the 1st place, because my members where complaining to me they wasn't getting an email
  14. [quote author=Daniel0 link=topic=119596.msg490083#msg490083 date=1166777676] Check your junk folder. [/quote] I must of forgotten to add.... not in spam either... its just not getting thru to hotmail..... since i posted this.. i have been testing alot of headers to see if hotmail would like any of them.... nope.. still wont get thru.... im now using this code to test.... [code] <?php if($_POST['submit']) {     $recipient = $_POST['email'];     $subject = "Complete your Bavad.Com Registration";     $headers = "From: leeming <[email protected]>\r\n";     $headers .= "Reply-To: leeming <[email protected]>\r\n";     $headers .= "Return-Path: leeming <[email protected]>\r\n";     $headers .= 'X-Mailer: PHP/' . phpversion() . "\r\n";     $headers .= "MIME-Version: 1.0\r\n";     $headers .=  "Content-type: text/plain; charset=ISO-8859-1;\r\n";     $headers .=  "Message-ID: <". time() .rand(1,1000). "@".$_SERVER['SERVER_NAME'].">". "\r\n" ;     $headers .=  "Date: ".date("r")."\r\n".     $headers .=  "Subject: ".$subject."\r\n";             $message = "Welcome to bavad.com! lets talk\n about loads of stuff\n password and stuff here";     if(mail($recipient, $subject, $message, $headers))     {         echo "Mail (apparently) sent";     } } echo("<form name='email' method='post'>"); echo("Recipieint: <input type='text' name='email' size='30'> <input type='submit' name='submit'>"); ?> [/code] ~edit~ after more and more research on this topic, i am coming to the conclusion it is hotmail blocking the server or what ever, instead of the headers.. (kinda as bad as AOL) if there any way i can find out if my server is blacklisted *like said originally, i checked, but it said i hadn't* extra info for ya: My server is Linux Apache version:  1.3.37 (Unix) And its data center is in Texas i think... could any of them factors affect it in any way? i will continue researching this...
  15. its ok, i had 4 classes all in one file, so obviously the mod class exists (user class, where all extensions of) put them all in their own class files (maybe a bit annoying looking at inheritance stuff, but it works)
  16. [code]if(!class_exists("mod")) {   ?>   <div class='missingfield'>     You do not have any staff access privileges.   </div>   return;   <? } elseif(@!$mod->modforums(1)) {   ?>   <div class='missingfield'>     You do not have the staff access to view this page.   </div>   return;   <? }[/code] basicly this page is a staff page, so the 1st if, is checking for if the user is a staff member... but the 2nd is checking if they have the right permissions to view the page... the problem is, im getting this error, and i have tried a few things, with moving the '!' and '@' around This is without the '@' [quote]Fatal error: Call to a member function on a non-object in .....[/quote] "$mod->modforums(1)" should return true or false... and it is a defined function in my class, as this page works when a staff member is logged in (myself) as all the class vars have been set properly, since they can... but if i add the '@' the page just doesnt load at all past that line...
  17. set the link/form to direct you to a page that either: - says "you have loged in/out, click here to proceed" - have a header that redirects you
  18. [quote author=drifter link=topic=119596.msg489997#msg489997 date=1166760979] what if your mailer was open to header injection, and people were using your form to spam and your IP is now blocked by them? just a thought [/quote] i checked the "MAPs" site and a few others.. my server isnt blocked (i dont think any way)... but the only part of my sites that allow email.. is the registration.. i just using sum sample code to try break thru this hotmail 'block'
  19. mail( ) has been working for over a year on my server, but only recently i have had members complaining to me that emails have not been sent to them... after testing this myself i found out when using mail, it will not send to my hotmail. I even tried sending it to an email it actually sends to, and having an automatic forward (that didn't work) Then i even went onto hotmail's options and set it to accept the email i was using as the "from" header... nope.. still no email i even looked on the forums for some headers that hotmail 'like' [quote author=HuggieBear link=topic=107959.msg433816#msg433816 date=1158185415] Are you including the [b]to:[/b] address anywhere in the headers?  If you are, remove it.  This works well for me: [code]<?php   $from_name = "HuggieBear";   $from_address = "[email protected]";     $to_name = "ToonMariner";   $to_address = "$to_name <[email protected]>";     $subject = "Give this a try";   $message = "I last tested this with hotmail.com today and it still works fine.";     $headers .= "MIME-Version: 1.0\r\n";   $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";   $headers .= "From: $from_name <$from_address>\r\n";   $headers .= "Reply-To: $from_name <$from_address>\r\n";   $headers .= "X-Priority: 1\r\n";   $headers .= "X-MSMail-Priority: High\r\n";   $headers .= "X-Mailer: My Test Mailer";   $success = mail($to_address, $subject, $message, $headers);   if ($success) {   echo "The email to $to from $from was successfully sent"; } else { echo "An error occurred when sending the email to $to from $from"; } ?>[/code] Regards Rich [/quote] that didn't even work... i am totally stuck why hotmail decided not to accept any of my emails
  20. [quote author=thorpe link=topic=119290.msg488523#msg488523 date=1166568655] Is USERID hard coded into the user class? [/quote] USERID is a constant inside the whole of the code (do they not work inside classes? do i have to global them) but if i try to print $user->userid it works, but not as the inherited staff->userid i am very new to classes, and want to learn as much as i can about them, and get in the habit of using them, as im working upto PC programming also ~edit~ i think i might be calling the class wrong? if i call. [code] $user = new user; $user->userid = USERID; ... ... $staff = new staff; [/code] im thinking the code KNOWS that the $user values are connected to $staff (the classes are, but nothing to say there could be $user1 and $user2 using the user class?) ~edit2~ i think i have it now, after typing the 1st edit note... realised that all i have to do is call the staff class, and not user then staff... ;)
  21. im using PHP Version 4.4.2 and cant figgure out inheritance in classes... I have read a few tutorials on how to do this, but it still isnt working eg.. [code] class user {   var $userid = USERID;   ...   ...   ... } class staff extends user {   ...   ... }[/code] if userid is set in the user class... using $this->userid in the staff class doesnt work (why not?) but i tried some thing along the lines of a function that gets the userid (in the user class) and useing 'user::getuserid()' works... but surely these values should be inherited any way... i have tried $perant->userid but that doesnt work either.
  22. basically i have this query [code]$sql = "UPDATE Accounts SET Account_Aim = '".htmlentities($_REQUEST['aim'], ENT_QUOTES)."', Account_Msn = '".htmlentities($_REQUEST['msn'], ENT_QUOTES)."', Account_Yahoo = '".htmlentities($_REQUEST['yahoo'], ENT_QUOTES)."', Account_Icq = '".htmlentities($_REQUEST['icq'], ENT_QUOTES)."', Account_Gender = '".htmlentities($_REQUEST['gender'], ENT_QUOTES)."', Account_Website = '".htmlentities($_REQUEST['userwebsite'], ENT_QUOTES)."', Account_Location = '".htmlentities($_REQUEST['location'], ENT_QUOTES)."', Account_Army_Name = '".htmlentities($_REQUEST['arname'], ENT_QUOTES)."', Account_Sig = '".htmlentities($_REQUEST['sig'], ENT_QUOTES)."', Account_Personal = '".htmlentities($_REQUEST['personal'], ENT_QUOTES)."' WHERE Account_ID = '".USERID."'";     $query = mysql_query($sql, cdb(0))or die('wtf');//bavaderror($sql);[/code] and i checked it after the query, for affected rows (which always returns true, even if no update was done) basically i have found out that that the query is not updating because say if a user didnt put in an AIM  field, then it would be blank (this is a update profile page), but because its blank, this is leading to the query not updating... im not quite sure on this one.. but that's what's happening
  23. [quote author=calumrouge link=topic=117118.msg477575#msg477575 date=1165076513] Hey, I know that this is probably a really n00by question, and yes, before anyone asks I am a 13 year old kid trying to code fo himself. Any way! :P I am quite new to PHP but I have created a MySql database on the server I am using, I have got the code need to connect to it: [font=Courier New]mysql_connect(servername,username,password);[/font] but I am not sure what to put for server name. My main address is: calum.1111mb.com (Yes free hosting.) My MySql Database is Called: calum_test My Username is: Calum My Password is: PRIVATE (Come on I'm not stupid!) My Port For MySQL is: 3306 Could anyone please tell me what I need to put in my mysql_connect query for my database. Thanks  ;D! [/quote] try "localhost"
  24. [quote author=ataria link=topic=117117.msg477572#msg477572 date=1165076041] Post the script. Let's take a look at this baby. [/quote] heh neva like posting my code, especialy my queries, due to custom functions.. any way.. [code]     $sql = "UPDATE Accounts SET Account_Aim = '".htmlentities($_REQUEST['aim'], ENT_QUOTES)."', Account_Msn = '".htmlentities($_REQUEST['msn'], ENT_QUOTES)."', Account_Yahoo = '".htmlentities($_REQUEST['yahoo'], ENT_QUOTES)."', Account_Icq = '".htmlentities($_REQUEST['icq'], ENT_QUOTES)."', Account_Gender = '".htmlentities($_REQUEST['gender'], ENT_QUOTES)."', Account_Website = '".htmlentities($_REQUEST['userwebsite'], ENT_QUOTES)."', Account_Location = '".htmlentities($_REQUEST['location'], ENT_QUOTES)."', Account_Army_Name = '".htmlentities($_REQUEST['arname'], ENT_QUOTES)."', Account_Sig = '".htmlentities($_REQUEST['sig'], ENT_QUOTES)."', Account_Personal = '".htmlentities($_REQUEST['personal'], ENT_QUOTES)."' WHERE Account_ID = '".USERID."'";     $query = mysql_query($sql, cdb(0))or die('wtf');//bavaderror($sql);         if(mysql_affected_rows() == 0)     {       print"not updated?<br>";     }         print"<center><b><font color=green>Your Profile Has Been Updated</font></b></center>"; [/code] it never prints out "not updated"...
  25. a quick look up on the mysql documentation... [quote]mysql> SELECT CONCAT('My', 'S', 'QL');         -> 'MySQL'[/quote] so im guessing all u have to do is... [code] ... concat(firstname, ' ', lastname) ... [/code]
×
×
  • 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.