Webmasters › Re: Post your PHP Problems Here by Adesege(m): 4:37pm On Mar 12, 2015 |
You need to understand that: . PHP - is a server side language. . Javascript - is client side language . They are two different things. When you wana do some stuff at the backend, use server side language and javascript for client side. . They can work together anyway. . Adeyinka12: Dear gurus in the house,is it a necessity to know javascript before becoming a programmer.because i'm just learning javascript and is so difficult for me to understand. |
Webmasters › Re: Post your PHP Problems Here by Adesege(m): 4:33pm On Mar 12, 2015 |
Casting will be the best option then. . You can read more on php.net. . (int) - Integer casting . (float) - Casting into a float number . (object) - Object casting . (string) - casts into string . Etc. . You might find this handy. . <?php . $array=(object)('name'=>'Adesege', 'mobile'=>'0123456789'); . //then fetch as object . echo $array->name."-".$array->mobile; . ?> . Instead of doing a foreach or for loop. Just cast it into object. . kobonaire: Thanks for that. I'm yet to code. I am trying to introduce some error checking into an existing code base. Some background : There is an XML based configuration file for a system that I an parsing with PHP. Some of the tag values will contain integers (stored as string in the file) and I am just trying to ensure that they are indeed integers and not float or any other characters. |
Webmasters › Re: Post your PHP Problems Here by Adesege(m): 4:05pm On Mar 12, 2015 |
It depends on how you stored it in ur db. Is it the image path that is being stored in the db? . Try: . //query the table $fetch=mysql_fetch_array($query); $img=$fetch["image"]; echo '<img src="$img" />'; . Post ur code silvernus0: hi gurus, i knw how to set up a file image upload textbox to upload image to the database. after d image is uploaded to d database how do i call d image to show on a page e.g photos.php page wen it is viewd on d browser to see d images i uploaded to d db. tnks Gurus. |
Webmasters › Re: Post your PHP Problems Here by Adesege(m): 4:00pm On Mar 12, 2015 |
Please post a sample code. . . But u can cast the string into int using: . . $string=(int)$fetch["string"]; . Post a sample code kobonaire: I'm reading strings from an XML file, how can I check that the values are integers? |
Webmasters › Re: Post your PHP Problems Here by Adesege(m): 6:36pm On Mar 11, 2015 |
Next time, it's advisable u post a sample code where u nid help. We can't work on abstract. Let's create a php function, so we can use it multiple times in our project. <?php function truncate($text, $chars =150, $terminator=' …'){ $cutPos = $chars - mb_strlen($terminator); $boundaryPos = mb_strrpos(mb_substr($text,0, mb_strpos($text,' ', $cutPos)),' '); return mb_substr($text,0, $boundaryPos ===false? $cutPos : $boundaryPos). $terminator; } ?> By default, the text will be truncated by 150chars and terminated by "...". You can edit the terminator variable to a link and the chars variable. Feel free to let me know if u encountered any problem. . EDIT:: USUAGE: truncate($text,"300","..."  or truncate($text,"300","<a href='path/to/page'>some text"  Debeloved87: how can i shorten posts on the main page of the blog, that viewers will have to view the whole post by clicking "continue reading" ? |
Webmasters › Re: Post your PHP Problems Here by Adesege(m): 8:36pm On Mar 09, 2015 |
Try to take a look at jplayer or video.js. They are good plugin to achieve ur aim. kentc3: Good Day Guys, Please i will want to play videos on my website, but do not want to make use of the HTML5 Video tag to do that.... i tried using jw player but the process of setting up the ftp and embedding in my web page and so on, seems to be cumbersome.... please i will love someone to assist me with other ways of achieving this .... thanks. anticipating your replies. |
Literature › Re: Tade - The Rise Of An Activist. by Adesege(m): 8:42am On Mar 08, 2015 |
No let ur head swell o. rapmike: I miss you too sweety. |
Webmasters › Re: Post your PHP Problems Here by Adesege(m): 9:51am On Mar 07, 2015 |
Good to know. Cheers blink182: Ok, we solved it. Thanks. |
Nairaland General › Lagos May Experience Heavy Traffic Today. by Adesege(op): 9:15am On Mar 07, 2015 |
-- Adesege reporting
The Honorable Commissioner for Transport, Lagos State, Mr. Kayode Opeifa, has stated that due to the scheduled rally by the Buhari / Osinbajo Campaign Organisation, some sections of the roads in Lagos may not be accessible by motorists.
The rally which is set to hold today, Saturday March 7th, will move from Maryland along Ikorodu road through Funsho Williams Avenue to Teslim Balogun Stadium starting from 8am to 2pm will have various sections of the road closed.
Service lanes and unoccupied sections of the express lane corridor inward TBS will be available to motorists during the procession. Motorists are therefore advised to use the service lanes of Ikorodu road and Funso Williams Avenue, Agege Motor road or Third Mainland bridge.
200 Lastma personnel will be deployed to manage traffic and other incidences. |
Webmasters › Re: Post your PHP Problems Here by Adesege(m): 9:09am On Mar 07, 2015 |
I learnt it cost a fortune to enroll in that institution CODEEATER: M starting my NIIT course really soon...
Just 4 cert sake... according to wat I hear dey don't teach much |
Webmasters › Re: Post your PHP Problems Here by Adesege(m): 9:07am On Mar 07, 2015 |
|
Webmasters › Re: Post your PHP Problems Here by Adesege(m): 9:05am On Mar 07, 2015 |
A sketch... You'll need a html form, with the action attribute pointing to where your php form processor page is. Leave blank if the code is on the same page as the html form or put <?php echo $_SERVER["PHP_SELF"]; ?>. Don't forget to use POST as the method. 2. On your processing page, get the values by setting variables to it. E.g $mail=htmlspecialchars($_POST["email"]); The "email" key should correspond with the name you set in your html form. Also don't forget to sanitize your input. You should have made a connection before now. Example code: <?php if(isset($_POST["submit"]) && $_POST["submit"] !==""  { include("db.php"  ; //set your variables and sanitize $name=htmlspecialchars($_POST["name"]); $mail=htmlspecialchars($_POST["mail"]); $content=htmlspecialchars($_POST["content"]); //do necessary if else //insert into the db //if insert, send mail(); //echo message } ?> turl: Thought I would also be needing to add some database info. Guess I need to read up the whole tut. I got frustrated after the codes just stopped making sense and gave up. Thanks. |
Webmasters › Re: Post your PHP Problems Here by Adesege(m): 8:52am On Mar 07, 2015 |
It's usuall advisable to use the $_POST variable to send information to the server. PHPMailer should be recommended instead. Elvisten10: all you need to know to achieve this is HTML FORM, PHP $_GET OR $_POST VARIABLES (ARRAY) AND PROBABLY THE PHP MAIL() FUNCTION. You write the html form and put the contact php script name as the value for the action attribute, then you get the submitted data with the $_GET or $_POST variables and probably send it to your mail using the mail function. |
Webmasters › Re: Post your PHP Problems Here by Adesege(m): 8:49am On Mar 07, 2015 |
For standard, it is not advisable to use the mail() function. Not that it's deprecated but there are less to what to you can do with it. I'll recommend you use PHPMailer. With this, you can set headers, attach docs to mails and other great features. adewasco2k: Read up php function mail()
Also you should know about forms and POST/GET |
|
|
|
Romance › Re: Weird Questions Ladies Ask In Order Not To Look Cheap by Adesege(m): 7:48pm On Feb 24, 2015 |
Na so na. To be real na im sure pass dan to b wetin person no be. tosyne2much: Banana Island ke ? Bros I still be that niqqa wey still dey hustle real hard out there to be the best amongst my equals
I no be hypocrite wey go come nairaland dey form say my papa na Dangote |
Romance › Re: Weird Questions Ladies Ask In Order Not To Look Cheap by Adesege(m): 4:08pm On Feb 24, 2015 |
For where? Sheyb na u just talk say u dey drive Evoque X6 and u get 5 houses for Banana Island? Lol. No mind that guy/gurl jhawe. Dem go dey form holy holy, yet na dem worse pass. We knw people like them na. Sister Nkechi for church but for outside? Na dem they bleep pass. tosyne2much: Hahahahaha.. Egbon, me sef dey find house rent oooo |
Romance › Re: Weird Questions Ladies Ask In Order Not To Look Cheap by Adesege(m): 11:59am On Feb 24, 2015 |
Bros, my landlord just send me commot for house. I fit get some change from you make i take rent house, abeq? tosyne2much: Hahaha see this bush man/lady.. Were you unleashed from a zoo or what ?
Who the hell are ? Aside nairaland, I bet you can't stand me behind the internet
Hahaha did u just make mention of a GUTTER BOY? If that's the level you want to take it to.. Lemme start by asking, which of the latest Rover Sport are you able to afford ? How many European countries have you travelled to ? How many people look up to you for their immediate needs ?
We've got rich niqqas on this forum and most of them avoid boasting of their finances. Don't just know why people who are struggling for 3 square meal out there would come to this forum and hype themselves as if they are the sons of Dangote
Dick head, I'm sowi rich people don't talk this way.. |
Webmasters › Re: Post your PHP Problems Here by Adesege(m): 9:49am On Feb 24, 2015 |
Create a folder in C:\wamp\www, say 'sample'. Then launch ur browser and access http://localhost/sample. Ensure your wampserver is on and has the green icon on the taskbar. Vijon: gud day all,plz help me out wit dis-i cant preview my php files on my wampserver again.if i try accessing it tru d server,it returns an error message.den if i try to open d file using dreamwaver cs5,it trigger d browser to start downloading d php file repeatedly.i ve try uninstalling nd re-installing d wampserver bt d problem is still dere.any help my pple |
Family › Re: Hilarious Nigeria: What If Your Wife SLAPS Your Mum? by Adesege(m): 1:06pm On Feb 21, 2015 |
|
Family › Re: Hilarious Nigeria: What If Your Wife SLAPS Your Mum? by Adesege(m): 8:04pm On Feb 19, 2015 |
Lol! U sha no wan gree. U dn forget reflex action? E fit b slip of hand na. How u doing? Pweetyradiance: dat is if me I go gree settle with am na, afterall if him luv me as him claim him no go slap my mama. |
Christianity Etc › Re: Do You Think Someone Can Actually Bewitch Or Curse Another Person? by Adesege(m): 9:43pm On Feb 18, 2015 |
Bro, go despoil Ijebu, Ondo or Ibadan girl and run away. Just to have a first hand experience. I don't know myself if I believe this or not.
While one part is telling me there's nothing like witchcraft and that it's all a twisted myth of ridiculous naive claims, another part is saying otherwise.
Personally, I don't have any experience with it and I don't know of people who conduct or are victims of it. But I've heard of It. A lot and a lot. |
Family › Re: Hilarious Nigeria: What If Your Wife SLAPS Your Mum? by Adesege(m): 9:38pm On Feb 18, 2015 |
I mean 'It is easier said than done' *winks* If you or your Bro. slap am, you don forget say na im house you go still stay put if everything don settle? Pweetyradiance: okay me too I don hear before e go start trekking one slap go cure d craze |
Family › Re: Hilarious Nigeria: What If Your Wife SLAPS Your Mum? by Adesege(m): 9:31pm On Feb 18, 2015 |
I hear o! To craze no be the problem, na to start trekking - Proverb. Pweetyradiance: O boy I swear e go red for am oh, him no fit try dat shit sef. na craze? even if na craze sef I sure say one slap from my brother go cure d craze because e go definitely happen. |
Family › Re: Hilarious Nigeria: What If Your Wife SLAPS Your Mum? by Adesege(m): 9:11pm On Feb 18, 2015 |
Na men like am dey beg their wife na. BISIXCLUSIVE: No vex uncle,just an imagination. Lol |
Family › Re: Hilarious Nigeria: What If Your Wife SLAPS Your Mum? by Adesege(m): 9:11pm On Feb 18, 2015 |
You are not a man shey? But a WOman? What if na your hubby slap your mama? Pweetyradiance: what do you see? |
Family › Re: Hilarious Nigeria: What If Your Wife SLAPS Your Mum? by Adesege(m): 9:09pm On Feb 18, 2015 |
What if your wife na boxer? As in, she dey beat top wrestlers and win them. You go touch her?
... One of those yoruba movies |
Family › Re: Hilarious Nigeria: What If Your Wife SLAPS Your Mum? by Adesege(m): 9:04pm On Feb 18, 2015 |
I see! Pweetyradiance: Hmmmmm my wife won't dare such and go Scot free, I swear I will make life miserable for d lady. she will regret eva knowing me,what a mess. *huh! I don forget say I no be man oh* |
Family › Re: Hilarious Nigeria: What If Your Wife SLAPS Your Mum? by Adesege(m): 9:03pm On Feb 18, 2015 |
Na seasonal movies maybe. olaboy001: [b]OP, my wife slaps my mum, are they acting home video. |
Family › Re: Hilarious Nigeria: What If Your Wife SLAPS Your Mum? by Adesege(m): 9:02pm On Feb 18, 2015 |
Seconded. simpleseyi: I am sure that if my wife tries that through the influence of ogbanje or mammy water spirit because I know my wife will never image that when she is in her right senses. If however, she does, I am very sure that I will be going to check on her everyday for about a month at the general hospital because that is where my mother will send her to. Mi oni iya osi (I don't have a mumu mother), you can ask iya Mukaila and iya Bose what my mother did to them in 1806 that lead to the Yoruba civil war. |