Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. Using tables for layouts isnt recommended. As tables are designed for showing tabular data on a web page. You should start to learn CSS layouts. With CSS layouts you have to code far less html at least 75% less.
  2. It is because you're using a paragraph tag around the [b]8 emulators in this category[/b] text By default paragraph tags have a bit of margin/padding on them. So the margin/padding was making your row hight lager and thus you get the distorted image type effect. You should use a span tag instead. Also you are using far too much html for the type of layout you're doing.
  3. wildteen88

    mail

    Internal Server Error is not from PHP but form Apache. PHP should not cause this sort of error instead it will show its own error message or a blank screen if you have display_errors disabled. the only to see why you're getting the internal server error message is to check your servers error log (error.log) should be What is the error that is logged?
  4. If you mean how do you get the data from the form when you submit it. Then you get it form the $_POST or $_GET superglobal variables. You use $_POST if you use the POST method (method="post") or GET if you dont use the POST method or if you have not set the method in your form tag. Once you know which variable to use you then prefix with ['field_name_here'] like so: $_POST['field_name_here'] So if you have a textarea called 'name': [code]<input type="text" name="name">[/code] Then you access the data from that field using $_POST['name']. You can then echo that variable out to see the contents.
  5. Its because you have the div in the center tags so both divs will be centered and thus the green div gets centered in the middle of the red div. What you'll want to do is add [b]float:left;[/b] to the green divs style attribute.
  6. wildteen88

    mail

    You cannot check whether an email has been sent successfully with the mail function. mail will only report any error if there is a problem between the Server and the SMTP server. Anything past the SMTP server is not checked by the mail function.
  7. A modelless window is basically a secound window (with is the child of the parent window), example of this would be a popup. [url=http://www.dynamicdrive.com/dynamicindex8/modelesswin.htm]Example Clicky[/url] A model window is a window that pops up but doesn't allow you to minimize/hide it, like you can with a modelless window. An example of this would be a when your computer gets an error message. You have to click the OK button to close the window in order to continue what you where doing.
  8. Whats up with phpMyAdmin? Are you getting the [b]Cannot load mysql extension. Please check your PHP configuration[/b] message? If you have the mysqli extension enabled you will need to tell phpMyAdmin that, otherwise by default it will use the standard mysql library (php_mysql.dll). To tell phpMyAdmin to use the mysqli library you'll need to find the configuration file (config.inc.php) in the root of the phpMyAdmin folder and search for this line: [code=php:0]$cfg['Servers'][$i]['extension']    = 'mysql';    // The php MySQL extension to use ('mysql' or 'mysqli')[/code] Change 'mysql' to 'mysqli' Save the config file and reload phpMyAdmin. Also the mysqli extension is designed to be used with MySQL4.1.3. or above. If you have MySQL4.1.2 or below then you should use the standard MySQL library (php_mysql.dll)
  9. To see if PHP is having trouble starting up open up your php.ini and enable the display_startup_errors directive: display_startup_errors = On Save the php.ini restart Apache. Do you get any errors displayed on Apache startup?
  10. You don't need to a Cron job to execute an application. You only setup a Cron job when you want to execute a script/application/do something at certain intervals. What you'll want to use is the exec() function. If the application returns any output and you want to use that in your script then you'll want to use the passthru() or system() function.
  11. How is PHP configured with the server? What server are you using (Apache, IIS or other). Also are using the short tags (<? ?>) when coding your PHP Scripts? If you are then use the full tags (<?php ?>) or enable the short_open_tags directive in the php.ini
  12. You need to enable the mbstring extension in the php.ini, search for [b];extension=php_mbstring.dll[/b] and remove the semi-colon at the beginning of the line. Save the php.ini and restart your server.
  13. You'll need to add that code into a function like so: [code]function confirmLogout() {     confirmLogout = confirm('Are you sure you want to logout?');     if(confirmLogout) { return true;     } else { return false;     } }[/code] Then for your log out link, it'll be like this: [code]<a href="logout.php" onclick="return confirmLogout()">Logout</a>[/code] Now what it will do is if you click the link it'll wait until your press the OK or Cancel button on the confirmation dialogue box that will popup. If you press the Ok button it will then continue on to logout.php or whatever the destination is for the link. If you click the Cancel button or close the confirmation dialogue box it will do nothing and keep you on the same page.
  14. You'll want to grab the user data from the html form using the $_POST or $_GET variables depending on your forms submit method (POST or GET, you define the method using the method attribute in the form tag). Now you'll want to get the data from the fields by referencing the fields names in the appropriate variable, example: $_POST['field_name_here'] So if you have a form field called email you'll use this: $_POST['email'] Once you have grabbed the user input you can now use these in your SQL query, example: [code]// make our user input safe for our query, very import: $email = mysql_real_escape_string($_POST['email_field']); $transID = mysql_real_escape_string($_POST['transaction_id_field']); // Construct the MySQL Query so it selects ONLY the username and // password for the account that the email and transID matches $sql = "SELECT account_username, account_password FROM temp_users WHERE email='" . $email . "' AND txn_id='" . $transID . "'"; // Now we'll run the query we just constructed $result = mysql_query($sql)[/code] Now you check that there was a match by using mysql_num_rows in an if statement like so, if there was a match we'll show the account info. If there were no match we'll display an unsuccessful message: [code]// Check that only ONE match was found. if(mysql_num_rows($result) == 1) {     // a match was found!     // Grab the password and username     $row = mysql_fetch_assoc($query);     $username = $row['account_username'];     $password = $row['account_password'];     // NOTE: I am using HEREDOC syntax here:     echo <<<EOF <h1>Match found!</h1> <b>Username:</b> {$username}<br /> <b>Passwprd:</b> {$password} EOF; } else {     // a match was not found.     echo <<<EOF <h1>No Match Found!</h1> We could not fine any matches with the provided Transaction ID and email address. Please insure you have typed the information in correctly EOF; }[/code] And thats all there is to it.
  15. When you create the confirmation dialog box using the confirm function you store it in a variable: [code]myConf = confirm('my confirmation message here');[/code] Now the variable myConf will hold the value of true if the user clicks the OK Button, or false if the user clicks the cancel/close button. So to see what button they chose you use a if statement like so: [code]if(myConf) {     // TRUE - OK Button } else {   // FALSE - Cancel/Close Button }[/code]
  16. You can probably get this effect done within a few lines of code using a javascript framework like moo.fx or prototype.js Also having a little look at the souce code the menu is produced using a script called [url=http://www.milonic.com/]Milonic DHTML Menu[/url]
  17. You'll want use the file_get_contents function or use fopen, fread and fclose functions to get the contents of the uploaded html file. Then to insert the files contents into the database. You'll want to use MEDIUMTEXT as the data type for storing the contents of the file. Once you've stored the files contents you can delete the uploaded file if you wish using unlink
  18. Only the mysql_error() part of it yes I added in [nobbc]<br /><pre>" . $sql . "</pre>[/nobbc] to the die statament so I can see what the query looked like if you did get an error. You can echo out your sql query too if you want. its up to you. You should only do this when your developing your script. When you go live you should remove bits of code that exposes your query for security reasons.
  19. Ok. What data type does the item_group_id store? What happens if you comment out the settype($vwgroepid,  "int"); line by adidng // infront of it?
  20. Remove the @ from infront of  the mysql_query function. If you do that then you are hiding the error which will help you understand why you query is failing. Also add the mysql_error function in your die statement this will then show the error message from MySQL. So this is what you line of code should be: [code]$result = mysql_query($sql) or die("Couldn't execute query. <br /><pre>" . $sql . "</pre><br /><br />" . mysql_error());[/code] Post back what error(s) you get in full here.
  21. Are you using PostgreSQL database? I am not experienced with PostgreSQL. Also do you know which query is failing?
  22. PHP code is not parsed by the browser it is done by the server. The header function sends a header to the HTTP Server which in turns sends the request back to the browser. You cannot code for separate browsers in PHP. You should use the full url address  eg http://www.sitename.com not http://sitename.com I have tested your code in IE7 and it works fine. Perhaps you have some option which blocks HTTP Header requests or something.
  23. Umm. Please post what's wrong with the script. Whats the code supposed to do and what is it doing now. If you are getting any errors please post them in full here. Please don't just post the code.
  24. have a look at [url=http://www.phpfreaks.com/forums/index.php/topic,95378.0.html]this FAQ Thread[/url]. You need to enable the MySQL extension (php_mysql.dll (not php_mysqli.dll).
  25. How have you configured Apache for PHP support? I have no idea what might be wrong. I have Apache2.2.x and PHP5.1.6 installed I get no errors. If you could post your configuration setup it might help.
×
×
  • 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.