Search found 176 matches
- Tue Jun 15, 2010 7:24 am
- Forum: PHP - Code
- Topic: Am I using mysql_fetch_assoc and mysql_fetch_array the corre
- Replies: 1
- Views: 96
Am I using mysql_fetch_assoc and mysql_fetch_array the corre
When I usually call something from a database, I am either dealing with one record exclusivity or a whole bunch of record. I always use mysql_fetch_assoc when dealing with single record returns e.g. username-password authentication but if i want to display who is online for example, I just run a whi...
- Fri Jan 29, 2010 5:45 pm
- Forum: PHP - Code
- Topic: PHP Page Redirection
- Replies: 3
- Views: 210
Re: PHP Page Redirection
Code: Select all
<?php
$p = $_GET['p'];
if ($p == 123){
header('Location: http://www.google.com');
}
else if ($p == 456){
header('Location: http://www.yahoo.com');
}
?>- Sun Jan 24, 2010 6:37 pm
- Forum: PHP - Code
- Topic: can only pass one paramater to mail headers
- Replies: 2
- Views: 80
- Sun Jan 24, 2010 2:38 pm
- Forum: PHP - Code
- Topic: can only pass one paramater to mail headers
- Replies: 2
- Views: 80
can only pass one paramater to mail headers
My PHP file attachments kept coming back as base64, then I found out that only 1 header was getting passed into it instead of the two I had defined (from header followed by content-type). first I had this: $header = "From: XYZ <xyz@wxyz.com>\r\n"; $header .= "Content-Type: multipart/m...
- Mon Oct 05, 2009 5:17 pm
- Forum: PHP - Code
- Topic: encoding problems
- Replies: 2
- Views: 153
Re: encoding problems
we need to see the code bro.
- Sun Sep 27, 2009 5:30 pm
- Forum: PHP - Code
- Topic: Help me building a simple php code !!
- Replies: 3
- Views: 126
Re: Help me building a simple php code !!
use $_SERVER['HTTP_REFERER'] on site b:
Code: Select all
<?php
if ($_SERVER['HTTP_REFERER'] == "sitea"){
// actions to be executed when users access site b from site a
}
?>- Fri Sep 25, 2009 2:29 pm
- Forum: PHP - Code
- Topic: apply $variable to existing textarea without reload
- Replies: 4
- Views: 199
Re: apply $variable to existing textarea without reload
it does not matter where the html code is and where the php code is (unless you are echoing stuff). i suggest to you that yo initiate $desc before the textarea is created and then you assign it that value. and yes you can add the value on a while loop but the textarea needs to be created in the whil...
- Fri Sep 25, 2009 10:46 am
- Forum: PHP - Code
- Topic: apply $variable to existing textarea without reload
- Replies: 4
- Views: 199
Re: apply $variable to existing textarea without reload
well how about that you actually do that without JS.
the textarea is obviously the one you want for the text to appear in.
Code: Select all
<textarea name="desc" rows="2" cols="20"><?php echo htmlentities($desc); ?></textarea>- Mon Sep 14, 2009 10:52 am
- Forum: PHP - Code
- Topic: Adding +1 to value from database
- Replies: 6
- Views: 513
Re: Adding +1 to value from database
Code: Select all
<?php
$query = mysql_query("SELECT MAX(id) FROM users AS max_id");
$max_id = mysql_fetch_assoc($query);
mysql_query("UPDATE users SET id = id+1 WHERE id = ".$max_id['max_id']);
?>- Fri Sep 11, 2009 3:50 am
- Forum: PHP - Code
- Topic: Unexpected timeout
- Replies: 2
- Views: 116
Re: Unexpected timeout
this is the worst way to logout users automatically. what you need to do is set a timestamp on a db column and every time a user makes an action the requires authorisation, you update that field and simultaneous you check that timestamp against current time and if its been too long, then you log the...
- Wed Sep 09, 2009 8:46 am
- Forum: PHP - Code
- Topic: how to send request to an ip address - urgent
- Replies: 3
- Views: 310
Re: how to send request to an ip address - urgent
well depends if you want to use server side or client side
- Wed Sep 09, 2009 6:07 am
- Forum: PHP - Code
- Topic: header("Location:") not working on Windows server? Help!
- Replies: 3
- Views: 438
- Wed Sep 09, 2009 4:38 am
- Forum: PHP - Code
- Topic: header("Location:") not working on Windows server? Help!
- Replies: 3
- Views: 438
Re: header("Location:") not working on Windows server? Help!
remove the status header and use absolute paths and it will work.
- Sun Sep 06, 2009 1:23 pm
- Forum: PHP - Code
- Topic: passing variable from php into flash, help please
- Replies: 15
- Views: 774
Re: passing variable from php into flash, help please
if that is the case then just use the dummy variable like you suggested.
- Sun Sep 06, 2009 12:08 pm
- Forum: PHP - Code
- Topic: passing variable from php into flash, help please
- Replies: 15
- Views: 774
Re: passing variable from php into flash, help please
ok try this now: rename test.php to another name and then change the variables inside or add your own using the array.
then update the AS code to match the new name of test.php and try to trace the new vars you added. let me know if this solves it.
then update the AS code to match the new name of test.php and try to trace the new vars you added. let me know if this solves it.