Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,812 members, 7,820,865 topics. Date: Tuesday, 07 May 2024 at 11:38 PM

Craigston's Posts

Nairaland Forum / Craigston's Profile / Craigston's Posts

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) (16) (of 27 pages)

Programming / Re: Please Review My Personal Website by Craigston: 1:26pm On Jul 13, 2015
Did you pay to join the bootcamp? Where I stay (PH) I can't find any. I wish to be somewhere like that growing my brain in something good.
Programming / Re: How Do I Use Javascript To Get The Domain Name From A Link by Craigston: 6:29pm On Jul 12, 2015
Charleen94:

How do I validate the url string before using the function?
How do you want to validate it?
Programming / Re: How Do I Use Javascript To Get The Domain Name From A Link by Craigston: 6:20pm On Jul 12, 2015
Charleen94:
Given a link: http://example.com/hhhhhhhh/hhhh/ffff or http://www.example.com/hhhhhhhh/hhhh/ffff

How do I get a javascript code to print the "example.com(or www.example.com)" from the above url.

How do I also save it to in a variable.


If you're using it on a web page, the location object is already provided with a host property which contains the current page's host name.


var domainName = location.host;



/* if you want ignore the port (eg, 127.0.0.1:80, return a string containing only values before the colon*/


hasPort = domainName.indexOf(':');
if(hasPort != -1)
{
domainName =
domainName.substring(0, hasPort);
}
Programming / Re: Php Programmer Help Me Out ! by Craigston: 10:50pm On Jul 08, 2015
dhtml18:
Mehn, this code e long too much i gotta take panadol extra.
FIXED.
Make sure you take it with a can of bullet too.
Programming / Re: Php Programmer Help Me Out ! by Craigston: 8:31pm On Jul 08, 2015
gearcoin:


dont mind that code oo !
It is a code that chase many guru away.
i copy and paste directly from my dreamweaver .

the error is that dreamweaver continue display double login server behaviour. although , it is still work perfectly when i run it on browser and no code error on the webpage. I just always snub that error dreamweaver always give me as a pop up.

thanks very much.

On which page does it report double login server behavior? The login page or the member restricted page?
You made two database queries here using the same parameters. Could that be the problem?

gearcoin:
$colname_Recordset1 = "-1";
if (isset($_SESSION['MM_Username'])) {
$colname_Recordset1 = $_SESSION['MM_
Username'];
}
mysql_select_db($database_myconn, $
myconn);
$query_Recordset1 = sprintf("SELECT *
FROM reg WHERE username = %s",
GetSQLValueString($colname_Recordset1,
"text" );
$Recordset1 = mysql_query($query_
Recordset1, $myconn) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($
Recordset1);
$totalRows_Recordset1 = mysql_num_rows
($Recordset1);
$colname_Recordset1 = "-1";
if (isset($_SESSION['MM_Username'])) {
$colname_Recordset1 = $_SESSION['MM_
Username'];
}
mysql_select_db($database_myconn, $
myconn);
$query_Recordset1 = sprintf("SELECT *
FROM regtable WHERE username = %s",
GetSQLValueString($colname_Recordset1,
"text" );
$Recordset1 = mysql_query($query_
Recordset1, $myconn) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($
Recordset1);
?>
Webmasters / Re: 15 Free Books For People Who Code, You Will Be Glad You Read Them by Craigston: 11:36pm On Jul 07, 2015
Jregz:
I've read "97 Things Every Programmer Should Know" ..... it's a great book,very short,straight to the point
Tell me true story! I need to check it out soon.
On second thought, I can't read it now. Too many saved articles and books to read. And I've not touched any.
Programming / Re: Php Programmer Help Me Out ! by Craigston: 11:26pm On Jul 07, 2015
gearcoin:


YES ! YES !

GUY ! YOU ARE TOO MUCH. THIS IS EXACTLY WHAT I DID AND IT WORKS PERFECTLY.

I ONLY WANT TO SOLVE ONE INTERNAL ERROR THAT ERUPTED.

THANKS GUY .
Okay. Please describe the internal error.
I checked your code and I didn't see any database queries that increments the the login_count column on user log-ins.
Also:
You may want to consider using mysqli instead of mysql.
Your code sample still contains irrelevant parts and there are errors up there. Did you type them here or you copied and pasted them? If you did the latter, then those errors are likely to be found in your original files.
Your variable names ehn! Dem b codes on their own.
Programming / Re: What Happened To Programming? by Craigston: 9:24pm On Jul 07, 2015
Jregz:

side talk.... you really should, it seems intimidating and annoying at first (users' permission ,it's like being blocked from using your computer).....I find it a better environment than windows and it has support out of the box for most languages.

The power that comes with customizing your Linux box is endless...

It's free,no windows.licensing or crack no more ..

you might want to try a virtual machine before getting the real installation to check if you'd like it (you really should though )
Sounds like fun. I hear there are different versions/builds. Which do you prefer?
And, can I buy it in a dvd around instead of downloading it?
Politics / Re: Elders Reject Proposed Nuclear Power Plant In Akwa Ibom by Craigston: 12:24am On Jul 07, 2015
Imagine what would happen should those pipeline vandals happen to think there might be good treasures in the plant. I fear for the consequences that become possible if this proposal is welcome in a show of desperation.
Programming / Re: What Happened To Programming? by Craigston: 12:15am On Jul 07, 2015
cbtgeek, I've been thinking of getting a linux OS. Do you have any advice for me?
Programming / Re: I Want To Learn Software. Programing, Buh Where And How Do I Start by Craigston: 1:12pm On Jul 06, 2015
aura08130:
I would like to be a guru in programming, buh right now am completely empty. So I would like you guys help on where or what lanhguage to start with...I'd also apreciate any ebook or pdf textbook to help me pave my way...before I enter school next year.. A. List of websites wiill be good too. Help of any kind will b appreciated.
Google will give you better results if you search.
Programming / Re: How To Insert Items Into Different Table by Craigston: 12:21am On Jul 06, 2015
It's doable. Have you attempted it yourself? I can't start designing the database and developing the application just to demonstrate an example. You can help us by describing the related databases and tables, and make an attempt at the program to handle the data.

1 Like

Religion / Re: He Joined Me To Church Today, Because I Promised To Buy Him Beer. by Craigston: 12:13am On Jul 06, 2015
Mbkite:
One of my brothers who does not like going to church on sundays, but would always prefer to take bottles of beer on every sunday morning agreed to go to church with me because I promised to buy him some bottles of beer.



My question is- "was my tactics of inviting him to church proper? Believing that hearing the word of God would change him.


Your tactic isn't what he needs from you. But I like your resolve to help him. If he's not deliberately rejecting Jesus, I would like to meet him somehow and be a friend to him.
Programming / Re: Php Programmer Help Me Out ! by Craigston: 8:20am On Jul 05, 2015
Btw, where this OP go?
OP, you created a thread and, while you have some audience, you remain mute? Abi d cold code don hibernate you?
Programming / Re: Php Programmer Help Me Out ! by Craigston: 8:16am On Jul 05, 2015
dhtml18:
^^^Just tell us the truth, na the gaddamn code spoil your screen. . .
Hahahahahahahahahahahahahahahaha.
*hmmm!
This one is strong eh.
I don't know what's fucking up my screen. I used the laptop to study until about 1am, played a game and put it on sleep so I'd continue where I left. I woke up later to study and, shit! The screen showed me a pink hue. Now it's turned dark gray so I can't see through but it works fine on an external monitor.
Programming / Re: Php Programmer Help Me Out ! by Craigston: 4:47am On Jul 05, 2015
gearcoin, I'd like to help but my laptop's screen just went bad so I can't test anything. Let's see what we can do here.
Your code is a little insecure and it has many unnecessary parts. Have you solved the problem?
Health / Re: A Young Nigerian With Possible HIV Cure Die In Isreal by Craigston: 6:34pm On Jul 04, 2015
Something mysterious is happening here. I once heard a rumor, although I never confirmed it, that an intercontinental carrying experimental vaccines and drugs for HIV crashed mysteriously. Now, a young man diligently serving humanity and nobly resolved to find a solution to the scourge has died mysteriously.
Israel's government isn't as holy as the land, and they, together with many others, are sponsors of many evils in the world. Soon, the elite of this world will be judged.
Programming / Re: Javascript Help by Craigston: 12:12pm On Jul 04, 2015
donjayzi:
Please provide the codecademy page. . . .your code snippet is lacking the condition required in the while loop
I don't think so. It's testing for a boolean which returns true.
OP, any error messages?
Programming / Re: What Happened To Programming? by Craigston: 6:34am On Jul 04, 2015
donjayzi:
I read every damn thing but it does not make any meaning to me. These days, you have stackoverflow, github etc where some gaddamn whizzkid has already written one crazy library that will save you from weeks of coding without results.

So smart dudes like me for example combines all these resources together and create outstanding apps in a relatively short time.
That's it. Just what the author says. You combine the libraries whether they fit or not. You create outstanding apps trouble and get stuck in a thick maze at stage 2.

1 Like

Programming / Re: Php Programmer Help Me Out ! by Craigston: 8:59am On Jul 03, 2015
dhtml18:
I used to think I was super-ted and can handle any code thrown at me. . . . .but this one pass my power!
Hahahahahaha. Oga dhtml18. E don tey. How u dey na? Ministry (Nairaland) dey grow well?
You and trolling sha. Just watch out for mods o. Oops! Duck. That was a mod about to throw a ban!

But try help the guy na. Bosses like you should help us as much as you can.
Programming / Re: Assist Me Wit Php Code To Insert Multiple Records In A Table by Craigston: 12:45am On Jul 03, 2015
Can we know the values received in the $_POST array? Maybe seeing the html form can help.
Programming / Re: Php Programmer Help Me Out ! by Craigston: 12:37am On Jul 03, 2015
Your code is really intimidating. You can remove the style section since we don't really need it.

I think you can achieve your aim by creating a column in your table for login count, say 'login_count'.
Then issue a query with each login to increment the value. Take
$query_login_increment = "UPDATE table_name SET login_count = login_count + 1 WHERE user = $username";
Ensure you fix any errors.

1 Like

Programming / Re: Assist Me Wit Php Code To Insert Multiple Records In A Table by Craigston: 12:15am On Jul 03, 2015
There are several errors which we have to fix for your code to work. Let's see how this goes. Btw, which book are you learning with?

dandylass:
Yes you can see my code below
When submitted it will write failed
<?php
if(isset($_POST['submit']))
{
$result = $_POST["grades"]; /* is $_POST["grades"] receiving an array from the form?*/
$total = $ca1+$ca2+$exam;
if ($total <= $gpa6){
$grade4 = $grad1;
$letter = $letter1;
}
elseif ($total <=$gpa7){
$grade4 = $grad2;
$letter = $letter2;
}
elseif ($total <=$gpa8){
$grade4 = $grad3;
$letter = $letter3;
}
elseif ($total <=$gpa9){
$grade4 = $grad4;
$letter = $letter4;
}
elseif ($total <=$gpa10){
$grade4 = $grad5;
$letter = $letter5;
}


/* You assigned your variables to variables that have not been previously initialized. For example,
$grade4 = $grad5;
Fix these first.*/


if (count($result > 0))
{
$new = array();
foreach ($result as $key => $value)
{
$new[] = "('". $regno . "', '" . $name . "', '" . $sex. "', '" . $admissionyr."', '" . $value["term"] . "', '" . $value["session"] . "', '" . $value["subject"] . "', '" . $value["ca1"] . "', '" . $value["ca2"] . "', '" . $value["exam"] . "', '" . $value["total"] . "', '" . $value["grade"] . "', '" . $value["remark"] . "')";
}
if (count($new) > 0)
{

$checkdepart = mysql_query("select * from yrone where regno = '$regno' and subject = '$subject' and term ='$term'"wink or die ('could not select from registeration'.mysql_error());
$depart = mysql_num_rows($checkdepart);
while($row = mysql_fetch_assoc($checkdepart))
{
$c = $row['regno'];
}

if($depart == 0){
$query = mysql_query("INSERT INTO yrone (regno,name,admissionyr,class,term,session,subject,ca_test,mid_termtest,exam,total,grade, remark, now()) VALUES '.implode(',', $new)'"wink;
if ($query)
{
echo "SUCCESS";
}
else
{
echo "FAILED";
}
}
}
Ouch! Many errors. Brb. Fix the undefined values first.
Wait, I hope you're not using register_globals? That's the only way those variables could be assigned uninitialized variables and it's very insecure.
Programming / Re: Assist Me Wit Php Code To Insert Multiple Records In A Table by Craigston: 3:15pm On Jul 02, 2015
What have you done so far? Have you attempted it?

1 Like

Programming / Re: Please Review My Personal Website by Craigston: 2:04pm On Jul 01, 2015
blueyedgeek:

Cool, that was what I was aiming for; simplicity above anything else.

Thanks, what do you like about the contact form? How do you think it can be improved?
The contact form is okay and encourages potential clients to make the decision to contact you. It makes it easier for them since they can just do it immediately. Having your work phone number there may be a good idea. If you have a LinkedIn or an elance account, put it there (let all your work accounts be interlinked)


No, I did not use a template, it's all built from scratch using HTML + Css / Sass ( bourbon + bitters + neat + refills ) + Javascript
The brace were used purely for aesthetic reasons with a fancy font face to boot (But opera mini doesn't support @font-face rule hence it doesn't display that way. I'll remove it for opera mini since it's pointless on the browser).

The lack of color or little use of color was intentional as I wanted it to just be dead simple and responsive.
You can make it simple and still use colors correctly. Do you know that gray scales have different on moods as they vary between black and white? Just a hint.
https://en.m.wikipedia.org/wiki/Color_psychology
www.helpscout.net/blog/psychology-of-color/
www.forbes.com/sites/amymorin/2014/02/04/how-to-use-color-psychology-to-give-your-business-an-edge/


You are right about that. How do you think I can improve on that aspect?
I may come back to this. No answer for now.


My 'technologies' are HTML, CSS and JavaScript and I think I mentioned it there clearly. When I do gain more skills and learn new technologies, I'll add them in as well.

Thank you! Your comment is very much appreciated.
If you use HTML5 and CSS3, specify them. You use SASS? Specify it. Any CMS or libraries? These can be subtly added to give the 'he's-the-man' impression. People seem to fantasize over the latest technologies and forget the core.
Programming / Re: Please Review My Personal Website by Craigston: 3:27am On Jul 01, 2015
(I am viewing your portfolio on opera mini.)
I like the simplicity. I don't have much knowledge about portfolios and such, so I can't tell how professional it is.
I like the contact form: good idea.
Did you use a template? The braces around Chinedu aren't cooperating.
Your choice of colours is important. Apply some colour theory/psychology and use it to your advantage.
Though you are not a firm, branding yourself a little can help.
Do you use any other technology for your work? Add them.
I like your work. I wish you more success.

1 Like

Webmasters / Re: Pls I Need Help by Craigston: 11:14pm On Jun 30, 2015
You already bought hosting before thinking of what you want?
Well, can you teach me how the shortcut works?
What kind of forum do you want? Have you developed it on your local machine? Is this the first question you're asking concerning this?
Never mind.

Jregs, do you have any idea on this: my laptop screen just displayed a pink color when I turned it on? So sudden. I was charging and, just as I was about to use it, it's blurring the display. Only a small part at the upper side of the screen displays normal colors. I feel like crying.

1 Like

Programming / Re: A Little Tip For Notepad++ users Like Me. by Craigston: 7:02pm On Jun 28, 2015
Jregz:


it's an awesome editor bro,with a better UI than sublime text's but looks extremely like ST's.
It has a developer's panel,that of google chrome,holy heck!! i can do terrible things right inside the editor smiley smiley smiley ..
It's package management is better than ST's,it comes pre-built,while you have to download/install some script for ST..
Outright GIT support,
Easy customization..
there's also one feature,i like "TIME COP",monitors everything your editor does : load time,how long it took a plugin to respond,total time it took to compile "LESS",time it took to change a theme....TIME IT TOOK TO DO EVERYTHING


All this comes at one cost....ATOM IS SLOWER THAN SUBLIME TEXT

Wow. I'll check it out later. And I'll check Vim too, if it's free.
Programming / Re: A Little Tip For Notepad++ users Like Me. by Craigston: 10:52pm On Jun 27, 2015
Jregz:
cheesy i haven't used those ides though, I use sublime text,github's atom
Tell me about github's atom. I have sublime text too and it's good.
Programming / Re: A Little Tip For Notepad++ users Like Me. by Craigston: 1:50pm On Jun 27, 2015
directonpc:
I wish programmer will always have npp for backup... That is why that text editor keeps flying. <simplicity is their selling point and they ain't changing that>
The editor is good, but the UI is really ugly. I don't like the themes: I have to edit them to my preference.
Programming / Re: Simple Server by Craigston: 1:47pm On Jun 27, 2015
I have simple server on my pc but I don't know how to make it work. Worse, mtn and glo don't connect on my HSDPA modem: only airtel and etisalat.
Nairaland / General / Re: Something Very Awkward He Experienced Today by Craigston: 11:15pm On Jun 26, 2015
Hahahahahahahaha.
I relate. Mine would be worse had there been many persons present, because it was at church on tuesday.
I had to return the church organ for the service that evening and I was already late. I got to the church and, knowing I won't be around that evening, asked a guy to take it inside but he refused for no obvious reason. I decided to go in, and, somehow, I forgot the service had already begun. I rushed in through the front door, leaping over the steps and landing right inside, between the front pew and the altar. The sound of hallelujah shocked me out of my skin. The pastor was already staring at me and I looked like the demon who came to distract the church (busybodi no good at all.....) I quickly walked to the other side and dropped the organ. It was opening prayer so I wasn't sentenced to the worst.

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) (16) (of 27 pages)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 60
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.