premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
Ummm, overkill is nothing. I would code it in smarty since it is full supported and does not seem to be going obsolete, also it is meant to be used in other systems. The PHPBB does not care, it is only meant to be used with PHPBB. Another system, which is far outdated, is the ETS (Easy Template System). That may be more along your lines, but honestly Smarty is the way to go. Easy to implement with a ton of help from the smarty community and full documentation on usage.
-
trim $val = trim($val, "\n"); or str_replace $val = str_replace("\n", "", $val);
-
Smarty template system. Probably the best out there for PHP and is free, and easy to work with.
-
Yep. <?php if (isset($_POST['test1']) && $_POST['test1'] == "yes") { echo '<input type="text" name="text1" />'; }else { echo '<input type="text" name="text2" />'; } ?>
-
Search Engine Optimization. Makes your site rank higher on search engines such as google
-
Print out the entire post data to make sure that data is getting populated with print_r($_POST); Also post the full form if possible, that may give some insight to the problem.
-
Just an FYI, AND and OR work the same as && and || both are acceptable in PHP.
-
The number 1 method is not SEO friendly. Search: PHP htaccess SEO Friendly URLS You should find some good mod_rewrite examples of how to do what you want.
-
Seems pretty straight forward to me. Use a+ if the file may not exist to open the file to write/append to it. Use a if you know the file exists and want to append to it, use just regular a. Using w, places the file pointer (where you start writing to the file) at the begining and truncates (deletes) the rest of the file so it is fresh.
-
Please use the [ code] tags (without the initial space) to paste code in. <?php session_start(); if ($_SESSION['user_level'] == 0){ echo '<center><a href="">File Pirep</a><br><a href="">File LOA</a><br><a href="">Edit Profile</a><br><a href="">Roster</a></center>'; }elseif ($_SESSION['user_level'] == 2){ echo '<center>Staff Options</center>'; echo '<center><a href="">Waiting Approval</a><br><a href="">View Pireps</a><br><a href="">Active Pilots</a></center>'; } ?> What are you trying to get of the "AND" 2 ? What is 2 suppose to be checking against? The second if statement does not make any sense. I think what I posted above is what you are trying to do?
-
Are you posting or getting the data. Try $_REQUEST. Also the reason it is deleteing everything is due to the "w" portion, try using the "a" for append. Read up at fopen the different types of access and which allows you to do what.
-
imagecreate That function should allow you to do it. I have never used image manipulation so yea, read through the user comments or google for a tutorial and you should find one pretty easy.
-
<?php function ustrlen($s) { $a = preg_split("//u", $s); $i = -2; foreach ($a as $b) $i++; return $i; } ?> Found on the first user comment at strlen manual.
-
[SOLVED] No Double entry? Please help.
premiso replied to kendallkamikaze's topic in PHP Coding Help
Look on/near line 11 and solve it. That is a basic syntax issue and easy fix. The issue lies with the $result row there is no ending ; after the die statement. -
Your code is assuming that register_globals is on, this is a security flaw hence why the newer versions turn it off. Access index_info via $_POST['index_info'] instead.
-
Umm I used the MySQL error and looked at where it was throwing the error. It wasn't rocket science...at least I do not think it was.
-
'1, '1', '$r[url]', You are missing a closing single quote. '1', '1', '$r[url]', Exactly where SQL told you the error was.
-
Or if your host allows .htaccess put it in that instead.
-
foreach($_SESSION['submitted'][1]['code'] as $nkey => $nvalue) { $data[]['nkey'] = $nkey; $data[]['nvalue'] = $nvalue; } $cnt = count($data); for ($i=0; $i<$cnt; $i++) { print_r ($data[$i]['nkey'] . "\n"); print_r ($data[$i]['nvalue'] . "\n"); }
-
Shoutbox Problem - Difficulty with many comments
premiso replied to gaza165's topic in PHP Coding Help
Looking at the ajaxgetshoutbox code I would say that you should re-work the logic. Something about that just does not seem right. I would look at other shoutboxes and see what they do. Also I would put some sort of filter/session deal on the send_message.php page so that a user cannot repost until x seconds have passed. Given that I could easily create a bot to flood it or flood it myself. But yea. Sorry not to be more help, but I would take a look at other shoutbox scripts and see how they retrieve the other data. -
Shoutbox Problem - Difficulty with many comments
premiso replied to gaza165's topic in PHP Coding Help
Post the send_message.php also please. -
Shoutbox Problem - Difficulty with many comments
premiso replied to gaza165's topic in PHP Coding Help
You are sort of missing the point. You will not get this solved if you do not post the ajax section of your code. My bet is somewhere in that ajax page you have an error, with AJAX you will not see the or even with error reporting turned on due to the fact that the JS sends a new page request that has nothing to do with the current page you are using it on, other than the return data. -
For loop would be better for this situation. <?php $param=$_GET['param']; $options=array("values"=>array(0=>"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","num","all"), "text"=>array(0=>"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0-9","Show all")); $cnt = count($options["values"]); for ($i=0; $i<$cnt; $i++) { echo "Values: " . $options["values"][$i] . ", Text: " . $options["text"][$i] . "<br />"; } ?>
-
3rd parameter is set as an int 0 instead of a string of $file.
-
You could do a loop like so: <?php $bContinue = true; $sDate = strtodate("01/01/2008"); $eDate = strtodate("07/22/2008"); $i=0; while ($eDate > $sDate) { $sDate = $sDate + (60*60*24); // one date $i++; } echo $i . " days have passed."; There may be a better way, but that should work.