premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
well i tried both methods, it's still returning the value of 9, and the max value in the id column is actually 21, this is driving me insane lol Post your table data please.
-
Where is $uname defined? I do not see it anywhere? The basic gist of the copy error is that there is no file there. Try using the full path like this: if (!copy($_SERVER['DOCUMENT_ROOT'] . '/kunden/muster/index.php', $_SERVER['DOCUMENT_ROOT'] . '/' . $dir.'/index.php')) { echo ("failed to copy $file...<br>\n"); } That should put you in the right directory.
-
Yep, the as is a personal perference, I hate referencing items like MAX(col) etc, too much extra effort =)
-
<?php include("../l_i_f2.php"); $cxn = mysqli_connect($host, $user,$passwd,$dbname) or die ("Unable to establish a connection with the MySQL Server."); $query = 'SELECT MAX(id) as id FROM bleudeciel16_data'; $result = mysqli_query($cxn, $query) or die(mysqli_error($cxn)); while ($row = mysqli_fetch_assoc($result)) { echo $row['id']; } You need a while loop to go through each record. Also use the "AS" keyword to make the column name actually ID, the max would have thrown it off.
-
CSS fails on php page when $_GET data used in URL
premiso replied to fj1200's topic in PHP Coding Help
Chances are it is because you need the full path inside the href. IE: <link rel="stylesheet" href="http://yoursite.com/css/form.css" type="text/css"> -
$Body .= "<td width=\"200px\">Member Name</td><td width=\"400px\">" . $_POST['Member_Name'] . "</td>"; YOu either have to concat arrays or use { } around them inside quotes.
-
<?php $mysql_host="xxxxxxxxxxx"; $mysql_user="xxxxxx"; $mysql_password="xxxxx"; $mysql_db = "suecia"; $mysql_tables = "user"; $conn = mysql_connect("$mysql_host","$mysql_user","$mysql_password","$mysql_tables"); if (!$conn) { die('Could not connect: ' . mysql_error()); } mysql_select_db($mysql_db,$conn); $result = mysql_query("SELECT * FROM user"); while ($row = mysql_fetch_assoc($result)) { echo "User Tel: " . $row['tel'] . " User Code: " . $row['code'] . "<br />"; } ?>
-
CSS fails on php page when $_GET data used in URL
premiso replied to fj1200's topic in PHP Coding Help
Post some code? Is the CSS included as a <link tag or inside the <style> tags? -
What is the error you are getting? If you are not getting an error put these at the top of the script: error_reporting(E_ALL); ini_set("display_errors", 1); Report back the error if there is one.
-
You are not allowed to include URLs no matter what method you are using. By chance does your host Support CURL? (I doubt it but if it does you can use that instead)
-
[SOLVED] I want to be able to count an item once using COUNT(*)
premiso replied to jeger003's topic in PHP Coding Help
I am not sure but I know this is possible by using two queries. <?php $query = "SELECT DISTINCT VisIP FROM logs"; $res = mysql_query($query); while ($row = mysql_fetch_assoc($res)) { $query = "SELECT COUNT(VisIP) as IPcnt FROM logs WHERE VisIP = '" . $row['VisIP'] . "'"; $res2 = mysql_query($query); $row2 = mysql_fetch_assoc($res2); $ips[$row['VisIP']] = $row2['IPcnt']; } print_r($ips); ?> I am sure there is a way with SQL, but without a test database I won't be able to find it out. That should work. -
Look into the PHPMailer script. The mail function and smtp can do some funky things from what I remember when I tried using SMTP with it.
-
The images directory needs to be 777 I believe so you can write to it, you may also have to do this to the posters folder.
-
$count = $_POST['counter']; for($i=1; $i<=$count; $i++){ $score[$i] = $_POST['scoreSent' . $i]; $name[$i] = $_POST['nameSent'. $i]; } Try that.
-
You say hello, I say goodbye.
-
preg_replace() [function.preg-replace]: Empty regular expression
premiso replied to drisate's topic in PHP Coding Help
$match[1] will not be formatted as a regex, try this. $regex = '/(<img.*?src="(.*?)".*?>)/'; preg_match($regex,$sb_message_txt,$match); $picinfo = getimagesize($match[2]); $picinfo[0] = ($picinfo[0] > 430)? 430 : $picinfo[0]; $replacement = 'img src="'.$match[2].'" width="'.$picinfo[0].'" border="0" alt="" /'; $sb_message_txt = preg_replace($regex, $replacement, $sb_message_txt); -
<?php if (isset($_POST['submit'])) { $uploaddir = 'images/posters/'; $uploadfile = $uploaddir . basename($_FILES['userFile']['name']); echo '<pre>'; if (move_uploaded_file($_FILES['userFile']['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully uploaded.\n"; } else { echo "Possible file upload attack!\n"; } echo 'Here is some more debugging info:'; print_r($_FILES); } ?> And add enctype="multipart/form-data" inside of your <form tag.
-
Ummm, try printing the fields to the page and see if they all print. POST should handle everything just fine as long as the text totals under 2MBs. Chances are it is something in the email that cuts it off. But I would test it by printing the variables to the screen to make sure.
-
Umm no. Exec allows you to run programs through PHP via the shell (windows or linux) it should be installed with PHP by default. Read up on it, it would do exactly what you want, you just have to define exactly where the ffmpeg file is located and use the commandline version to run it. The only thing that could be problemmatic is the script will probably timeout, not sure if this would be a problem or not, but yea.
-
Desc is a reserved word. Encapsulate it in backticks(`) or better yet change that column name. if ($_POST['Submit']=='Update') { $profile = $_POST['Desc']; mysql_query("UPDATE users SET `Desc`='".$Desc."' WHERE id=".$_SESSION['user_id']."") or die(mysql_error()); header("Location: myaccount.php?msg=Profile Description Updated!"); }
-
exec That would be how if you can, and doubtful for the psp but the xampp should work.
-
Checking the $_POST variables in the script receiving it and checking against what should/should not be allowed.
-
What exactly do you want here? Do you have some code? I am confused, you are not asking a question you are simply stating a statement.
-
What exactly is your goal here? You are counting the number of columns in the array. Your table seems to have 6 columns. $playerid = 0; while ($RBsArray = mysql_fetch_array($RBs_set)) { $playerid++; echo "\n<option class='' value='{$playerid}'>" . $RBsArray[0] . "</option>"; } Unsure if that is exactly what you want, but yea. If that is not it post what you want the end select to look like and the table structure/example data of data in your database.