Fadion
-
Posts
1,710 -
Joined
-
Last visited
Posts posted by Fadion
-
-
session_start() must be called before anything is outputed to the browser. Theorically this is a practice used in cookie-base sessions, but its better to have session_start() in the first line of your script.
-
U can use sessions. After u make the validation and move_uploaded_file() assign the filename to a session.
-
Flag: Albanian
Current Country: Albania
Nice job.
-
U can get the IP without any problems but what do u need for? If u have logged users then u just need that column in the db and a simple time compare.
-
Yep cookies may be disabled, one user may access the script in a different pc or one can just delete them.
Edit: Thnx dbo
-
When the user posts the flight, u can insert in a specific column (maybe in the users table in a column like lastPost) the actual date and time. When he tries to post another flight, compare the database time with the actual date and time and if it is more then one hour let him post. When he posts again, override the old date so the process starts all over.
-
Hmm u need to know some stuff dude, as passing variables between pages with post, get or sessions and use the mail() function of php. Id suggest u to learn the basics and in just a few days we'll be able to start thinking of a logic for what u want.
-
You want to put those values in different rows or altogather in the same row, maybe seperated by commas?
-
the server is denying u to upload files as probably those directories dont have write permissions. Try to CHMOD 777 or 664 those directories. Hope it helped.
-
the key to mutiple selects is to assign it an array name, so php interprets it as an array.
<select name="time[]" size="4" multiple="multiple">
to use those values use this simple code
$arr = $_POST['time']; foreach($arr as $time){ echo $time . "<br />"; }
-
And to correct the title, Zend Engine is the scripting engine that powers php 4 (ZE II in php5), while Zend Studio is the scripting environment
-
As noone has replied to this, im gonna give my 2 cents. Ive been using dreamweaver for ages making html/css sites and from some time also for php. In my opinion it is the best all around editor and especially for html. As far as php is concerned it isnt offering too much, just site managment, code coloring and some pretty basic code hinting. With some extensions one can make it a bit more advance but still it remains mediocre. While Zend Studio (ive used it just a couple of times) has some exeptional code hinting and coloring, real time code highlighting and very powerful debugger. The debug thing is pretty good because with dreamweaver u have to rely only on php error display which makes debugging complex scripts a pain in the a**. For long and complex scripts id suggest using zend studio, otherwise id stick to dreamweaver as it offers a very flexible environment allowing to easily insert html and css.
-
Ok i just made a test and u can use count($_POST) to count the number of inputs u have, assuming u have only the input texts passed to post. So:
$nrPpl = count($_POST);
Also u may have a submit button which is also passed to post, so u can check:
if(array_key_exists('submit', $_POST)){ $nrPpl = count($_POST) - 1; } else{ $nrPpl = count($_POST); }
-
Dont know if i got it completely right but anyway. U can create a hidden input where u pass the number of people the user entered (or just use get for that). When u recieve them make a loop to get the data from post ex:
$nrPpl = $_POST['nrpeople']; for($i=1; $i<=$nrPpl, $i++){ echo $_POST['input$i']; }
I assumed u named the input boxes as input1, input2 etc. Hope it helped.
-
man it is a 230 lines script. Only copying and pasting it to dreamweaver to see the lines number took me 1 minute lol. Guess u have to write the part of the code u think causes the problem, so someone can debug it easily.
-
lol almightyegg. Guess that for your needs number_format() will work ok, but printf() is way more powerful. And yep 2 defines how many decimal space. If your number is ex. 23.456, using 2 as number of decimal spaces, it will print 23.457, rounding the last decimal digit.
-
Try:
$nr = 1758.23; echo number_format($nr, 2, '.', ','); //it will output exactly 1,758.23
2 is for the number of decimals, '.' is for decimal separator and ',' is for thousands separetor.
-
as dbo said, for secure communication u need to use <a href="http://en.wikipedia.org/wiki/Transport_Layer_Security">SSL</a>. It is widely used in systems with transections and stuff to pass secure information. In your case i dont think u can go as far on using SSL with just a login system. Just be sure to validate the input and clean your data to prevent malicious attacks and u'll be a lot safe.
-
$new_pentotal = $result_getplayer_pens + $ahpm;
that line returns u nothing, as $result_getplayer_pens is just the mysql_query. To retrieve the data u must use mysq_fetch_array within a loop. Smth like:
while($values_player_pens = mysql_fetch_array($result_getplayer_pens)){ $new_pentotal = $values_player_pens['columnValue'] + $ahpm; //update query and stuff }
-
Id suggest using a target _blank in your link, as popups are annoying and at most cases blocked by anti popup software. Anyway the idea in your script is to open a new file, ex profile.php and pass a url variable that may be the id of the user. Im writing the sample without the popup call, but it would give u and idea:
echo "<a href='profile.php?id={$qry['id']}'>{$qry['name']}</a>"
U can have a profile.php with a standart template for the user (ex. full name, email, phone, description) and fill those values by getting the id of the selected users from the url variable using $_GET.
-
If it was an extension then u'd have to compile it with php, but fortunately it is a class so u dont have to worry about the host. To use use it just upload it and include it in your page (from the examples in their website u have to include 'class.phpmailer.php'). About guides and tutorials, the documentation at
http://phpmailer.sourceforge.net/docs/
and their usage example
http://phpmailer.sourceforge.net/extending.html
should have u started.
-
Barand posted a nice and simple approach, but as we're in strings manipulation:
For counting all the characters in a text:
$text = 'This is just some short text'; echo count(explode(' ', $text)); //it will print => 6
For printing how many times each character is used in a text:
$text = 'This is just some other short text'; foreach(count_chars($text, 1) as $key=>$val){ echo "Character: " . chr($key) . " is used $val times<br />"; }
-
u can generate meta tags with php just as any other html tag. Write the $pageid = $_GET['pid'] before the meta tags and write them as:
<meta name="keywords" content="<?php echo $pageid; ?>" />
The same involves for description and title.
-
Guess u should ask this question to the drupal community forums or smth. Anyway, what do u mean 'to display it when enabled'? The if statement u wrote cant make it as ure checking '$block' without initializing it with 'module_invoke'.
conditional form submission
in PHP Coding Help
Posted
As previosly said ull need client side validation, which needs some basic knowledge of javascript. U may consider server side validation which will need the form to submit, but this may not be your case.