Hi, I wrote some code below, at the moment i'm testing so there's no database queries in the code but before i do that i'm hoping someone can help. The code below where it says `if(filesize($filename) != 0)` always goes to `else` even though the file is not 0 bytes and has 16 bytes of data in there. I think it's easier to show my code (could be other errors in there but i'm checking each error as i go along, dealing with them 1 by 1). I get no php errors or anything so can only assume it's my …

Member Avatar
Member Avatar
+0 forum 4

Hi, Not done any programming for a few years so am somewhat rusty again. I have two tables **users** table and **users_profiles** table. I want to update **users_profiles** table on the condition that **user_uid** matches on both tables (**users.user_uid** and **users_profiles.user_uid**) and where **users.user_login ** = 'johndoe' and **users.user_uid** = '11'. It wil be executed in a php script, so johndoe would actually be users username (whatever is stored in session and same for users_uid. For simplicitity i added dummy data. I run the query in phpmyadmin and get syntax error near INNER JOIN. I just cannot figure out what …

Member Avatar
Member Avatar
+0 forum 6

Hi, Me again... Just wanted to know, i have this piece of code to enter the data from a registration form of mine into the user db. I want to use the mysql_real_escape_string to help stop those evil people who enjoys hacking from hacking my DB $query = "INSERT INTO userinformation (username, first_name, last_name, email, password, date_time) VALUES ('$username', '$first_name', '$last_name', '$email', '$password', '$date_time')"; could someone tell me where i need to put the mysql_real_escape_string function to stop it happening, i am not sure where i place it by or how i code it, thank you, genieuk

Member Avatar
Member Avatar
+0 forum 6

Hi, I just started a free trial with a new webhost as my current one is useless. I have always had my website working on the old webhost fine. I have a folder called sessions outside the public_html folder so it cannot be accessed in a browser and not accessed by anyone else as i am on a shared host. With my previous host everytime i logged in to my own website i could edit the session file and see all the users data in there. For some reason on my new webhost when i login and try and view …

Member Avatar
Member Avatar
+0 forum 2

Hi, I wonder if someone can advise. My website has been working great ever since i first launched it. I made a script months ago to notify me of errors like 404, 500 etc and so on and it works perfectly. Two days ago someone accessed my website and they kept trying to access the same link constantly. This link is to download a file and is only available to members only and if i or anyone else access we never get errors i also never get any errors sent to me via email or in my cpanel error log …

Member Avatar
Member Avatar
+0 forum 3

Hi, I wanted to ask professional members who has built websites in the past wheter you include all your include files in the <head></head> section of your site. I split my design in two header-inc.php and footer-inc.php, obviously the <head></head> section will be in header-inc.php. Reason is most of my pages require different scripts. Currently i just place for example the javscript in the file that requires it but it makes my code look very messy and hard to navigate/read or i just put an include in the file that requires the script. I wanted to know as if i …

Member Avatar
Member Avatar
+0 forum 8

Hello, I was going to post the full script but don't think it will ne needed. Basically i have this query: [CODE]// query db $query = mysql_query("SELECT * FROM `userinformation` WHERE `username` LIKE '%$search%' OR `email` LIKE '%$search%' OR `id` LIKE '%$search%' OR `first_name` LIKE '%$search%' OR `last_name` LIKE '%$search%' ORDER BY id ASC") or die(mysql_error());[/CODE] Now when i do a search for example [b]ja[/b] in phpmyadmin it gives me 4 results as 4 people have a username that begins with [b]ja[/b] yet my query on my search form above only brings back one result. The query in phpmyadmin goes …

Member Avatar
Member Avatar
+0 forum 31

Hello, I have 3 text boxes that users can enter there AIM, YIM nickname and MSN email. Once submittd it sends and stores in MySQL db. I will use mysql_real_escape_string() of course but am not sure what is the best way to ensure no other mailicious code has been entered. I checked and due to the 3 above allowing special characters it means i cannot use striptags and stripslashes. They will show on a profile page so i need to ensure users cannot enter html code that will output it on page and break page etc and any other mailicous …

Member Avatar
Member Avatar
+0 forum 8

Hi everyone, I have a drop menu as below and when submitted it sends either no value, male or female to the database. [CODE]<select id="gender" name="gender"> <option selected="selected" value=""/> </option> <option value="Male">Male</option> <option value="Female">Female</option> </select>[/CODE] Now when i go back to the page i want it to show the value that was previously selected/stored in database. Basically the php code i have at the moment is to get the values and it sends to database. I already have a while loop so all i need to do is $row[gender] to get get value but how i implement it into the …

Member Avatar
Member Avatar
+0 forum 3

Hi, I have the following regex pattern. I don't think there is anything wrong with it. It seems to work when i test but if someone sees anything wrong with it please feel free to tell me. I don't know Regex but managed to put a username validator together as my previous one was limited. The problem i have is i want the username so it has to contain letters at least but cannot be all numbers, so if a user tries to use all numbers they have to add a letter to it for it to be valid, but …

Member Avatar
Member Avatar
+0 forum 4

Hi, I have a sitemap and have decided to create an automated sitemap. I just wanted to ask would the way i am going to do it be ok. I was going to create a table let say called `sitemap` have a column in the table called `url`. Basically i would create a section in my admin so i can manually add/delete/edit if i wanted to. then i was going to create a sitemap.xml file in that file i was going to create a simple php script that querys the database and using mysql_fetch_array to get everything from the url …

Member Avatar
Member Avatar
+0 forum 6

Hi, My site uses sessions and for example on login a random token as a hidden field in the form is generated and added to the session. As i am on shared hosting i set my own session path outside root directory and if for example session is tampered in anyway the user is logged out. I also have it so each time user visits there main control panel area and on login that it regenrates a new session id to try and help avoid session theft. And i also do some checks against db on some parts such as …

Member Avatar
Member Avatar
+0 forum 4

Hi, I been using a function for past few months that refreshes or redirects a user after xx time, for example after logging in etc. It workes fine in FireFox but notice that in IE7/IE8 and Google Chrome it does not redirect. I checked in IE and it is enabled in security, and Google is a complete failure and Firefox it works. This is the function, i use it througout my site and i dread having to do something else as it means editing allot of files. [CODE] // Redirect Function function redirect( $addr , $time=false ) { if( isset( …

Member Avatar
Member Avatar
+0 forum 2

Hi, I hope someone can help me. My site been using cookies and i have decided to scrap cookies after finding to many security holes which i myself was able to hack in testing. I have looked online and found nothing that is want i am after even my php books does not mention anything about session paths only about sessions itself. Basically i was reading the session path can be changed, i am on shared web hosting server and obviously due to security pitfalls i want to change the session path. I [B]do not[/B] have access to the php.ini …

Member Avatar
Member Avatar
+0 forum 4

Hello everyone again, When a user logs in a cookie is set on the users computer called genieuk_logged_session The value in the cookie is a random id created using a random key that the script creates, if i can i need to compare the value of randomin id in the cookie against the value that was put in the db at the same time. Can anyone tell me please if i can compare a cookies value ? and if i can how would i do so? Thanks, Mat

Member Avatar
Member Avatar
+0 forum 1

Hi, Can someone tell me if i can use the below query. When i click submit button SQL says: [QUOTE]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE username = 'genieuk'' at line 1[/QUOTE] I am using this query: [CODE]$loginid = mysql_query("INSERT INTO userinformation (login_id) VALUES ('".$randomkey."') WHERE `username` = '".$username."'") or die(mysql_error());[/CODE] Thanks Mat

Member Avatar
Member Avatar
+0 forum 2

Hi, Ok.. i have some pages on my site that has a link like [code=text]<A HREF="<?php $websiteaddress ?>/webbuilder/downloads/download.php?filename=age_verification_popup.zip">Download</A>[/code] if you look carefully you will see using get in my below script i get the filename in this example [b]age_verification_popup.zip[/b] This is then sent to this script. [CODE]<?php @include ("/home/sites/genieuk.co.cc/public_html/includes/global.php"); // check if member is logged in before issuing file. Function in global.php memberonlyzoneerror(); // if user not logged in the function exits and Does Not carryon with script. // get filename $getfile = $_GET['filename']; // path to file $filepath = '/home/sites/mydomain.co.cc/public_html/webbuilder/downloads/files/'.$getfile.''; // check file exisits, if it does force download/header …

Member Avatar
Member Avatar
+0 forum 6

Hi, I built a comments system, basically the comments appear underneath the form once submitted and page is refreshed, everything works like it should. I have this piece of code below, what i am having difficulty in is first time it worked then it no longer works. [CODE]<?php $bannedwordquery = mysql_query( "SELECT * FROM `post_comment_banned_words`"); while( $row = mysql_fetch_array( $bannedwordquery ) ) { $replacementword = "banned word"; $comment = str_ireplace($row['banned_words'], $replacementword, "".$_POST['comment']."" ); } ?>[/CODE] for some reason it worked first time and words in DB came up as banned word like it suppose to and now it does not …

Member Avatar
Member Avatar
+0 forum 3

Hi, me again, I have a textbox that users can enter a url of there website. I have default value at http:// so when page loads the text box alreay displays http:// I am not sure what i do in PHP to check to make sure that the url starts with http:// can someone tell me what i use in PHP so it checks that the textbox starts with http:// ? Thank you, genieuk

Member Avatar
Member Avatar
+0 forum 5

Hi, I basically have some links on a sidebar that loads some demos i made of mine in an iframe. I have one problem. As these links are on a page that does not have the iframe i need to somehow tell it to first load the iframe page. Problem i have is if i click on a link it opens my demos in a new window as it unable to find the iframe which is of course not on the same page. I done this before with a WYSIWYG editor, basically if you tried loading the page from an …

Member Avatar
Member Avatar
+0 forum 7

Hi, I basically have user profile pages. The text box people can of course type things, like about me etc. i am using css and not sure what i do to correct the problem. If a user for example type text it auto goes on next line when they reach the width of the text box. This is great and how i need it. But if user holds down a character key on keyboard etc it carrys on going rite across and not going on a new line (meaning scroll bar shows to go left and right. Problem i have …

Member Avatar
Member Avatar
+0 forum 5

Hi, I am not sure what i am doing wrong. I got my code (below) basically it is to resend user activation email if they for some reason or other did not get it first time etc. It sends the email and everything etc... what i need to do it not only get the user email address which i can do no problem but to also fetch the user activation key and username from the DB. Now if you look in my code i put [CODE] $query = ("SELECT * FROM userinformation WHERE `email` = '$email', `username` = ' ', …

Member Avatar
Member Avatar
+0 forum 13

Hi, Hoping someone can help me. I done a search on Google but must not be using correct search term as cannot find anything. Basically how can i make sure a page is only accessed via a certain link? I have a page that user clicks on that opens a poup window asking to enter captcha code, once entered and if ok it redirects them to a page with the links to the .zip files. Thing is i need the page with the links to zip files only accessed by going via the re captcha first. So basically if they …

Member Avatar
Member Avatar
+0 forum 1

Hi, Don't know why but i always seem to mess my, mysql querys up somewhere, usually silly things like quotes etc. The code below, i have a problem. Basically when user gets an email they click the link and they are taken to a page where they can change there password, Problem i am having, again i think this is a query problem, i have tried many many ways with no luck. When i enter a new password the password does not get updated in the database. Basically that the only problem i am having, if someone could take a …

Member Avatar
Member Avatar
+0 forum 8

Hi, As you can probably tell by now my knoweldge of MySQL is not very good. I basically have two tables. One called [B]userinformation[/B] and another called [B]profiles[/B] My userinformation table is like this: [CODE]CREATE TABLE `userinformation` ( `id` int(11) NOT NULL auto_increment, `status` varchar(20) NOT NULL, `username` varchar(20) NOT NULL default '', `first_name` varchar(40) default NULL, `last_name` varchar(50) default NULL, `email` varchar(50) default NULL, `password` varchar(200) default NULL, `date_time` varchar(100) default NULL, `ip` varchar(50) NOT NULL, `activationkey` varchar(200) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`), UNIQUE KEY `email` (`email`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=15 ;[/CODE] and my …

Member Avatar
Member Avatar
+0 forum 3

Hi, I am trying to display the users email address when they login to there account on there profile page.. I have successfully done this for there username as i use $_COOKIE to display the users name with the DB. Problem is i am not sure how to do it for email address. Here is my query: [CODE]<p><b>Your email address is:</b></p> <?php $query3 = mysql_query("SELECT * FROM userinformation WHERE username = '$username' AND email = 'email'"); while($row = mysql_fetch_array($query3)){ echo "email"; } ?> [/CODE] As you can see i am trying to get the query to understand that i want …

Member Avatar
Member Avatar
+0 forum 4

Hi, Somebody please help me, i am going mad out of my mind, for the past 4 hours or so some silly little problem has ratteled my brain and i cannot fix it. Basically, user registers on site, they get there activation email, click on link and the below script should then update the database. Problem is it is not doing that. I have tried possibly everything and nothing seems to work. Althou registration page communicates with DB fine and does what it suppose to, the script below uses the same db_connect.php file as the registration page. I get no …

Member Avatar
Member Avatar
+0 forum 2

Hi, Thanks for looking. I have a contact form and everything else is checked against validation apart from the textarea. For some reason i cannot get textarea validation to work using php. I have tried: [CODE] if (strlen($_POST['query'] == 0 ) ) { echo "<p>You have not entered anything in the text box provided. A minimum of 15 characters is required.</p>"; }[/CODE] also tried it with < 15 and [CODE]if (empty($_POST['query'] ) ) { echo "<p>You have not entered anything in the text box provided. A minimum of 15 characters is required.</p>"; }[/CODE] No matter how i try it won't …

Member Avatar
Member Avatar
+0 forum 6

Hi, I have built a newsletter subscription script from scratch but cannot go any further. I will be creating an admin panel but not sure how i go about actually using something such as a WYSIWYG editor to send out the newsletter to subscribers. Can anyone recommend a free editor that i can use, it will be used to create the actaul newsletter for me to then send out. I am not sure what other if any options are available. I just want an editor to put on my admin area where i can design my newsletter and hit submit …

Member Avatar
Member Avatar
+0 forum 3

Hi, could someone tell me what the correct syntax is to check is a user exists in my database. I got a login page and when user enters username and password i need it to check if they exist obviously in database and if so re-direct them to the page i specify else tell them login details don't exist. Anyone be able to help me please? thank you, genieuk

Member Avatar
Member Avatar
+0 forum 2

The End.