-
Posts
80 -
Joined
-
Last visited
Everything posted by mikhl
-
Hi people, I recently has a simple if statement like below: if(!is_null($var){ //some code } and it was not working. So I changed it to: if($var != null){ //some code } After that it worked just as expected; am I missing something. I am a little confused.
-
That is exactly what I want. Thanks
-
I have a personal website that retrieves images from directories on the server. However, one of my directories has 1000+ images; which I don't want to be displayed on one page. Is there any way that I can have it so that the first 100 images are displayed on the page with a next link for the next 100 images. Kind of like the way that clothes are displayed on websites that have a large number of products. I am sorry if this is vague. Any help would be appreciated. Thanks
-
All makes sense now, thanks.
-
I have come across a > used within some CSS code. I was wondering if anyone could inform me of its use? The code that I found is: nav ul > li { /*some css*/ } Thanks
-
Thanks guys. Problem solved. I used the code given
-
I have a cookie that sets the users ID number. This is so that they can be logged on. The cookie lasts for 24hours or until the user logs out. I have recently noticed that if a user logs in at http://website.com they are not logged in at http://www.website.com this is causing a few problems. Is there any way to set a cookie so that it works for both of these url's. The code that I have used to create the cookie is: setcookie(fp_user,$user_id,time()+60*60*24) Thanks
-
Thanks, that has done the trick.
-
Hmm... no, I am using a temporary domain to host whilst in the testing stages. Would this cause a problem? Thanks
-
Hi, I am using a simple mail() function to send a confirmation email to users. However, when they receive the email (i am currently testing this with my hotmail account) it states that it is not trusted. Quoted from hotmail: Does anyone have any ideas as to why this is happening, whether to do with my code or not. This is the code that I am using at the moment: $sendto = '[email protected]'; // using this email to test.. would be users email $subject = "Confirmation"; // Subject $message = "Hi $fname $sname ($uname), \n\n Thanks for joining us. \n To activate your account you first need to confirm your email address. To do this click the link below: \n\n"; $message .= "http://thelink.com"; $header = "From: [email protected]\r\n"; //return $message; mail($sendto, $subject, $message, $header); Thanks
-
You could create a contact form for each different person and then display the necessary contact form when the 'contact this person' link is clicked. This could be done with a little JavaScript. function setState(id, state) { document.getElementById(id).style.display = state; } You would then give each form and id or wrap a div around each with an id like <div id="form1"> All of the forms will need to be set in CSS so that they are not displayed: #form1, #form2, #form3 { display:none; } Then we need to invoke the JS function when the link is clicked: <a href="#" onclick="return false" onmousedown="setState('form1','block');setState('form2','none');setState('form3','none');">Display form1</a> The code above will create a link that will set form1 to visibly display on the screen whilst closing any of the other forms. the onclick="return false" prevents the link from refreshing the page or redirecting. Hope I helped
-
Thanks thorpe, I will look at using phpMailer later today. I will post results.
-
I am trying to set up the mail function in php.ini so that I can use mail() in my web pages on my local machine. I have changed the mail function from [mail function] ; For Win32 only. ; http://php.net/smtp SMTP = localhost ; http://php.net/smtp-port smtp_port = 25 to [mail function] ; For Win32 only. ; http://php.net/smtp SMTP = smtp.talktalk.net ; http://php.net/smtp-port smtp_port = 25 I have also tried [mail function] ; For Win32 only. ; http://php.net/smtp SMTP = smtp.aol.com ; http://php.net/smtp-port smtp_port = 587 I have tried two different mail servers as I am with AOL, but I think I may have been transferred to the TalkTalk server. At least this is what it looks like when I search my IP address with whois. The main problem, I think, is that when I change the information in php.ini it doesn't change when I look in the phpinfo(). I get no error message when i use the mail() function. however the email does not seem to have been sent. Any help or light shed on this would be greatly appreciated. Some more details: PHP Version 5.3.5 Loaded Configuration File C:\xampp\php\php.ini any more info needed - just ask
-
Hi, I am a student going into my second year in September. I am looking to apply for an Internship that was posted on my universities website. Their description of the candidate is: What and how much do you beleive I would have to know for this internship. Thanks
-
you cant use border="0" in an XHTML document due to the new standards. in your css, try placing img { border:0; } instead.
-
I think that where you have stated if(username&&$password) You were mention to say if($username&&$password) - declaring the username variable. Don't think that this is the reason that you are having this problem though
-
You need to use a join so that it looks like: SELECT * FROM products JOIN categories ON(id_of_the_products_tbl = id_of_the_categories_tbl WHERE products.category = '$categoryurl' DESC LIMIT 6"
-
I am trying to make two check constraint. the first checks that a varchar2 includes @ the second checks that a varchar2 includes / how would this check constraint work?
-
How would I create a constraint that ensures that the phone number (which is a varchar2) starts with 0? How would this be done in a create table statement, as well as an alter table statement? Cheers
-
Not entirely sure of what you mean, but does this help? if($field4 == "" && $field5 == 1) { $sql = "SELECT field1 FROM table1 ORDER BY field2, field4, field5, field3" } else { $sql = "SELECT field1 FROM table1 ORDER BY field2, field3" } If you have some code to show of what you have so far, may be able to help a little more.
-
For a project I have to create a simple form that allows a user to order a pair of trainers. I understand how to do as the project outlines, but would like to expand on it. Would it be possible for me to substitute a MySQL database for an array that contains an array of products. So that when the user makes an order, the quantity in the array is reduced. The array would look as follows: $prod = array( array( 'id' => '00001', 'name' => 'Pink Converse', 'desc' => 'This is the description of the product.', 'price' => 4500, 'quantity' => 2, 'img' => 'images/prod1.jpg', 'img2' => 'images/00001-2.jpg' ), array( 'id' => '00002', 'name' => 'Tartan Nike Hi-Tops', 'desc' => 'This is the description of the product.', 'price' => 5500, 'quantity' => 2, 'img' => 'images/prod2.jpg', 'img2' => 'images/00002-2.jpg' ), array( 'id' => '00003', 'name' => 'Black Hi-Tops', 'desc' => 'This is the description of the product.', 'price' => 5500, 'quantity' => 2, 'img' => 'images/prod3.jpg', 'img2' => 'images/00003-2.jpg' ), array( 'id' => '00004', 'name' => 'Smart Mens Shoes', 'desc' => 'This is the description of the product.', 'price' => 7000, 'quantity' => 2, 'img' => 'images/prod3.jpg', 'img2' => 'images/00004-2.jpg' ) ); If you know if this is possible or not, you would be a great help, any ideas would also be welcome. Thanks
-
Thanks for your comment. I have figured out what I wanted: add constraint validclassid check(subjectid like 'COMP%' or subjectid like 'INFO%' or subjectid like 'SYS%') Sorry if I wasn't clear
-
I want to create a check constraint that allows the input of data like 'COMP%' and 'SYS%' and 'INFO%' The code that I have tried is as follows: alter table subject add constraint validclassid check(subjectid like 'COMP%', 'INFO%', 'SYS%'); and... alter table subject add constraint validclassid check(subjectid like 'COMP%' AND 'INFO%' AND 'SYS%'); and... alter table subject add constraint validclassid check(subjectid like 'COMP%' OR 'INFO%' OR 'SYS%'); None of the above are working, I could really use your help. Thanks. I am using Oracle 10g
-
Sorry tool a while to reply. I have figured out the problem. My code was ok, I think. But the path on my cookie restricted the use of it, so changing it allowed me to use it. Thanks for your help.
-
$sql = "INSERT INTO user_friendship (user_id, friend_id, status) VALUES ('$_COOKIE["user_id"]', '$_COOKIE["v_user_id"]"', '0')"; $result = mysql_query($sql); Tried the above and got a syntax error on browser and on PHPEdit. $user = $_COOKIE['user_id']; $friend = $_COOKIE['v_user_id']; $sql = "INSERT INTO user_friendship (user_id, friend_id, status) VALUES ('$user', '$friend', '0')"; $result = mysql_query($sql); Also tried this way of doing it and the friend_id was still set as 0. Sorry if I'm not understanding you.