Jump to content

Fehnris

Members
  • Posts

    46
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Fehnris's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. What are the circumstances that determine when it counts and doesn't count?
  2. Javascript is a clientside language meaning that the code runs when the person loads and views your website. The code runs in the clients browser. PHP is a serverside language meaning that when someone requests the web page the code is executed on the server before the page has even left for the clients browser. What you are trying to do won't work for several reasons. 1) you are using PHP to try to increment the resolution value of the browser The PHP code is executed 'before' it reaches the browser and so the resolution of the browser isn't available to the PHP code. 2) you are trying to increment a variable that isn't a number. The php variable $width doesn't contain a number but instead contains all your Javascript code. Because of this the variable doesn't contain 1280. Your page does as you say display 1280 but this is all done by the Javascript. All your PHP code is doing is effectively outputting your Javascript which is then sent to the browser where is it ran to display the resolution. To accomplish what you need, you should look into writing it all with Javascript.
  3. Im not sure if its going to make a difference but you are trying to compare an integer in your array to the $_GET['id'] value which is more than likely a string. You could try adding intval() to your $_GET['id'] value to convert the GET value from string to integer before the comparison takes place like:- if(isset($array1[intval($_GET['id'])])) { * do something *
  4. Yes just write a normal PHP script like one you would make for a webpage, but without any HTML or output, for example no echo statements. It really depends on what limitations on keeping the profile view records, you want to impose on the database. For example do you want to only limit the amount of stored views per profile to 10 views or do you want to remove profile views that are older than a certain amount of time? If you were to have a script that limits profile views to 10 per profile, you would need to have a while loop to get all your profiles seperately then get all views from that profile and select the newest 10 to keep and delete the rest. Alternatively if you wanted to only allow profile views to stay in your database until they reach a certain age. You could simply get all the profile views that are older than a specified date and delete all these records. All you would need to do is setup a Cron for this script to run when ever you wanted it to, every 24 hours if you prefer.
  5. Your welcome You would incorporate them in with your while loop for each record for example:- echo "<table>"; while($row=mysql_fetch_array($result)) { echo "<tr>"; echo "<td>"; echo "<input type='checkbox' name='maybe the id of this record to allow you to identify if a certain row is checked'>"; echo "</td>"; echo "<td>"; echo $row['field1']; echo "</td>"; . etc . echo "</tr>"; } echo "</table>";
  6. Assuming that your PHP file out puts the results in some formatted way using HTML, simply add the PHP file name to the src attribute of your IFRAME tag:- <iframe src ="your PHP file that gets database records.php" width="100%"> </iframe>
  7. PHP isn't going to be concerned with the table layout. Sure you will need PHP to connect and retrieve your database records but for the actual formatting of the table as in the link you provided, you will need to use HTML. For there table layout they have used DIV tags but you could do something similar using HTML Table, TR and TD tags. If you are using a MYSQL database and you decide on HTML tables, you could do something like:- echo "<table>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>"; echo $row['field1']; echo "</td>"; echo "<td>"; echo $row['field2']; echo "</td>"; . etc. . echo "</tr>"; } echo "</table>"; This would only give you the basic layout and you would also have to consider styling your tables using different TABLE tag attributes straight in each tag or by adding extra values to your CSS documents.
  8. If you want to check what they have entered before the form gets submitted you will have to use some form of client side script language ie. Javascript, VBscript to do the checking. I assume DW means Dreamweaver and I've not had any experience using it so I dont know what Client Side languages you can use with it. PHP is server side and so will not have the ability to check your form values before the form gets submitted.
  9. You dont really want to be checking that $check isnt equal to zero. if ($check != 0 ) { $query="INSERT INTO seebergerLogin (username, password, first_name, last_name)VALUES ('$_POST[email_address]','$_POST[password]','$_POST[first_name]','$_POST[last_name]')"; $_POST[password] = md5($_POST[password]); echo $fname; echo ', your account has been created '; echo "<html> <body> To Sign into your account <a href='loginsql.php'> Click Here![/url]"; } Instead check it like this. if (mysql_num_rows($check) > 0 ) { $query="INSERT INTO seebergerLogin (username, password, first_name, last_name)VALUES ('$_POST[email_address]','$_POST[password]','$_POST[first_name]','$_POST[last_name]')"; $_POST[password] = md5($_POST[password]); echo $fname; echo ', your account has been created '; echo "<html> <body> To Sign into your account <a href='loginsql.php'> Click Here![/url]"; }
  10. The switch statement as Moon-Man.net stated is definately another possibly better way to go than the if/elseif. Your code says at the bottom "this part I cannot get working". In what way does it not work? Does it give error messages or does it produce something different than you want?
  11. You got your html form attributes abit mixed up. you have action="get" and target="notes.php" it should be method="get" and action="notes.php".
  12. Sorry for the late response, havent been arround all day. Glad you got it working
  13. So the code line '$res=mysql_query("update $tbl_members set enabled='yes' where login='$login' ");' isnt updating the database record for the current user? Try putting 'or die("MYSQL update error.".mysql_error());' at the end of the line to see if you get an error for the mysql_query. If its not updating the current users database record, its more than like going to be the update query that isnt working correctly. By putting the or die statement at the end, you will be able to find out why the query isnt working.
  14. First off, to have a webserver, you really need some 'Static' way of addressing it.  Be it a Domain Name or a Static IP address.  As you only have a Dynamic IP address assigned from your ISP you would need to do one of 2 things. 1. See if your ISP can provide a Static IP address instead of a Dynamic one (Would probably involve extra cost per month). 2. Check to see if your Router supports DDNS.  If it does you can register with someone like this [url=http://www.DynDNS.org]www.DynDNS.org[/url] which would give you a domain name that would follow your dynamic IP address. Thats the first thing to consider.  The second is to configure your router to:- 1. Let incoming connections from the internet through your router (port 80 for webserver) to 'your' PC. 2. Setup static IP addresses on your router for at least 'your' PC and point your router's incoming http requests to your PC's IP address (port forwarding). Thirdly, (not sure if you already have this covered as you said you have created your home page) you need to have some webserver software installed on your PC to host your site.  Apache is a good one and you can download it for Linux/Windows. Other things to consider, your internet connection, how busy you expect your webserver to be and network security. Most internet connections are slower uploading than downloading (typical 1mb DSL download = 256kb upload).  Since you are wanting to 'Serve' webpages your upload bandwidth needs to be taken into consideration.  Having a busy website on slow upload will impact on your connection from any of your LAN PC's to and from the Internet. They would need to share the connection bandwidth with anyone requesting a webpage from your home webserver. There is also the issue of security. By having a webserver and a way 'in' from the internet to your home network, increases your risk for security breaches to yours and other PCs on your home network. Hope that bit of rambling has been of some 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.