Resently i have made a website and forum in ASP but my old website and forum in PHP. now I am wondering if there was a way to move the thread data from the old php to the new ASP?


I have a script that organized data entries by the date submitted through the crtime function. How do I display the crtime. What would be the php code to display the date that the item was created ?
crtime is not a built in php function.
try just echo / vardump crtime and show what the value is.
that sounds like it could be a custom function with the script and not a regular PHP function. you should dig through the code and find other examples of how they used crtime.
I noticed that it uses the .time(). to store the date added and when stored in the database it looks like this: 1164408499
how would i make that a date like: 11/11/2006 ? or whatever date that may be.
if u use a timestamp is stored in $row[‘crtime’], then it would be:
Code:
$dateadded = date("m/d/Y",$row['crtime']);
I’m trying to write a simple login script but I’m getting the resource id #3 error.
code is
Code:
<?php
$host="localhost";
$user="root";
$password="";
$db="admin";
$tableadmin="admin1";
$adminuser= $_POST["adminuser"];
$adminpass= $_POST["adminpass"];
$link = mysql_connect($host,$user,$password)
or die ("couldn't connect to server");
$db = mysql_select_db($db,$link)
or die ("Couldn't select database");
$result = "SELECT * FROM admin1 WHERE adminuser='$adminuser' AND adminpass='$adminpass'";
$query = mysql_query($result)
or die ("Couldn't execute query.");
echo "<br><br>$query<br><br>";
//heres the problem
if (mysql_num_rows($result) > 0)
{
$_SESSION["authenticatedUser"]= $adminuser;
header("Location: loggedon.php");
}
else
{
$_SESSION["message"]="could not connect to database as $adminuser";
header("Location: loginform.php");
}
?>
Hope someone can help
why wouldnt the SQL statement be called $query and
the mysql_query be stored as the result?
try this
$query = "SELECT COUNT(*) as cnt FROM admin1 WHERE adminuser='$adminuser' AND adminpass='$adminpass'";
$result = mysql_query($query) or die ("Couldn't execute query.");
$row = mysql_fetch_array($result);
if ($row['cnt'] > 0)
{
$_SESSION["authenticatedUser"]= $adminuser;
header("Location: loggedon.php");
}
thanks for your help but Still not working
putt @ before mysql_query like this
Code:
$result = @mysql_query($query) or die ("Couldn't execute query.");
still have a problem
I think u Check your HTML for blank lines
Hello,
I have a form where people can upload images. The problem is that if an animated gif is uploaded via the form and displayed on a page later on, the gif is not animated anymore.
Is there a special procedure to handle animated gifs with php ?
Thanks in advance.
From which u are uploading via http or ftp?
download the phpThumb script, run it. If it works, check out the coding and see what it does that you are not doing.
uploading via http
there are many pre-made script, which can fulfill your requirement.
For doing formatting with the printf(), there is need to wrap output in <pre> tags. Is this the best way of showing formatted plain text on a browser?
Header (“Content-Type: Text/Plain”);
If I do a header(“Location: http://xyz.com”) does that get sent to the browser immediately? In other words, can I then do other stuff after the header command without worrying about delaying the redirect to the browser?
use htaccess to redirect
You have to do what you have to do before the header Location thing or, you can use meta refresh with a small delay.
I wants to redirect and some code executed. How do you do that with .htaccess?
htaccess is not always the best choice. In forums like phpBB the header function is used because they first need to check if for example a user is logged in or not. Then it’s so much easier to use the header function.
code 2 be executed…..
header(“Location: somepage.php”);
exit
How can I send that variable from one file to the other?I have a variable called $url that is defined in the first file. now i want to use that variable in the second file.
Any advice
you could save the variables as Session variables
You could put your variables in vars.php, and then
include(“vars.php”);
At the top of every page you want the variables in.
Can somebody help me where can I find the php codes for adding links or any text to my favorite list?
try this, it will surely help u
<script type="text/javascript">
function favit(heading,address){
if(window.external)window.external.AddFavorite(address,heading);
else if(window.sidebar)window.sidebar.addPanel(heading,address,"");
}
</script>
<a href="javascript:favit(document.title,location.href)">Add to favorites</a>
I m looking for a good php class to resize images? I only need to resize JPG
use ImageMagic
Can anyone recommend me a good free script for uploading the image.
You can make an image uploader easily with PHP. You can do:-
– Browse and upload
– Create thumbs
– Let user view their images
You must be logged in to post a comment.