![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
phpretard
-
Posts
821 -
Joined
-
Last visited
Never
Posts posted by phpretard
-
-
After reading the manual (as per the Terms of this site)
$var="http://www.google.com/search?hl=en&rls=com.microsoft:*&pwst=1&q=tallahassee+web+designer&start=10&sa=N"; $me=substr_replace($var, 'everything between Q and the &'); is the idea. echo $me; I would like $me to =tallahassee+web+designer;
-
This is what $_SERVER['HTTP_REFERER'] gets when some searches "tallahassee+web+designer" on google and clicks on my site.
I am putting that info into a database.
When I pull that info from the database how can I echo the "q=tallahassee+web+designer" only?
-
So basically do the same thing without the "INSERT INTO" statement repeated?
-
Another FTP attack - your computer is compromised by a malware, your FTP password stolen, and this backdoor uploaded to the server. Check your computer.
-
I am trying to add 5 rows to a table with one if statement.
The only variable that is different:
$Pname
I know the code below will work...but is there a way to do this without 5 querys? (NO ARRAYS PLEASE)
if ($Pname=='5_Item_Package'){ mysql_query("INSERT INTO projects (id, Cnumber, Pname, date, approved, status, qty, cost, included, description, hourly, locked ) VALUES ('', '$Cnumber', 'DIFFERENT NAME 1', '$today', '$approved', '$status', '$qty', '$cost', '$included', '$description', '$hr', '$locked' )"); mysql_query("INSERT INTO projects (id, Cnumber, Pname, date, approved, status, qty, cost, included, description, hourly, locked ) VALUES ('', '$Cnumber', 'DIFFERENT NAME 2', '$today', '$approved', '$status', '$qty', '$cost', '$included', '$description', '$hr', '$locked' )"); mysql_query("INSERT INTO projects (id, Cnumber, Pname, date, approved, status, qty, cost, included, description, hourly, locked ) VALUES ('', '$Cnumber', 'DIFFERENT NAME 3', '$today', '$approved', '$status', '$qty', '$cost', '$included', '$description', '$hr', '$locked' )"); mysql_query("INSERT INTO projects (id, Cnumber, Pname, date, approved, status, qty, cost, included, description, hourly, locked ) VALUES ('', '$Cnumber', 'DIFFERENT NAME 4', '$today', '$approved', '$status', '$qty', '$cost', '$included', '$description', '$hr', '$locked' )"); mysql_query("INSERT INTO projects (id, Cnumber, Pname, date, approved, status, qty, cost, included, description, hourly, locked ) VALUES ('', '$Cnumber', 'DIFFERENT NAME 5', '$today', '$approved', '$status', '$qty', '$cost', '$included', '$description', '$hr', '$locked' )"); } else {Just one query}
-
Oh... I get it Ken - the number is some weird form of the date.
-
http://www.w3schools.com/php/func_date_time.asp <-- is where I got it from
It certainly puts out "Monday, May 19, 2008 1211258618" exactly.
Let me rephrase the question...
I want to echo The date and time. What is the best way to do such?
-
So if you take away the register button you can log in?
-
I just found this little article you might want to read.
-
The Code Below Printed this:
Monday, May 19, 2008 1211258618
I think >>>1211258618<<< that is supposed to be the time.
So what is the time or how the heck do you translate that into human time?
$t=time(); echo($t . "<br />"); echo(date("D F d Y",$t));
-
Thank you for being patient with me. I should have mentioned I would like the total from all the rows outside of the loop.
-
On that note ... I may be approaching this wrong...
I am looking to add all the $cost together.
$result = mysql_query("SELECT * FROM table "); while($row = mysql_fetch_array($result)) { $cost=$row['cost']; }
$cost has as many values that are in the DB. I just want to take the total of all the rows and echo it out.
-
I am trying to form an array from thre value of $cost.
$result = mysql_query("SELECT * FROM table "); while($row = mysql_fetch_array($result)) { $cost=$row['cost']; }
$a=array(SOMTHING HERE);
any thoughts?
-
I don't know if this helps my question become any more clear but this gives me the desired result.
The Query is different each time. I am sure there is an easier way...but I don't know what it is.
$result = mysql_query("SELECT * FROM projects WHERE Cnumber='$Cnumber' AND revise !='' AND approved ='' ORDER by Pname"); while($row = mysql_fetch_array($result)) { $id=$row['id']; $Pname=$row['Pname']; $pic=$row['pic']; $Cnumber=$row['Cnumber']; $approved=$row['approved']; $revise=$row['revise']; $details=$row['details']; $qty=$row['qty']; $status="| Revision Requested"; include 'pages/secure/pages/projects/revise.php'; } $result = mysql_query("SELECT * FROM projects WHERE Cnumber='$Cnumber' AND revise ='' AND approved ='' ORDER by Pname"); while($row = mysql_fetch_array($result)) { $id=$row['id']; $Pname=$row['Pname']; $pic=$row['pic']; $Cnumber=$row['Cnumber']; $approved=$row['approved']; $revise=$row['revise']; $details=$row['details']; $qty=$row['qty']; $status="| Pending Review"; include 'pages/secure/pages/projects/pending.php'; } $result = mysql_query("SELECT * FROM projects WHERE Cnumber='$Cnumber' AND approved !='' ORDER by Pname"); while($row = mysql_fetch_array($result)) { $id=$row['id']; $Pname=$row['Pname']; $pic=$row['pic']; $Cnumber=$row['Cnumber']; $approved=$row['approved']; $revise=$row['revise']; $details=$row['details']; $qty=$row['qty']; $status="| Order Completed"; include 'pages/secure/pages/projects/approved.php'; }
PS Thank you for the operator note
-
Bad Question?
-
No matter how many $results there are it will only display include one page.
Do I need a foreach or something?
I think I realize that when the first if statement is met the while loop stops, but I don't know any solution.
$result = mysql_query("SELECT * FROM projects WHERE Cnumber='$Cnumber' ORDER by Pname"); while($row = mysql_fetch_array($result)) { $id=$row['id']; $Pname=$row['Pname']; $pic=$row['pic']; $Cnumber=$row['Cnumber']; $approved=$row['approved']; $revise=$row['revise']; if (($approved!=='')&&($revise=='')){include 'approved.php';} if (($approved=='')&&($revise!=='')){include 'revise.php';} if (($approved=='')&&($revise=='')){include 'pending.php';} }
There is one entry that mathes each if statement right now but only one will display.
-
I have read the manual and it gives way to much information. If there is no simple trim feature I'll keep reading. Just let me know either way.
Thank Errbody!
-
I don't understand?
-
I have read the manual and it give way more than I need.
$var="Hello World";
Browser Says Hello%20World
I need "HelloWorld" (NO SPACE)
Please Help
-
I am trying to add a folder named "TEST" to a folder in my site located here:
www.website.com/pages/secure/proofs
Where in this line of code does TEST go?
<? mkdir("/pages/secure/proofs/" , 0700); ?>
I keep getting errors no matter where i put TEST.
-
Thank you!
-
I have read the manual and none of the examples or numbers usa a Zero as a one hundreth.
$Example="1.50549976546"
round($Example, 2) returns 1.5 (notice the Zero missing)
I need the zero to show up.
Can you help?
-
do you mean number_format($var, 2)
as opposed to
round($var, 2) ?
-
<head>
<meta http-equiv="Page-Enter" content="blendTrans(Duration=.1)">
</head>
The .1 in (Duration=.1) control the fade time.
$_GET['Google']
in PHP Coding Help
Posted
Why would that work great for:
http://www.google.com/search?hl=en&rls=com.microsoft:*&pwst=1&q=tallahassee+web+designer&start=10&sa=N
But it doesn't work for this one:
http://www.google.com/search?q=Tallahassee+Websites&rls=com.microsoft:*&ie=UTF-8&oe=UTF-8&startIndex=&startPage=1