208 Posted Topics
Hello everyone, If I was to set my site to redirect any subdomain to the main page in the htaccess file like so: [code] RewriteCond %{HTTP_HOST} ^(.*).example.com RewriteCond %{HTTP_HOST} !^www.example.com [NC] RewriteRule ^(.*)$ http://www.example.com/ [P] [/code] Would this mean that if I was to type in elephant.example.com it would redirect … | |
![]() | Re: The riddle stated that the man saw a rabbit, it didn't tell us that it was. It's possible that the moonlight and shadows, along with his hunger made him think he saw a rabbit when it was actually something else. I did think it might be his family somehow but … ![]() |
Re: [QUOTE=cwarn23;1371349]Then I would need a very long cable on my mouse and keyboard if I have one.[/QUOTE] There will be no such thing as cables in 2020. Ways to charge batteries wirelessly are already in research and development. Could easily stick those "charging stations" into lampposts and at bus stops … | |
Re: Consistent code and layout Everyone lays out their code differently. There is technically no right or wrong way to lay it out as long as the syntax is correct but you should be consistent along the whole document. Here are a few ways I've seen people coding: [code=CSS] .class { … | |
Re: For inline text, you should use [icode]<span>[/icode] instead of [icode]<div>[/icode]. They are pretty much the same except [ICODE]<div>[/ICODE] is naturally a block, with a line break before and after whereas [ICODE]<span>[/ICODE] is inline with no line breaks. Try using a [ICODE]<span>[/ICODE] and see if that works. | |
Re: Just so you know, you aren't closing your form tag in the first page. I don't believe you can POST the value of a button. It would probably be better to have a check box saying "include responsible?" before the "Submit" button. | |
Re: I think your error is with your date variables: [code=PHP] $datef = date("Y-m-d",mktime(0, 0, 0, $_GET['year'], $_GET['month'], $_GET['day'])); $datel = date("Y-m-d",mktime(0, 0, 0, $_GET['year1'], $_GET['month1'], $_GET['day1'])); [/code] Are you getting any error messages or is it just not grabbing anything from the database? I've just made a guess at what … | |
Re: Is the filepath to the image file correct? Could you provide us with an extract of the code which isn't working? | |
Re: Could you provide us with the part of code which is supposedly having the problem please? We will be able to help a lot more if you could. Censor any passwords within the code and anything else that you don't want us seeing. | |
Re: You've said you have an error but you haven't stated what the problem is. Could you also please wrap your code in code-tags. | |
Re: You're adding the same value over and over again [icode]$row['Team'][/icode] Assuming each team has their own names (Team1, Team2, Team3 etc) then you could try this: [code=php] $div_GP=$ttl_GP[$row['Team1']]+$ttl_GP[$row['Team2']]+$ttl_GP[$row['Team3']]+$ttl_GP[$row['Team4']]; [/code] All I've done is add numbers to each. | |
Re: If you want the default colour of all text on the page changed, put it in the body section instead of a class: [code=CSS] body { color: #hexval; } [/code] Replace hexval with the hexadecimal value of the colour you want. | |
Re: One way is to have something in the database stating their user level (user, admin, moderator etc) then write a simple query to check that and display only the options available to them. | |
I am planning on getting a new computer soon with a 64bit version of Windows 7 Home Premium. The whole computer will be custom built by myself and I will be getting each part separately. What I want to know is this: If I put my current computer's hard drive, … | |
Re: You could use an if statement to check the URL. I assume your live version will have www. at the beginning. If not, replace it to whatever the start of the URL for the live site is. [code=html] <script language="javascript"> if (location.href.indexOf("www.google.com") == -1) { document.write("<div id=\"footer\">You are using the … | |
Re: All you need to do is update the field. Assuming your stock levels are labelled "Stock" in the database and the items are labelled "item": [code=php] <?php /*After obtaining the stock level from the database and putting it into the variable $stocklevel and placing the amount just bought into the … | |
Re: According to the properties of the page, it's written in plain text and not HTML. Make sure that the file extension is a valid html extension such as .html or .php. What is the current file extension? | |
Re: What are your expected and actual results? | |
Re: You would have the drop down box as a form with a "submit" button which would redirect to the page with this query on. You would then use $_POST['dropdown'] to get the value of that dropdown box. Form page: [code=HTML] <!--Replace results.php with your results page--> <form action="results.php" method="post"> <select … | |
I haven't done any C++ programming for quite a while now and the last compiler I used was Dev C++ (not sure which version/release but likely an old one). I want to start programming in C++ again but I'm an unaware of which free compiler would be the best to … | |
Re: Using just height: 80% will fix it at that permanently, stretching smaller images. I've just tried using max-height and it doesn't seem to work in either FireFox or IE. The only solution I could find that wouldn't stretch smaller images is wrapping the <img> in a <div> and setting height … | |
Re: What you could do is have multiple header files to include with the different meta tags you require and include the necessary one depending on the page you're loading. For example: On index.php?id=about you could include the header file headabout.php and on index.php?id=contact you could include the headerfile headcontact.php using … | |
Re: I prefer SQL because it's what I'm used to. I haven't used the others enough to compare them. | |
Re: One thing you could do instead of using cookies is set it so the page you go to has the variable in the URL. Example (not a valid link, in case anyone tries): [url]http://daniweb.com/PHP2.php?age=9&someotherthing=1[/url] So the code in PHP1.php would look something like this: [code=php] <?php $age = 9; $someotherthing= … | |
Re: Could it be that all your never-before-used memory blocks have the same value? It's default "empty" value so to speak. Try it with different type of variables like a char and see if all the chars also have the same value. | |
Re: Do you mean the mouse cursor or the text input cursor? As far as I know, it's impossible to move the mouse cursor but you can get the text input cursor to move to a new input box. | |
| |
Re: You put the wrong type of single quotes on the line: [code=php] $sql="UPDATE `Sample` SET `Fname`='$a',`Lname`='$b'"; [/code] Here's the correction: [code=php] $sql="UPDATE 'Sample' SET 'Fname'='$a','Lname'='$b'"; [/code] You shouldn't need the quotes though so this should work: [code=php] $sql="UPDATE Sample SET Fname='$a',Lname='$b'"; [/code] You cannot update the database if there is … | |
Re: If the page is only ever going to be accessed with localhost, you could just have the page open constantly and code it to refresh itself every 10 seconds. | |
Re: When you click "view source" on the outputted page, what does [icode]<img src="images/<?php echo $thumbnail ?>" />[/icode] display? If $thumbnail doesn't have a file extension then it's going to be just linking to a folder as the image source. | |
I am planning to start up a new business soon and part of it is selling online. I was planning on using PayPal in the early days to handle the payments until we can afford good enough security so that we can hold data such as credit card information ourselves. … | |
Re: I'm not sure if you can use breadcrumbs with the way that you've got your site set up as the only way I've worked with them is that each crumb is a folder (i.e.: crumb1 >> crumb2 >> crumb3 >> CurrentPage). I could be wrong though. I'm assuming the menu … | |
Re: [QUOTE=bertin88;1356198]I came across a siuation tat i need to store multiline inputs with paragraps. and i need to insert ( ' ) symbol in sql db thro php. I'm a newbie canany one help?? I used multiline textbox for input. It successfull get inserted to db but when i qurey … | |
Re: You will likely find that most people now have a minimum resolution of 1024x768 but I would suggest making the site work on 800x600. | |
Re: Compare the source code on your localhost server and when accessing the page online to see if it's rendering it differently for some reason. You can narrow down where the error is then. Is your localhost server a different machine than the one hosting your online site? If so, it's … | |
Re: By "role based access control" do you mean different user levels? For example on a forum you could have administrator, moderator, standard user etc. | |
Re: %22 is speech marks (") so it's possible that your WYSIWYG is adding them at the end of the filepath. Check the source code in the WYSIWYG to see if it is there, if not, try adding a backslash (\) at the end of the filepath which should escape anything … | |
Re: You've given us a localhost URL which would mean the page would need to be on our own computers for us to view it. You will need to give us the public URL for us to view your site. | |
Re: What is the code supposed to be doing? If $admission_no[$y] is only supposed to output the value of $y then you can replace "$admission_no[$y]" with just "$y". Without more of the code and not knowing what it's supposed to do, we can't help much. Could you please provide more of … | |
Re: I've come across this problem before and the problem was that someone had plugged in a network cable for a completely different network into the switchbox so every computer was trying to grab information from 2 different networks and it was confusing itself. I see though that you've tried it … | |
The joke: An SQL query walks into a bar and sees two table, walks up to them and says "Can I join you?" The riddle: Halloween == Christmas - Why? | |
Re: I would recommend that you have it so the entered e-mail address is the "reply-to" address in the e-mail like richieking suggests so that when you click reply, it'll automatically have that e-mail in the "To" box. This way the e-mail sent using the form is still sent using your … | |
Is there any way of making an e-mail form using ASP/ASPX? I am limited in what I can do since I'm not a root administrator on the website this is for. The site uses Contensis as it's content management system so if there is some way of doing it via … | |
Re: It shouldn't be a problem not having the "www" at the beginning. From the sounds of it, the DNS redirects [url]http://www.example.com[/url] to [url]http://example.com[/url] which is good practice. Take any website that has their DNS configured correctly, for example daniweb, and you will often find that if you go to [url]http://daniweb.com[/url] … | |
Re: I believe this should work: [CODE=php]$query = "SELECT * FROM classics WHERE author LIKE '% $author %' OR title LIKE '% $title %' OR year LIKE '% $year %' OR isbn LIKE '% $isbn %'";[/CODE] The percent symbols are wildcards so if "$author" was set to "Mark" then it should … | |
Re: Use the unlink() function. Syntax is [icode]unlink('filename.ext');[/icode] Example: [code] <?php unlink('file.txt'); //Delete "file.txt" from the current folder. unlink('../file.txt'); //Delete "file.txt" from the parent folder. unlink('texts/file.txt'); //Delete "file.txt" from the "texts" folder. unlink('../texts/file.txt'); //Delete "file.txt" from the "texts" folder within the parent folder. $filepath = '../texts/file.txt'; unlink($filepath); //Deletes the specified file … | |
Re: I'm assuming the strings are variables. Here's a couple ways you could do it: [code=php] <?php $string1 = 'hello'; $string2 = 'goodbye'; echo $string1; //displays "hello" echo $string2; //displays "goodbye" echo $string1[3]; //displays "l" echo $string2[3]; //displays "d" /*The first character in a string is always 0 followed by 1, … | |
![]() | Re: [QUOTE=rajarajan07;1349869]You cannot add any own tags within html. you can add own tags only in XML.[/QUOTE] That isn't what the topic creator was asking. To change a button into an image: [code=html] <input type="image" src="image.jpg" alt="Submit button"> [/code] I am unsure if this will work for a browse button though. … ![]() |
Re: I think I see what is meant by the page jumps to the top. If you resize your browser so that you can scroll down on the link and scroll down slightly so that you're not at the top but still have the tab buttons in view, the page will … | |
Re: Instead of having all the PHP in the head, you could add the if statement inline: [code=php] <?php session_start(); if(isset($_SESSION['validUser'])) { if ($_SESSION['validUser']!= "True") die("You are not allowed here!!"); } else die("You are not allowed here!"); if (isset($_POST['update'])) { // Save the changes $currentrow = $_SESSION['currentrow']; // (more php code … |
The End.