Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,157,966 members, 7,835,224 topics. Date: Tuesday, 21 May 2024 at 07:17 AM

Post your PHP Problems Here - Webmasters (7) - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Post your PHP Problems Here (63426 Views)

Thread For All Your Blogging Related Problems Here / Get And Request For Your Php Problems Here / Connecting To Your Gmail Account From Your Php Application. (2) (3) (4)

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) ... (20) (Reply) (Go Down)

Re: Post your PHP Problems Here by Irshittabey: 12:06pm On Nov 16, 2013
adewasco2k:
Check the user's privileges
What should I do with the user's privileges,and is it the one I see on the xampp's panel
Re: Post your PHP Problems Here by sunday478(m): 7:17pm On Nov 16, 2013
Irshittabey:
What should I do with the user's privileges,and is it the one I see on the xampp's panel
yes
Re: Post your PHP Problems Here by Irshittabey: 10:44pm On Nov 21, 2013
thanks the reason why i couldnt connect to d data base was due to a mistake in my php commad (if(isset)) as soon as i removed it ,everything started working thanks everyone
Re: Post your PHP Problems Here by micope33: 2:26am On Nov 23, 2013
please i want to know maybe there are other software one can use in developing website like creating chat, forum, and for applicant registration access
Re: Post your PHP Problems Here by 5hyguy: 5:47am On Nov 23, 2013
Other softwares? Av u used dreamweaver, and there also visual studio for .net users
Re: Post your PHP Problems Here by ncpat(m): 10:57am On Nov 29, 2013
just passing
Re: Post your PHP Problems Here by onyenma1: 7:51pm On Dec 04, 2013
hello. Pls i need to no about website designing and coding. Thanks. My email is onyenmavictor@gmail.com
Re: Post your PHP Problems Here by Nobody: 7:00am On Dec 05, 2013
onyenma1: hello. Pls i need to no about website designing and coding. Thanks. My email is onyenmavictor@gmail.com

Do U Stay in Abuja, I can take u on a one on one Training session.. I Have video tutorials Too..

If u don't stay in abuja, Then I'll send u Free links to download Ebooks and softwares to use..

All u need is passion to learn..

Email: Djangocode@gmail.com
Re: Post your PHP Problems Here by DaPinkHackeR(m): 12:21pm On Dec 05, 2013
Please help me to check what's wrong with php ilichat41 code.
User will be online but clicking a link to the page it returns error that NOT LOGGED IN. istead of redirecting the user to the requested page.

// AUTH
$id = intval($_SESSION['id']);
$password = mysql_escape_string($_SESSION['password']);
$q = mysql_query("SELECT * FROM `chat_users` WHERE `id` = '" . $id . "' AND `password` = '" . md5($password) . "';"wink;

if (mysql_affected_rows() == 0) {
echo "Not logged in!<br/>\n";
include_once "themes/" . intval($_COOKIE['theme']) . "/foot.php";
exit();
} else {
$nickname = mysql_result($q, 0, 'nickname');
}
// END AUTH
Re: Post your PHP Problems Here by adewasco2k(m): 1:54pm On Dec 05, 2013
A little debugging will show you whats wrong

DaPinkHackeR: Please help me to check what's wrong with php ilichat41 code.
User will be online but clicking a link to the page it returns error that NOT LOGGED IN. istead of redirecting the user to the requested page.

// AUTH
$id = intval($_SESSION['id']); //try is_numeric

// echo $id to see the value of $id here

$password = mysql_escape_string($_SESSION['password']);

// echo $password to see the value

$q = mysql_query("SELECT * FROM `chat_users` WHERE `id` = '" . $id . "' AND `password` = '" . md5($password) . "';"wink;

if (mysql_affected_rows() == 0) { //This is the problem you have to pass in the result of the mysql_query()
echo "Not logged in!<br/>\n";
include_once "themes/" . intval($_COOKIE['theme']) . "/foot.php";
exit();
} else {
$nickname = mysql_result($q, 0, 'nickname');
}
// END AUTH




finally found your problem while debugging,

(mysql_affected_rows() == 0)
{
}


should be


(mysql_affected_rows($q) == 0)
{
}
Re: Post your PHP Problems Here by adewasco2k(m): 2:21pm On Dec 05, 2013
Also i think you should know The Mysql extension is deprecated and will be removed in the future: use Mysqli or PDO instead

copied this from a page:


The MySQL extension is:

Not under active development
Officially deprecated (as of PHP 5.5. It's likely to be removed in the next major release.)
Lacks an OO interface
Doesn't support:
Non-blocking, asynchronous queries
Prepared statements or parameterized queries
Stored procedures
Multiple Statements
Transactions
All of the functionality in MySQL 5.1

Since it is deprecated, using it makes your code less future proof.

Lack of support for prepared statements is particularly important as they provide a clearer, less error prone method of escaping and quoting external data than manually escaping it with a separate function call.
Re: Post your PHP Problems Here by shanny247: 3:02pm On Dec 05, 2013
Hi.. I'm new & I really want the activation code for photo studio PRO.. Please help asap!!!! Highly appreciated . My pin is 29C6FBAA & u can help by emailing me @ shanellepillay38@gmail.com smiley
Re: Post your PHP Problems Here by Nobody: 8:44pm On Dec 05, 2013
Php lords, thanks for these tread. Is it possible to use the text in a formfield e.g subject as header and maybe subject 2 as mata description in php?
If yes, how can i go about it, i want to build a form that will send d form content and create new page with mata tags.
You can add me on 2go with onyeukwu i like to meet any php killer in abuja. Thanks
Re: Post your PHP Problems Here by adewasco2k(m): 9:36pm On Dec 05, 2013
Don Ocso: Php lords, thanks for these tread. Is it possible to use the text in a formfield e.g subject as header and maybe subject 2 as mata description in php?
If yes, how can i go about it, i want to build a form that will send d form content and create new page with mata tags.
You can add me on 2go with onyeukwu i like to meet any php killer in abuja. Thanks

Even though i didnt get your question well i think this will show you something:


<?php error_reporting=0; //or set $title =" "; so you dont get an error before setting the title.

if(isset($_POST['submit']))
{
$title = $_POST['title'];
}
?>

<!doctype html>
<html>
<head>
<title><?php echo $title; ?></title>
</head>
<body>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" >
<label for ="title">Title: </label><input type="text" name="title" />
<input type="submit" name="submit" value="Send Title" />
</form>
</body>
</html>



Note this is a very bad example having the document first without a title, what you can do it when form is submited you can use the action to direct to another page, a new page now and us that title variable to set the variable, same applies to meta description.

dont know if i said anything, also i live in Abuja, tho away right now wink
Re: Post your PHP Problems Here by Nobody: 9:55pm On Dec 05, 2013
adewasco2k:

Even though i didnt get your question well i think this will show you something:


<?php error_reporting=0; //or set $title =" "; so you dont get an error before setting the title.

if(isset($_POST['submit']))
{
$title = $_POST['title'];
}
?>

<!doctype html>
<html>
<head>
<title><?php echo $title; ?></title>
</head>
<body>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" >
<label for ="title">Title: </label><input type="text" name="title" />
<input type="submit" name="submit" value="Send Title" />
</form>
</body>
</html>



Note this is a very bad example having the document first without a title, what you can do it when form is submited you can use the action to direct to another page, a new page now and us that title variable to set the variable, same applies to meta description.

dont know if i said anything, also i live in Abuja, tho away right now wink


Hmmm.. Boss so u stay in Abuja and we've been Nairalanding n Tweeting all these while..

I stay in Efab Estate Though.. Nice One..
Whenever u are around.. Holla..
Re: Post your PHP Problems Here by Lastdon02(m): 1:41am On Dec 06, 2013
hello good day gurus i am crating i website for both mobile and pc i dont want some files to show on mobile so i created two files headrmobile.php and headerpc.php so i used this php code to dectect it
<code>
<?
if($browser=='mobile')
include"headermobile.php";
else
include"headerpc.php";
?>
</code>

but its not working please any other way can do it help me out tanks

(Modify) (Quote) (Report)
Re: Post your PHP Problems Here by adewasco2k(m): 3:05am On Dec 06, 2013
Lastdon02: hello good day gurus i am crating i website for both mobile and pc i dont want some files to show on mobile so i created two files headrmobile.php and headerpc.php so i used this php code to dectect it
<code>
<?
if($browser=='mobile')
include"headermobile.php";
else
include"headerpc.php";
?>
</code>

but its not working please any other way can do it help me out tanks

(Modify) (Quote) (Report)

i cant see your full code but this will not work, its far more complex than this, you can use REGEX to check for the useragent of the broser but i dont waste my time with it, php is open source and there are many script to do this, i alwasy use this one

http://code.google.com/p/php-mobile-detect/wiki/Mobile_Detect

work great

if you include the script from that link you will now have (from your code)


include 'Mobile_Detect.php'; // this is the class file you have downloaded above
$detect = new Mobile_Detect; // instantiating the mobile detect class

if ($detect->isMobile())
{
include"headermobile.php";

}elseif ($detect->isTablet()) //extra code for you if you want to differentiate between mobile and tablets
{
include"headertablet.php";
}else
{
include"headerpc.php";
}




Thats all grin
Re: Post your PHP Problems Here by Nobody: 4:26am On Dec 06, 2013
adewasco2k:

Even though i didnt get your question well i think this will show you something:


<?php error_reporting=0; //or set $title =" "; so you dont get an error before setting the title.

if(isset($_POST['submit']))
{
$title = $_POST['title'];
}
?>

<!doctype html>
<html>
<head>
<title><?php echo $title; ?></title>
</head>
<body>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" >
<label for ="title">Title: </label><input type="text" name="title" />
<input type="submit" name="submit" value="Send Title" />
</form>
</body>
</html>



Note this is a very bad example having the document first without a title, what you can do it when form is submited you can use the action to direct to another page, a new page now and us that title variable to set the variable, same applies to meta description.

dont know if i said anything, also i live in Abuja, tho away right now wink

thanks, the codes look much like what I want, the tittle of d form will crete new page tittle while d body will be d page body.
Re: Post your PHP Problems Here by Lastdon02(m): 4:36am On Dec 06, 2013
adewasco2k:

i cant see your full code but this will not work, its far more complex than this, you can use REGEX to check for the useragent of the broser but i dont waste my time with it, php is open source and there are many script to do this, i alwasy use this one

http://code.google.com/p/php-mobile-detect/wiki/Mobile_Detect

work great

if you include the script from that link you will now have (from your code)


include 'Mobile_Detect.php'; // this is the class file you have downloaded above
$detect = new Mobile_Detect; // instantiating the mobile detect class

if ($detect->isMobile())
{
include"headermobile.php";

}elseif ($detect->isTablet()) //extra code for you if you want to differentiate between mobile and tablets
{
include"headertablet.php";
}else
{
include"headerpc.php";
}




Thats all grin

tanx Bro pls can i have ur Mobile number?
Re: Post your PHP Problems Here by adewasco2k(m): 4:38am On Dec 06, 2013
Lastdon02:

tanx Bro pls can i have ur Mobile number?

pm me, i will send you
Re: Post your PHP Problems Here by Lastdon02(m): 4:44am On Dec 06, 2013
adewasco2k:

pm me, i will send you

bro since day online self e beta pls i don't understand sum tiz in what u just posted
Re: Post your PHP Problems Here by adewasco2k(m): 4:59am On Dec 06, 2013
Lastdon02:

bro since day online self e beta pls i don't understand sum tiz in what u just posted

Do you know OOP?

if you dnt still dont worry, just download the file called Mobile Detect.php

now place it in your file and on your script include it at the top like this include "mobileDetect.php";

now you have access to all the stuff in that file you dont need to know them

but to use them you have to create an object (OOP) to access that class so you do $detect = new Mobile_Dectect; which is the class.

so now you can use the $detect to access all functions in the Mobile Detect class.

e.g so if a user is user a mobile if you do if($detect->isMobile()) will be true if a user is using a tablet like ipad then if($detect->isTablet()) will be true and if both are false then the person is using either an unsupported browser or a PC.

the functions isMobile() and istablet() are all from the class file you included so in OOP to access then you use the object you created ($detect) to access them like this $detect->any function in the class.

You can mail me if you need further assistance info@wasconet.com and just read about OOP
Re: Post your PHP Problems Here by Lastdon02(m): 5:25am On Dec 06, 2013
adewasco2k:

Do you know OOP?

if you dnt still dont worry, just download the file called Mobile Detect.php

now place it in your file and on your script include it at the top like this include "mobileDetect.php";

now you have access to all the stuff in that file you dont need to know them

but to use them you have to create an object (OOP) to access that class so you do $detect = new Mobile_Dectect; which is the class.

so now you can use the $detect to access all functions in the Mobile Detect class.

e.g so if a user is user a mobile if you do if($detect->isMobile()) will be true if a user is using a tablet like ipad then if($detect->isTablet()) will be true and if both are false then the person is using either an unsupported browser or a PC.

the functions isMobile() and istablet() are all from the class file you included so in OOP to access then you use the object you created ($detect) to access them like this $detect->any function in the class.

You can mail me if you need further assistance info@wasconet.com and just read about OOP

chai dis bross nice no worry u go marry ma sister i will try all what u said and expect my mail soon oga
Re: Post your PHP Problems Here by sunday478(m): 11:44am On Dec 06, 2013
Pls, help,
I have two problems

1. My ammps server did not want to open the phpmyadmin interface. What happen was that, I have a user I created, so after writing an SQL query to interact with a table variable, so that it will return true, the sql is not return the the variable, as a matter of fact, the connection keep dying, so as a learner that I am, i tried to use another user(root, localhost), but couldn't remember ste any password for it, so I tried to remove the password. Boom! Access. Pls help.

2. This is actually what led to the problem of my ampps. I tried to query one part of the datbase table, but it is not returning the require value. what code do I need to show that a user exist, let say I querry the dbase, about a particular username, when the user name is entered, if the user name is in that table them it will return exist.
Re: Post your PHP Problems Here by dexed(m): 8:30pm On Dec 06, 2013
DaPinkHackeR: Please help me to check what's wrong with php ilichat41 code.
User will be online but clicking a link to the page it returns error that NOT LOGGED IN. istead of redirecting the user to the requested page.

// AUTH
$id = intval($_SESSION['id']);
$password = mysql_escape_string($_SESSION['password']);
$q = mysql_query("SELECT * FROM `chat_users` WHERE `id` = '" . $id . "' AND `password` = '" . md5($password) . "';"wink;

if (mysql_affected_rows() == 0) {
echo "Not logged in!<br/>\n";
include_once "themes/" . intval($_COOKIE['theme']) . "/foot.php";
exit();
} else {
$nickname = mysql_result($q, 0, 'nickname');
}
// END AUTH
Instead of quering the database everytime just to know if the user is logged in, y not use a session variable to check if a user is logged in after the initial authorization, something like dis
/*$_SESSION['loggedin'] is 1 wen user is
*logged in and have an active session,
*0 wen not

*/
if($_SESSION['loggedin']!='1'){
$redirectUrl="http://yoursite.com/loginpage.php";
header( "Location: $redirectUrl " ) ;
exit;
}
Plus I don't think storing user passwords in plain text without encryption is ok. N storing them in session variables too isn't quite ethical.
Re: Post your PHP Problems Here by Onlinebiz2012: 8:32am On Dec 12, 2013
sunday478: Pls, help,
I have two problems

1. My ammps server did not want to open the phpmyadmin interface. What happen was that, I have a user I created, so after writing an SQL query to interact with a table variable, so that it will return true, the sql is not return the the variable, as a matter of fact, the connection keep dying, so as a learner that I am, i tried to use another user(root, localhost), but couldn't remember ste any password for it, so I tried to remove the password. Boom! Access. Pls help.

2. This is actually what led to the problem of my ampps. I tried to query one part of the datbase table, but it is not returning the require value. what code do I need to show that a user exist, let say I querry the dbase, about a particular username, when the user name is entered, if the user name is in that table them it will return exist.

$you=mysql_query("SELECT username from table_name WHERE username =$username"wink;
$check=mysql_num_rows($you);
if($check>0) { echo "Boo ! Username already exist"; }


don't be surprise if d above code smell, i wrote it in d toilet
Re: Post your PHP Problems Here by sunday478(m): 8:52pm On Dec 12, 2013
Onlinebiz2012:

$you=mysql_query("SELECT username from table_name WHERE username =$username"wink;
$check=mysql_num_rows($you);
if($check>0) { echo "Boo ! Username already exist"; }


don't be surprise if d above code smell, i wrote it in d toilet
ok, i will try it.
Re: Post your PHP Problems Here by supernet5: 9:47pm On Dec 12, 2013
hi webmasters,
Please how do i configure a wamp server so that it can be accessed over a network that runs on windows 8, i have installed the wamp server but when i want to connect to it on a client system over the network it specifies an error which is the server is taking too long to respond, i have tried several ways to configure it so that it can be accessed over the network. Please any solution to it will be highly appreciated.
Re: Post your PHP Problems Here by Jintu4u: 2:53am On Dec 13, 2013
here is wapka/xtgem/php All code/script.....Just see and download...now...all script....

http://m-loft.tk
Re: Post your PHP Problems Here by Nobody: 12:16am On Dec 14, 2013
.
Re: Post your PHP Problems Here by jorcycos: 7:21pm On Dec 14, 2013
pls guys i need your help i just downloaded smf and am trying to customize the forum, so in order to customize the footer am havin error message: You don't have permission to access /index.php on this server.
This is code

function template_body_below()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo '
</div>
</div></div>';

// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<div id="footer_section">
<div class="rightfoo"><div class="leftfoo">
<div class="frame">
<!-- Empty footer links. -->
<a class="foo_link" href="#">',$txt['gotop'],'</a>

<div class="inn_footer">
<ul class="reset">
<li class="copyright">', theme_copyright(), '</li>
<li><a id="button_xhtml" href="http://validator.w3.org/check?uri=referer" target="_blank" class="new_win" title="', $txt['valid_xhtml'], '"><span>', $txt['xhtml'], '</span></a></li>
', !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<li><a id="button_rss" href="' . $scripturl . '?action=.xml;type=rss" class="new_win"><span>' . $txt['rss'] . '</span></a></li>' : '', '
<li class="last"><a id="button_wap2" href="', $scripturl , '?wap2" class="new_win"><span>', $txt['wap2'], '</span></a></li>
<li class="copyright">Diamondnaira by <a href="http://www.diamondnaira.com">Joseph Joshua.</a></li>
</ul>';

// Show the load time?
if ($context['show_load_time'])
echo '
<p>', $txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</p>';

echo '</div>
</div></div></div></div>', !empty($settings['forum_width']) ? '
</div>' : '';
}

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) ... (20) (Reply)

Add More Than One Website Url To Your Twitter Account. / Top Google Searches By Nigerians 2015;Arsenal,Buhari,Diezani Arrest tops d list. / Mark Zuckerberg Eating Pounded Yam And Eforiro (Photo)

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