Jump to content

aspnetguy

Members
  • Posts

    6,787
  • Joined

  • Last visited

Everything posted by aspnetguy

  1. anyone? I really want to write this app in PHP because it is platform independent. From every example I could find my code looks right but it is not recognizing the username and password.
  2. I am trying to setup up a daatabase object in PHP5 so I don't have to write the mysql_connect and mysql_select_db statements all the time along with the error checking and messages. Here is my object and the 3 related pages and the errors I get. The username and password is correct because I can manually write out the connect and select statements and successfully connect to the database.UPDATE: I updated the code and error messages, I worked through a coupe of the errors but can't figure out why it is not connecting. It is acting like it is not recognizing the username and password.class/Database.php <?php class Database { private $server; private $user; private $password; private $database; private $db; public function __construct() { $this->server = "localhost"; $this->user = "xxxxx"; $this->password = "xxxxx"; $this->database = "xxxxx"; } public function open() { $this->db = mysql_connect($this->server,$this->user,$this->password); if(!$this->db) die("Unable to connect to database server!"); mysql_select_db($this->database) or die("Unable to select database!"); } public function close() { mysql_close($this->db); } } ?> index.php <?php require("class/Database.php"); require("class/Site.php"); require("class/Page.php"); $page = new Page($_GET["id"]); echo "{$page->name}"; ?> class/Site.php <?php class Site { private $db; public $template; public $description; public $keywords; public $name; public $homepage; public $notes; public function __construct() { $this->init(); } private function init() { $this->db = new Database(); $this->db->open(); $result = mysql_query("select * from site"); while($row = mysql_fetch_array($result)) { $this->template = $row["default_template"]; $this->description = $row["description"]; $this->keywords = $row["keywords"]; $this->name = $row["name"]; $this->homepage = $row["homepage"]; $this->notes = $row["notes"]; } $this->db->close(); if(strlen($this->homepage) < 1) die("Homepage is not set!"); } } ?> class/Page.php <?php class Page { private $id; private $db; public $name; public $description; public $keywords; public $notes; public $secure; public $template; public function __construct($id) { $this->id = $id; $this->init(); } private function init() { $this->db = new Database(); $this->db->open(); $site = new Site(); if(strlen($this->id) < 1) $this->id = $site->homepage; $result = mysql_query("select * from pages where id={$this->id}"); while($row = mysql_fetch_array($result)) { $this->name = $row["name"]; $this->description = (strlen($row["description"]) < 1) ? $site->description : $row["description"]; $this->keywords = (strlen($row["keywords"]) < 1) ? $site->keywords : $row["keywords"]; $this->notes = $row["notes"]; $this->secure = ($row["secure"] == "1") ? true : false; $this->template = ($row["template"] == "default") ? $site->template : $row["template"]; } $this->db->close(); } } ?> errors
  3. HTML <form id="theForm" action="mailto:person1@domain.com" method="post"><input type="radio" name="email" value="person1@domain.com" selected="selected" onclick="changeEmail(this)"/> person1<br/><input type="radio" name="email" value="person2@domain.com" onclick="changeEmail(this)"/> person2</form> JS function changeEmail(radio){ document.getElementById("theForm").action = radio.value;}
  4. aspnetguy

    How-to

    first off Firefox is not Netscape. Firefox is created by Mozilla, Netscape is not. Infact Netscape abandoned their own engine and switched to Gecko (the engine Firefox uses) when they released Netscape 8.If you just want the user to go to another page with they click a button you coudl do this. <input type="buton" value="Click Me" onclick="window.location='url to to other page'"/>
  5. place the dll file in your projects bin folder. Then in vs right click on references from the solution explorer and choose Add. Browse to your bin folder and select the dll. It should now be in your selection list. Press OK.Then at the top of every page you want to se it on you use this statement (C#)using dllNamespace; //replace with correct namespace[.sub namespace] declarations.
  6. this is what I got and what led me to believe it had been bought after it's expiryhttp://who.is/whois-com/ip-address/csszengarden.com/
  7. having a webpage with a passwor dis not going to solve your problem. THe user could just type in another address. Take a look herehttp://www.infopackets.com/channels/en/win...web_browser.htm
  8. looks like they stupidly let it expire and it got snatched up. I did a search to see if anyone has been saying anything about this. The only related topic I could find was a reference to them letting there name expire back in 2005 also. They will probably try and buy it back but will pay a huge amount for it. that is why these companies buy expired domains.
  9. post an example of the code and we'll see what we can do.Does opera let you add custom Javascript or only CSS?
  10. aspnetguy

    sql question

    Just post the whole code of the page that is giving the error.
  11. I'm using 1.1 (at work) and there is no Page.Render only Page.RenderControl I'll have to check whne I get home (I have 2.0 at home) to see if it is there.
  12. was this guest book indexed by Google? You could probably get it from Google's index cache.
  13. add onclock="enableButton()" to each radiobutton then use this JavaScript function enableButton(){ document.getElementById("buttonID").disabled = false;}
  14. You cannot change the way the alert, confirm, or prompt boxes look.You will have to write you own code to simulate them if you want to customize the look.
  15. in your page declaration set ValidateRequest="false"
  16. put a hidden <asp:textbox> in your page "txtSource" then place the following script just before </body> <script type="text/javascript"> document.getElementById("txtSource").value = "<html>" + document.getElementsByTagName("html")[0].innerHTML + "</html>";</script> Then when you press the email send button you can use txtSource.Text to get the full html code to paste into the message body
  17. try setting EnableEventValidation = "false" on your page declaration.
  18. I didn't use a radiobutton I used a check box. You asked how to change the form action using a check box.
  19. glad to help. good luck with the rest of your project
  20. history.abck() is just a way to simulate the back button. It is not what the back button uses.
  21. try this sql SELECT UID,CAST(type AS VARCHAR(3)) AS type,name,amount,date FROM BuyIDtable WHERE UID=\'" + UID + "\' ORDER BY BuyID DESC
  22. give me a minute first. it is a lot less work to change the datatype in the sql then to setup and fill custom DataTables.
  23. the back button is not a javascript element or event. It is not part of the page so it cannot be manipulated.
  24. it works fine. You have to click away from the box (that is what onblur means) to get the event to fire. You could use onchange instead of on blur. It would check everytime the value change (every keypress).
×
×
  • Create New...