Forum: PHP Nov 12th, 2009 |
| Replies: 6 Views: 436 You can't use a switch statement like the way you are attempting. Try changing those switch statements to if-else statements and you should be fine. |
Forum: PHP Nov 11th, 2009 |
| Replies: 3 Views: 260 The line:
new Cite;
means that there needs to be a class called Cite, not a file called Cite.php. Even if there was a Cite class, the code in the wfCite function wouldn't need that line as it... |
Forum: PHP Oct 24th, 2009 |
| Replies: 2 Views: 192 Try adding the following line to your script, anywhere after the line $dir = $documentroot . '/' . $username; but not inside the function:
rmdir_r($dir);
Basically, the code inside the function... |
Forum: PHP Oct 15th, 2009 |
| Replies: 6 Views: 870 Hi catcoffee and welcome to DaniWeb :)
1) Can be achieved with a <input type='file'> in a PHP/HTML form. PHP then uses an array, $_POST, to retrieve all posted data and the $_FILE array to access... |
Forum: PHP Oct 11th, 2009 |
| Replies: 4 Views: 534 Ok, so are you saying that your font doesn't work when you try to display text with PHP via an echo or print? How are you setting the font without using HTML or CSS? |
Forum: PHP Oct 10th, 2009 |
| Replies: 4 Views: 534 |
Forum: PHP Sep 18th, 2009 |
| Replies: 8 Views: 350 Yes that's right. This might help:
$results = mysql_query("SELECT a.column1, a.column2, a.column3 FROM table1 as a");
while(($nextRow = mysql_fetch_assoc($results)) !== false)
{
... |
Forum: PHP Sep 17th, 2009 |
| Replies: 8 Views: 350 $results is a resource that can be used to grab an array using any of the mysql_fetch functions:
while(($nextRow = mysql_fetch_assoc($results)) !== false)
{
$column1 = $nextRow["column1"];
... |
Forum: PHP Sep 9th, 2009 |
| Replies: 4 Views: 556 Hi andym67 and welcome to DaniWeb :)
A better approach is this:
if(isset($_SESSION["namevalue"]))
$val = $_SESSION["namevalue"];
else
$val = "";
// maybe do some validation on $val... |
Forum: PHP Sep 9th, 2009 |
| Replies: 4 Views: 221 Ah ok, so are all of your fields of type VARCHAR? Might be worthwhile changing to NUMERICs if you are going to be joining tables a bit, that is if that doesn't mess everything else up! |
Forum: PHP Sep 9th, 2009 |
| Replies: 4 Views: 221 Are you sure that your $_SESSION['SESS_ORDERNUM'] is set correctly? Try echo'ing your sql statement before you send it to mysql_query and see... |
Forum: PHP Sep 8th, 2009 |
| Replies: 1 Views: 333 So is $title the title of a single RSS feed item? If so, you can do something like:
$count = 0;
foreach($rssFeedItems as $title)
{
if(empty($title))
echo ++$count; // a prepend... |
Forum: PHP Sep 5th, 2009 |
| Replies: 2 Views: 278 Hi Mujahid158 and welcome to DaniWeb
The mysql_query function returns a result set resource for select queries. You can't access it in the way that you are attempting, you need to specify the... |
Forum: PHP Sep 3rd, 2009 |
| Replies: 3 Views: 383 There are a few ways you can do this, but the simplest is probably to pass the variable via GET. To do this add the following line of code after you set $errorpas:
header("Location:... |
Forum: PHP Aug 20th, 2009 |
| Replies: 3 Views: 279 I would have a single table, called user_pref, which would have the columns user_id, product_type_id, both of which would form the primary key for the table. If the user selects pets as a preferred... |
Forum: PHP Aug 6th, 2009 |
| Replies: 4 Views: 414 $send="INSERT INTO mailbox SET
member_id='$memid',
user_name='$$_SESSION[user_name]',
user_id='$_SESSION[user_id]',
message='$message',
inbox='NEW',
subject='$subject',
... |
Forum: PHP Aug 3rd, 2009 |
| Replies: 2 Views: 231 Basically the way that it works is everything after the ? is a set of key-value pairs. So, if you need to find $_REQUEST["msg"] you need the URL to read http://xxxxx.php?msg=zzz
Hope this helps,... |
Forum: PHP Jul 23rd, 2009 |
| Replies: 2 Views: 226 if(51 < $bal && $bal < 75)
This statement reads "if $bal is GREATER THAN 51 and LESS THAN 75". If you have $bal EQUAL to 51 it is not GREATER THAN 51. (Sorry for the shouting, but it is necessary... |
Forum: PHP Jul 15th, 2009 |
| Replies: 2 Views: 376 You are overwriting your $sql variable with the second statement. Try running the first SQL statement before you set the $sql variable, or you could change your second statement to use a new... |
Forum: PHP Jun 19th, 2009 |
| Replies: 2 Views: 662 There are two functions that you might find useful, in_array and array_search. Here is an example of their usage:
$employee = array();
$employee [] = array("name" =>"Chris Apple", "company" =>... |
Forum: PHP Jun 1st, 2009 |
| Replies: 4 Views: 546 You can use a combination of the substr (http://au2.php.net/manual/en/function.substr.php) and strpos (http://au2.php.net/manual/en/function.strpos.php) functions to achieve this. |
Forum: PHP May 26th, 2009 |
| Replies: 6 Views: 4,099 Hi nish123,
You will need to use two function calls for this, strtotime and date. First you use strtotime to convert your string to a unix timestamp, like so:
$time = strtotime( $date );
... |
Forum: PHP Apr 21st, 2009 |
| Replies: 11 Views: 600 If autoid is a numeric field, you don't need the ' marks around it in the SQL statement. If you remove them, the $id should be resolved. |
Forum: PHP Apr 21st, 2009 |
| Replies: 11 Views: 600 Also, you will need to check that each field has been set. Use the isset method on each of your $_POST retrievals, like so:
if( isset( $_POST[ 'title' ]))
$titel = $_POST[ 'title' ];
Then... |
Forum: PHP Apr 21st, 2009 |
| Replies: 11 Views: 600 Try echo'ing your update sql statement before you run the query. This way you can check the sql that is being run for the correct variables. Another good hint for debugging is to copy and paste that... |
Forum: PHP Apr 21st, 2009 |
| Replies: 11 Views: 600 Should it update the TITLE if you change the YEAR? |
Forum: PHP Apr 21st, 2009 |
| Replies: 11 Views: 600 <input type="hidden" value="$autoid">
The error is in this line, you have forgotten to name this field, so it can't find it in the $_POST array. Try changing to this:
<input type="hidden"... |
Forum: PHP Apr 10th, 2009 |
| Replies: 35 Views: 1,223 BzzBee there is an error in your sql.
SELECT username FROM id_users WHERE username='$username' and username='$refer_id'
username can only equal both $username and $refer_id if $username =... |
Forum: PHP Apr 10th, 2009 |
| Replies: 35 Views: 1,223 Well your error seems to be that you declare a variable called $end somewhere in that file in an unexpected place. I notice that you include a file called signup.php, but the error is in the file... |
Forum: PHP Apr 10th, 2009 |
| Replies: 35 Views: 1,223 Can you re-post say lines 120 - 137 of the file sign_up.php for us to look at please? |
Forum: PHP Apr 3rd, 2009 |
| Replies: 5 Views: 401 Without access to the website's database I'm thinking this would be very difficult to do. What you are essentially talking about may have legal ramifications also. |
Forum: PHP Mar 25th, 2009 |
| Replies: 38 Views: 1,734 It needs to match the column name for the ID of the comment being replied to. |
Forum: PHP Mar 24th, 2009 |
| Replies: 38 Views: 1,734 echo "<form method=\"post\" action=\"./index.php?act=test&id=".$row['id']."&reply_id=".$row['id']."\">\n";
I believe your problem lies here. You are in effect setting $_GET['reply_id'] to... |
Forum: PHP Mar 24th, 2009 |
| Replies: 38 Views: 1,734 Hard to say what is happening in the mss function without seeing the code, however I notice that you use the mss function twice with different parameters:
$msg = mss($_POST['reply']);
$tid =... |
Forum: PHP Mar 24th, 2009 |
| Replies: 38 Views: 1,734 Does mss give you the right id according to the data that you have in the database? That is, is it the mss function or the data in the database that is wrong? |
Forum: PHP Mar 23rd, 2009 |
| Replies: 38 Views: 1,734 I don't think it is returning the right value here. Try echoing $tid just before you run your sql, or better yet, echo the sql to the screen and check that it has the right variables. |
Forum: PHP Mar 23rd, 2009 |
| Replies: 38 Views: 1,734 What does the mss function do? I think that it is returning nothing whereas it should return the id of the topic... |
Forum: PHP Mar 23rd, 2009 |
| Replies: 38 Views: 1,734 Sorry I haven't seen a query is empty error before - maybe start a new thread to ask someone else?
The $reply_id is just the ID of the message being replied to. I thought you said before that you... |
Forum: PHP Mar 23rd, 2009 |
| Replies: 38 Views: 1,734 $sql4 = "INSERT INTO forum_replies (tid,uid,message,date,time,reply_id,pid) VALUES($tid,$_SESSION['uid'],'".$msg."','".$date."','".$time."',$reply_id,$pid)";
You need to work out how to find... |
Forum: PHP Mar 23rd, 2009 |
| Replies: 3 Views: 648 I assume you want $nowdate to be a string. String concatenation in PHP uses a period character to join strings. This **should** work:
$nowdate = date('Y') . "-" . (date('Y') + 1); |