-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
Perhaps there's some html tag being opened in the included file, that's not being closed? Perhaps there's a loop somewhere that's never ending? Who knows? We can't possibly help you without seeing some code.
-
[SOLVED] How to reference data from a MySQL query with PHP
.josh replied to rmmo's topic in PHP Coding Help
That means you had output before the session_start();. Is this being included in some other file that already has output? Do you have any whitespace or lines before your opening <?php tag if you don't? Without session_start(); you cannot make that session variable 'loggedin' so if you want to make use of session vars for data persistence from page to page, you need session_start(); at the top of every page that will use it. If that script is being included in some other page, put it at the top of the page that's including it. -
okay...so, do you want $charlieinfo to have the same info as $charlie? Assuming you do.. $info = "info"; $charlie = "some piece of data"; $charlie.$info = $charlie; echo $charlieinfo;
-
eh, well I mean...trying to add flavor to it kind of defeats the purpose of plain text, now doesn't it?
-
[SOLVED] How to reference data from a MySQL query with PHP
.josh replied to rmmo's topic in PHP Coding Help
<?php session_start(); $host = 'localhost'; // or your db host $dbuser = 'xxxxx'; // db username $dbpass = 'xxxxx'; // db password $dbname = 'xxxxx'; // db name // connect to and select db $conn = mysql_connect($host, $dbuser, $dbpass) or trigger_error("SQL", E_USER_ERROR); $db = mysql_select_db($dbname, $conn) or trigger_error("SQL", E_USER_ERROR); // if there are posted vars... if ($_POST['username'] && $_POST['password']) { // sanitize $username = mysql_real_escape_string($_POST['username']); $password = mysql_real_escape_string($_POST['password']); // see if they are in table $query = "SELECT `customer_name`, `customer_password` FROM `customer` WHERE `customer_name` = '$username' AND `customer_password` = '$password'"; $results = mysql_query($query, $conn) or trigger_error("SQL", E_USER_ERROR); // find out how many rows returned. $rows = mysql_num_rows($results); // if something returned... if ($rows > 0) { // user/pass exist, do something, like make a session var signifying user is logged in $_SESSION['loggedin'] = true; // if nothing returned... } else { //user/pass do not exist, do something } // end if..else $rows // if no username and/or pass posted... } else { // username and/or password not entered in form, do something } // end if..else username/password ?> -
how is $user['id'] being assigned? My very first thought is that you were depending on register globals being on, and your server got upgraded and they are now off.
-
Your original thread was moved to 3rd party scripts, because you mentioned it was a 3rd party script. Please do not make multiple threads asking the same thing. Thread closed.
-
Someone help me with a query?
.josh replied to nba1985's topic in PHP Installation and Configuration
Please do not make multiple threads asking the same thing. Leaving other thread open and closing this one, due to that one having relevant response. -
picking up transmissions from the aliens?
-
You mean other than the fact that you're begging for someone to hack your site? mysql_query ("Insert into userinfo(username,email,password,location) values ( '{$_REQUEST['userid']}' , '{$_REQUEST['email']'}, '{$_REQUEST['password']'}, '{$_REQUEST['location']}')"); also your first var in the values list is 'userid' i suspect you meant 'username'
-
so...example: $charlie = "blah"; a) do you want it to literally say "$charlieinfo" b) do you want it to say "blahinfo" c) are you wanting to create a new variable called $charlieinfo?
-
If I remember correct, in the manual, one of the comments for str_split shows how to do a php4 compatible version.
-
you got error reporting turned on?
-
you know what I think I know what the problem is. You have ORDER BY ASC you need to specify what column to order by. ORDER BY um_members ASC
-
so what's the error? I notice you just have a message in your other die. Do this: $list_raw = mysql_query("SELECT * FROM um_members ORDER BY ASC") or die(mysql_error());
-
It's not going to be an issue. We're all gonna die soon anyways. http://www.phpfreaks.com/forums/index.php/topic,204299.0.html
-
well then your query is failing. or your connection is failing. add a die(..) after your other mysql_xx calls (not the fetch_array). The fetch_array needs to be the condition inside the loop.
-
while ($list = mysql_fetch_array($list_raw)) {
-
that's because $username is not defined.
-
[SOLVED] calling the pre installed fonts from server
.josh replied to bobinindia's topic in PHP Coding Help
so...you don't have those on your own computer already? -
[SOLVED] calling the pre installed fonts from server
.josh replied to bobinindia's topic in PHP Coding Help
okay so if your host say they have all the classic fonts installed, ask them what the path is. -
[SOLVED] calling the pre installed fonts from server
.josh replied to bobinindia's topic in PHP Coding Help
ah yeah, forgot about that. -
[SOLVED] calling the pre installed fonts from server
.josh replied to bobinindia's topic in PHP Coding Help
As far as I know, there's no way to access those. Nor do your server's fonts really have anything to do with what's being displayed to the user in their browser. You specify the font with html or css. If the user has it on their computer, it will be rendered properly. If they do not, any number of unexpected things could happen. If your lucky, the browser will just default to arial or something. -
How to check if loop is at the last or first mysql row result
.josh replied to Jaguar's topic in PHP Coding Help
Why don't you want the title to be assigned every time? Does that value change? Worried about performance? Only other way is to make a condition. But since the condition will be checked every single iteration...you really aren't saving on performance; you're just trading one thing for the other. But nonetheless, you can simply just check to see if $site_title exists inside your condition: while($row = mysql_fetch_assoc($result)) { if (!$site_title) $site_title = $row['title']; // other code here } -
I think probably what I would do is use flash to make a map. Make each state an object. Have php pass an array or a string of 1's and 0's to the flash object, 1 being on, 0 being off. Have flash display each state object as "lit up" or not, based on the 1's and 0's. I mean, you're map is just a bunch of lines right? The great thing about flash is that it's vector based, so it's really small. Your entire map would be smaller than even a single one of your gif files. Plus, the calculations would be done on the client, so no suffering on load times.