whiteboikyle
-
Posts
286 -
Joined
-
Last visited
Posts posted by whiteboikyle
-
-
kk just a quick question.. if you had a function like so
function name($name, $name1, $name2){
}
Can you just do
name($name)
or
name($name, $name1)
or d you have to put all the inputs?
-
Okay well here is my long php query..
select username, image, ranks.rName, members.ID, timestamp, aim, categories.ID, categories.name from members, ranks, ranklookup, categories where members.rank = ranks.id and ranks.id = ranklookup.rid and categories.id = ranklookup.cid and categories.id = ' . $cid . ' and disabled = 0 ORDER BY ranks.ID desc;
now there is 2 ID's that come up in this situation..
1 ID is for the ranks.. and the other ID is the members.. So would i echo either 1 using $row = mysql_fetch_array($result);
if i put $row['ID'] it could get confused?
-
okay well i am trying to make a mysql get the users rank and -3.. is there a way to do it using mysql?
like i tried
`rank`=`rank`-3 but it didn't work..
also how do i make it SET 2 different things.. Here is my full mysql
UPDATE `members` SET `disabled` = '0' and `rank` = `rank-3 WHERE username = 'test'
but the `rank` never updates?
anyways.. thanks in advanced
-
No, dont take it rude at all.. I know i cant put my questions together.. I am a bad write. I usually explain stuff by pictures.. But, its a lack of creativity haha..
but, what i ment was i posted that on another forum with like less people then here, (300 members) and they found it first post.
Thats what i ment by that..
-
Sorry doesn't necessarily work "better" but i have found it to be more useful if javascript is "enabled"
header(); functions seem to give alot of grief.. and you always have to put the header function in the head.. and not all the time it is..
-
no lol i figured it out.. Dark Water message me later i will explain it
-
naw i know alot about php.. btw found the function..
eval();
lol i am surprised to see no 1 found that.. lol
-
The way i logically wrote it, is wrong.. but they way i want it to work is correct.. Dont look at my code.. i know what i want it to do.. i was just using to show what i want it to do..
but i want to PRINT PHP CODE TO THE PHP DOCUMENT! that is all
-
Use this function.. it works better
function header_sent($url){ echo "<script language=JavaScript>self.location.href='./$url'</script>"; }
then do this
header_sent("./profile.php?id=$profileID");
-
uhmm do @session_start(); or put it inside the <head></head>
-
hmm why not just do a
for($i = 0; mysql_num_rows($result); $i = $i + 1;){
$order = mysql_result($result, $i, "order");
}
its not an array but it can get you the number of each row.. like row 1 row 2.. etc
-
"INSERT into fyp (Name, AdminNumber, Gender, Address, Hometelephone, MobilePhone, Email, AcadCourse, Year, Path ,Projecttitle, ProjectSupervisor) VALUES ("name", "admin", "gender", "address", "hometel", "hp", "email", "course", "year", "path", "title", "supervisor");"
make that to
"INSERT into fyp (Name, AdminNumber, Gender, Address, Hometelephone, MobilePhone, Email, AcadCourse, Year, Path ,Projecttitle, ProjectSupervisor) VALUES ('$name', '$admin', '$gender', '$address', '$hometel', '$hp', '$email', '$course', '$year', '$path', '$title', '$supervisor');"
-
I was having alot of those problems to..
but i made a function using javascript and php
function header_sent($url){ echo "<script language=JavaScript>self.location.href='./$url'</script>"; }
then where you use your header(location) files do this
header_sent("URL.php");
bam it works
-
if($function == ""){
header("location: main.php");
}
$result = $config->query("SELECT * FROM pages");
for ($i = 0; $i < mysql_num_rows($result); $i = $i + 1)
{
$page = mysql_result($result, $i, "pages");
elseif($function == "$page")
{
include("functions/".$page.".php");
}
}
else{
echo("<center> You entered an invalid function line! </center>");
}
see the if statement and the else at the end..
i want the elseif statements in the middle to be generated!
like so it looks like
if(){
}
elseif(){
}
elseif(){
}
elseif(){
}
else(){
}
of course there will be way more elseif statments then that but i am trying to explain this to you guys
Now i am pretty sure there is a way to do this!
I know the way i wrote it wont work... lol thats why i am asking for help..
now if someone could help me i would be of so much appreciation !
-
Look at my last 1.. i am trying to do alot of elseif's.. but i need it to ECHO the php so to speak.. but not really echo.. It needs to print the actual PHP code through a loop into the PHP! not into the website!
EDIT:
okay well here is another way to explain it.. i dono how else to..
if you do an if statement with some elseifs and else at the end liek so
if(){
}
elseif(){
}
elseif(){
}
elseif(){
}
else{
}
well.. the 3 elseif i want to make them generated.. but i just dono how to make it print php code to the php document..
-
What i am trying to say.. its kinda hard to explain.. but like here is an example..
lets say i have a table that had a column called name..
well
what the name is, its a name of a php file..
and lets say you wanted to loop out the php files.. using php laungage..
so instead of doing something with a loop and echoing something..
i wan it to loop and print some php code.. but not just display it.. i want it to run that php code..
so what i want this code to do is
loop the actual php code
so
$page = banip
would echo this.. (but not really echo.. just show the code)
elseif($function == "banip")
{
include("functions/banip.php");
}
-
okay i am making something where people can add a function.. Well each function is viewed by a $_GET['view'] well... For the function to work it has to be allowed through the view.php page.. So i want it to add an elseif{ the include function } and loop it through..
here is the full page..
<?php include("header.php"); session_start(); $myusername = $_SESSION['myusername']; $function = $_GET['function']; if(isset($myusername)){ if(isset($function)){ if($function == ""){ header("location: main.php"); } $result = $config->query("SELECT * FROM pages"); for ($i = 0; $i < mysql_num_rows($result); $i = $i + 1) { $page = mysql_result($result, $i, "pages"); elseif($function == "$page") { include("functions/".$page.".php"); } } else{ echo("<center> You entered an invalid function line! </center>"); } }else{ header_sent("main.php"); } } else{ header_sent("main.php"); } include("footer.php"); ?>
-
$result = $config->query("SELECT * FROM pages"); for ($i = 0; $i < mysql_num_rows($result); $i = $i + 1) { $page = mysql_result($result, $i, "pages"); elseif($function == "$page") { include("functions/".$page.".php"); } }
i need it to add an elseif to the actual if equation.. so pretty much when they add a function it does it all for them..
-
lol delete this stupid mistake.. i forgot 1 number!
-
Maybe:
function function_userlevel($userlevel){ global $config; return $result = $config->query("SELECT * FROM userlevel where userlevel = '$userlevel'"); }
Then loop through the array.
how come dont user global? how else would i get data from my config file.. lol
-
Okay well i am going to do a function that looks in the database.. like so
function function_userlevel($userlevel){ global $config; $result = $config->query("SELECT * FROM userlevel where userlevel = '$userlevel'"); }
Now see how i did select * from userlevel.. Well the query will come up with with somewhere between 5-10 results..
so how do i do a return $results.. but i need all the results..
so when i use this function it will list all of them.
-
but i would have to do 2 distinctions no? 1 for username 1 for ip?
-
Okay well i am making logs. Where it log's the person's ip who logs in. Well everytime they click Main.php it log's their ip. so when you go to view the logs it shows alot of that 1 user with the same ip..
What i want it to do is when you view the logs i want it to check and see if the user has the same ip. if not it will show both ip's.
Like for example:
whitey (username)
127.126.0.0 (IP)
and it has multiple of those i just want it to display it once..
but if it has a different ip display both of those..
like for example:
whitey
127.126.0.0
127.121.1.0
if you could just help me start this i can finish it. Thanks
-
again this can be closed.. i kinda dumped the scripts lol
[SOLVED] blog
in PHP Coding Help
Posted
Okay well i am trying to make a "image" blog able to be viewed
here is my code
The output is just