• Web Dev Questions That Don't Need Their Own Thread v4
    5,001 replies, posted
Is it possible to style a page for Lynx? Like almost something simlar to ncurses. I am planning on UA targeting lynx for compatibility/cli user experience on my website anyways, I'm just wondering how far I can take it.
how do I make the following work in crontab # * * * * * user-name command to be executed */10 * * * * /usr/bin/php /cron/mongoUpdate.php I have php-fpm, the file and directory are both chmodded to 777 and it simply does not work.
Would any have any idea how I'd go about creating and then storing forms in a mysql database? Like, you'd have a page where you'd 'generate' a set of questions for a form, then store those in a database, then retrieve those questions and answers to generate the form?
[code] $things = [ 'one' => 1, 'three' => 3, ] $requiredKeys = ['one','two','three']; // Check required keys [/code] I am not sure how to do this, I need to check weather or not the required keys is in things
[QUOTE=gokiyono;43711239][code] $things = [ 'one' => 1, 'three' => 3, ] $requiredKeys = ['one','two','three']; // Check required keys [/code] I am not sure how to do this, I need to check weather or not the required keys is in things[/QUOTE] [code] <?php $things = array( 'one' => 1, 'three' => 3); $requiredKeys = array('one','two','three'); $keys = array_keys($things); $valid = true; foreach($requiredKeys as $requiredKey){ if(!in_array($requiredKey, $keys)){ $valid = false; break; } } ?> [/code]
[QUOTE=SammySung;43709845]Would any have any idea how I'd go about creating and then storing forms in a mysql database? Like, you'd have a page where you'd 'generate' a set of questions for a form, then store those in a database, then retrieve those questions and answers to generate the form?[/QUOTE] I'd go about with a table that defines each "type" (eg checkbox, textbox, radiobutton): ID, Name A table for all the questions: ID, question, typeID A table for all the answers: ID, answer And a table to link the questions and answers: questionID, answerID Then whenever you want to load the form, you retreive all the questions, the corresponding answers (I'm assuming the answers are for checkboxes and stuff), and the types. Then for each question, get the text, the type, and if applicable, the answers, and just create the input.
Hello, I'm learning HTML and CSS and I've hit a wall. What I've made is a content box where information will be placed, but when I type inside it, the writing goes straight to the boundries...Like this... [IMG]http://puu.sh/6CC9V.png[/IMG] (The text is the green box) What I'm trying to do is make it so it looks like this... [IMG]http://puu.sh/6CC59.png[/IMG] (The text is the red box) My CSS code is this... [code] #Content { height: 500px; width: 900px; margin-right: auto; margin-left: auto; background:url(content/images/content.jpg); } [/code] Can anyone help me out please?
[QUOTE=ENG.jonny;43712633]Can anyone help me out please?[/QUOTE] padding: 25px;
Yeah padding is what you want. You should google "the box model"
Thank you! I have some other problems with the footer, but i've temporarily removed it until my project is finished. If I still have problems when it's back, I'll probably come here looking for help :)
What problem was you having with the footer? It's probably a simple fix
Well it wouldn't sit at the bottom of the page, it did on one page but on others it would show up not at the bottom. I'll try and get a screenshot if you're confused
Well if you make the footer its own div, you should just be able to place it after the main content. So say your content is in something like <div id = container> then just place the footer div straight after that.
thats what I did, I'll try again soon when Im back on my PC. Thanks for your help!
No problem :)
Okay, so this is what I mean. It looks like this on the home page (index.html) [IMG]http://puu.sh/6CQt0.png[/IMG] but on another page, it looks like this... [IMG]http://puu.sh/6CQwL.png[/IMG] CSS code: [code] #footer { position: absolute; bottom: 0; height: 60px; width: 100%; background: url(content/images/content.jpg); } [/code] HTML Code: [code] <div id="footer">Website designed by Jonathan Maby</div>[/code]
Please could you use [URL="http://jsfiddle.net"]jsfiddle[/URL] and provide more complete code. It might not be possible to work out the problem with the footer if we can't see what context it is in.
it isnt in a context other than the body... After <div id ="content">blabla</div> I added <div id="footer">bla</div> edit: If you could try to help with what I've given so far, that would be great. At the moment, my mouse is broken on my PC so I have to use my laptop, which doesn't have the files on...
[QUOTE=ENG.jonny;43716000]it isnt in a context other than the body... After <div id ="content">blabla</div> I added <div id="footer">bla</div> edit: If you could try to help with what I've given so far, that would be great. At the moment, my mouse is broken on my PC so I have to use my laptop, which doesn't have the files on...[/QUOTE] Is the content always shorter than the page on a normal window size? Is it okay for the footer to overlay content? Do you want it to remain fixed to the bottom of the window and not the content? Are the body & html tags set to a min-height of 100%. Is overflow: hidden; set on the content div? Do you intend for the footer to stick to the bottom of the window when the content is shorter and get pushed down when the content is longer? if so that's known as a 'sticky footer'.
What I need is for it to be fixed on the bottom of every page. I've tried W3Schools and this other website, but it doesn't seem to help.
[QUOTE=ENG.jonny;43716342]What I need is for it to be fixed on the bottom of every page. I've tried W3Schools and this other website, but it doesn't seem to help.[/QUOTE] Your issue is that bottom: 0; sets it at the bottom of the window, not the page. Try using a container (like [URL="http://matthewjamestaylor.com/blog/keeping-footers-at-the-bottom-of-the-page"]this[/URL]).
I had a look at that page, only skimmed through it though. When I have a working mouse to use my computer, I'll take a closer look and see how it goes. Thanks for the help guys! Off topic: people are actually nice on this part of facepunch it seems :)
[QUOTE=ENG.jonny;43717780]Off topic: people are actually nice on this part of facepunch it seems :)[/QUOTE] Sometimes :P
I think what you're after is a sticky footer. [url]http://mystrd.at/modern-clean-css-sticky-footer[/url]
Can you do a loop with isset in php? I want a loop to check all form elements are set, all have numbered ids between 1-25.
Pseudo-php: I =0 Foreach post as data If !empty data I++ If I === 25 Everything went well.
[QUOTE=01271;43721473]Pseudo-php: I =0 Foreach post as data If !empty data I++ If I === 25 Everything went well.[/QUOTE] You can write pseudo code, well done.
[QUOTE=SammySung;43721545]You can write pseudo code, well done.[/QUOTE] [code] $i=0; foreach($_POST as $value){ if(!empty($value)){ $i++; } } if($i===25){ echo "all forms are valid"; } [/code] this should work but i havent tested it.
Can someone add me on steam please? I've got a few problems with a footer and it's a lot to put on face punch. I appreciate any support given.
[QUOTE=SammySung;43721545]You can write pseudo code, well done.[/QUOTE] I have had a lot of people who straight up implement my scripts and then wonder why something does not work because I've left out a ; or misspelled a variable. I've taken the habit of creating php that is visibly not-php, which forces people to re-write it and make their own mistakes.
Sorry, you need to Log In to post a reply to this thread.