Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,788 members, 7,817,272 topics. Date: Saturday, 04 May 2024 at 09:14 AM

Nsimageorge's Posts

Nairaland Forum / Nsimageorge's Profile / Nsimageorge's Posts

(1) (2) (of 2 pages)

Programming / Re: Best Way To Separate HTML And PHP? by nsimageorge(m): 12:11am On Jun 13, 2017
NerdyFullo:


Bros, are you a programmer or what? do you even understand what I was asking?

public function replyPost($content, $anonymous, $id){
$userid = $this->userID;
$sql = $this->dbh->prepare("INSERT INTO posts (thread_id, user_id, anonymous, content, created) values(:thread_id, :user_id, :anonymous, :content, :created)" );
$sql->execute(array(
":thread_id" => $id,
":content" => $content,
":anonymous" => $anonymous,
":user_id" => $userid,
":created" => date("Y-m-d H:i:s" )
));
$last_id = $this->dbh->lastInsertId();
if($anonymous == 1){
return $last_id;
}else{
$sql = $this->dbh->prepare("SELECT `user_id` FROM `posts` WHERE `thread_id` = :tid AND `user_id` != :cuser" );
$sql->execute(array(
":tid" => $id,
":cuser" => $userid
));
$g_t = $this->dbh->prepare("SELECT `user_id` FROM `threads` WHERE `id` = :tid" );
$g_t->execute(array(":tid" => $id));
$uid = $g_t->fetchColumn();
if($uid != $userid){
$rid = $uid;
$sid = $userid;
$type = 3;
$ref = $id;
$para = 'Replied to your thread';
$this->Notify($rid, $sid, $type, $ref, $para);
}

foreach($sql as $not){
$rid = $not['user_id'];
$sid = $userid;
$type = 2;
$ref = $id;
$para = 'Also Commented On';
$this->Notify($rid, $sid, $type, $ref, $para);
}
return $last_id;
}

}


does that make sense to you ?


Your question is somewhat ambiguous... You are trying to separate PHP code and HTML Why?? What are you trying to achieve
BTW, your posting a PHP code does not elaborate your original post!!!

Let me try and be sane and help rephrase your question.

1: What is the best way to embed PHP inside HTML? (There is no best way, just embed the code anywhere! So long as the script extension is .php)

If question number 1 is not what you intended to ask, I am sorry, I can't help you!
Programming / Re: Creating A New Programming Language by nsimageorge(m): 11:07pm On Jun 12, 2017
ViiCODE:
Hello all. I'm currently working on my final year project which is creating a new programming language. I've done my research and still researching. Please, if there is anyone with any experience concerning creating a new programming language or writing a compiler, don't hesitate to share. I or someone out there can still learn a thing or two from your experience. Also, if you know of any material which would greatly help my cause, please drop the name. Thanks.

I believe that your writing a new language is basically for learning purposes, else I would have adviced against trying to hurry on such a project. However, its possible to write a new language in a short time, but what is your new language intending to solve?

If you go for C, that might be a very steep curve. You can try with JS, Python or PHP. Deploy a new language for the web.
There are some basic things a language should have.
First is a compiler/intepreter: Your browser can serve as an intepreter, no need to go writing a compiler, why not go ahead with writing down the chunk of functional code. For PHP, you could basically just run Ubuntu and use it.(With this you don't even have to worry about things like memory management)

Second is the semantics: Practically, just think like whoever would be using your language, then code away. (Don't just code away, plan it first). What variable initializing concept would be used? etc

There is really no third or fourth... Once you just get the first and second, everything would start falling into place.

1 Like

Webmasters / Re: How Do I Create And Send Mail From "Donotreply@mydomain.com" by nsimageorge(m): 8:45am On Jun 12, 2017
What you are looking for is on the cpanel of every host, its most likely that you haven't searched well. Under the 'Email' section in your cpanel there is a list of everything that applies to your question.
'Email accounts': To create the emails associated with your domain(except you bought a domain that doesn't have much email accounts and you have used them up). You can also set if the the email account should be replied to or not.
I can go ahead to list them all but the rest are self explanatory.

I hope this answers your question.
Programming / Re: Best Programming Language by nsimageorge(m): 8:28pm On Jun 11, 2017
There is no such thing as a best language!
There are basically two types of programmers; those that deliver and those that don't!
At the end of the day the client wont be concerned if about what language you used (except the client is very tech savvy)! The client's major concern is if it works as requested or not!

However, as a matter of opinion, I would advice that you pick whatever back-end language and JavaScript for web development. A lot of web companies use JavaScript in some way or the other.
Programming / Re: QUIZ: How Many Lines Of Code Can You Use To Reverse A List by nsimageorge(m): 7:26pm On Jun 11, 2017
This is interesting...

In PHP

$array = array(1, 2, 3);
for($i=sizeof($array)-1; $i>=0; $i--){echo $array[$i];}

2lines grin grin
Programming / Re: Write A Thesis For Me And Get Paid 30k by nsimageorge(m): 7:08pm On Jun 11, 2017
Is there any particular language needed for your thesis? More details would be appreciated....
Programming / Re: Explanation Needed In PHP by nsimageorge(m): 6:48pm On Jun 11, 2017
http://php.net/manual/en/language.operators.errorcontrol.php

Like Echatbook said, the @silences errors for a function(read the php manual above)

If you don't mind me asking what exactly whee you trying to achieve with your function. It would be best to write a bug free code.

1 Like

(1) (2) (of 2 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. 31
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.