Search found 94 matches

by kyle04
Thu Oct 04, 2012 2:24 am
Forum: PHP coding => General
Topic: ECHO $_GET INTO INPUT FIELD
Replies: 3
Views: 1121

Re: ECHO $_GET INTO INPUT FIELD

Code: Select all

<?php
$id = $_GET['sessionid'];
?>
<input name="WID" type="text" id="WID" value="<?php echo $id; ?>" />
This will only work if the sessionid variable has been passed via a url parameter.
To get the current php session id :

$sessionid = session_id();
by kyle04
Thu Oct 04, 2012 2:19 am
Forum: PHP coding => General
Topic: getcwd
Replies: 2
Views: 749

Re: getcwd

Code: Select all


$cwd = getcwd();
by kyle04
Wed Oct 03, 2012 3:12 pm
Forum: PHP coding => General
Topic: preg_match question
Replies: 1
Views: 819

Re: preg_match question

Code: Select all

if(
  preg_match('/[^a-zA-Z]/', stripslashes(trim($_POST['city'])))
){
// nasty characters
}  
by kyle04
Wed Oct 03, 2012 3:03 pm
Forum: PHP coding => General
Topic: Why doesn't this work? (Javascript&PHP)
Replies: 0
Views: 582

Re: Why doesn't this work? (Javascript&PHP)

The javascript part is looping only, not the php generated number. You can do this with javascript only : <script language="javascript" type="text/javascript"> function randomString() { var chars = "0123456789"; // numbers only var string_length = 8; // number string length var randomstring = ''; fo...
by kyle04
Mon Oct 01, 2012 1:30 pm
Forum: PHP coding => General
Topic: error
Replies: 0
Views: 523

Re: error

The error messages are reasonably clear - you do not have access to the directory file paths.

Check server settings or file permissions.
by kyle04
Mon Oct 01, 2012 1:21 pm
Forum: PHP coding => General
Topic: get user time & date
Replies: 1
Views: 647

Re: get user time & date

You may need to use an ajax type function.
see :
http://www.w3schools.com/php/php_ajax_database.asp
by kyle04
Mon Oct 01, 2012 1:43 am
Forum: PHP coding => General
Topic: $result = mysql_query($query); 2nd parameter?
Replies: 2
Views: 1790

Re: $result = mysql_query($query); 2nd parameter?

Try :

Code: Select all

   
   $result = mysql_query("SELECT * FROM people");
by kyle04
Sat Sep 29, 2012 3:40 pm
Forum: PHP coding => General
Topic: Included form errors when re-submitted on the results page
Replies: 1
Views: 874

Re: Included form errors when re-submitted on the results pa

Try :
error_reporting(E_ALL);
at the top of the script.
It may identify the problem - maybe with the header:location part ....
by kyle04
Thu Sep 27, 2012 1:38 pm
Forum: PHP coding => General
Topic: PHP & Wordpress
Replies: 0
Views: 534

Re: PHP & Wordpress

You may need to look at the function get_terms(), which seems to control the base output.
by kyle04
Tue Sep 25, 2012 2:43 pm
Forum: PHP coding => General
Topic: form email: control to send an email
Replies: 0
Views: 455

Re: form email: control to send an email

Presuming you are using the form post method : <form method=POST action="myscript.php"> Autorizzo  <input name="privacy_si" type="radio" value="autorizzo" checked="">   Non autorizzo <input type="radio" name="privacy_si" value="non autorizzo"> <input type=submit name="submit"> </form> mysc...
by kyle04
Tue Sep 25, 2012 2:51 am
Forum: PHP coding => General
Topic: Combine the Arrays
Replies: 1
Views: 478

Re: Combine the Arrays

I think you're on the right track. The data entered needs to be sent to a script to be processed. I would suggest also plain text for the player list, and a drop down for the try count per player, that way the data can't be messed up by incorrect user input. The drop down list will store the data to...
by kyle04
Mon Sep 24, 2012 4:50 am
Forum: PHP coding => General
Topic: PHP Question ! ! ! ! Page Entry Number....
Replies: 1
Views: 316

Re: PHP Question ! ! ! ! Page Entry Number....

Do you have the entries stored in a database table ?

If so its fairly simple to get a count of the columns and display these :

$result = mysql_query("SELECT*FROM TABLE_GALLERY");
$gallery_numrows = mysql_numrows($result);


..................

echo "Free Gallery (".$gallery_numrows.")";
by kyle04
Mon Sep 24, 2012 4:43 am
Forum: PHP coding => General
Topic: PHP Array Help
Replies: 1
Views: 346

Re: PHP Array Help

You need to format the data into a string, then update the table : foreach ($new_array as $fruit => $n) { echo $fruit; if($n > 1) { $scorers[] = $fruit."(".$n.")"; } else { $scorers[] = $fruit; // put scorers in an array, with additional try count only if more than 1 } } $ct = count($scorers)-1; $up...
by kyle04
Mon Sep 24, 2012 4:31 am
Forum: PHP coding => General
Topic: Easy Question About Pre Populating Lists
Replies: 3
Views: 440

Re: Easy Question About Pre Populating Lists

$result = mysql_query(query);
should be :

$result = mysql_query($query);
by kyle04
Sun Sep 23, 2012 1:50 pm
Forum: PHP coding => General
Topic: Easy Question About Pre Populating Lists
Replies: 3
Views: 440

Re: Easy Question About Pre Populating Lists

while($myrow = mysql_fetch_array($result));
semi colon not needed here !
by kyle04
Sun Sep 23, 2012 1:48 pm
Forum: PHP coding => General
Topic: Referencing website folders
Replies: 0
Views: 246

Re: Referencing website folders

Its usually something like:


<?
<img src=\"../appfiles/images/image1.jpg\">

or
<img src=\"../../appfiles/images/image1.jpg\">

depending on the file structure.
You may hane to play around with the relative file paths with an image to ascertain the correct syntax.

?>
by kyle04
Sat Sep 22, 2012 3:09 pm
Forum: PHP coding => General
Topic: what is wrong with my php file?
Replies: 18
Views: 1338

Re: what is wrong with my php file?

Looks to me as if youre duplicating effort here. You have a list of radio buttons of which only one selection can be made. But you have also a list of text boxes of which 5 would be redundant because only one would relate to the radio selection. Try : <form method="post" action="hmwk4_total.php"> <p...
by kyle04
Sat Sep 22, 2012 2:45 pm
Forum: PHP coding => General
Topic: Newbie question
Replies: 15
Views: 1792

Re: Newbie question

Good work faust - my snippet was merely a guide !
Perhaps I should have suggested at the beginning :

foreach($_REQUEST as $name=>$value) { // or $_GET
${$name} = $value;
}
by kyle04
Fri Sep 21, 2012 3:40 pm
Forum: PHP coding => General
Topic: HTTPS login
Replies: 0
Views: 263

Re: HTTPS login

What effect does https:// not have?

Does the site have an SSL certificate installed, if so https:// will be as secure as it can be as far as data encryption is concerned....
by kyle04
Fri Sep 21, 2012 3:35 pm
Forum: PHP coding => General
Topic: Newbie question
Replies: 15
Views: 1792

Re: Newbie question

You have to code each trash can, ie link, to tie in with the table value (ideally the PRIKEY or primary key). Assuming you are storing the data in a database table and building your display table from that : ........... while($row = mysql_fetch_array($result)) { ........ $key = $row['PRIKEY']; echo ...
by kyle04
Thu Sep 20, 2012 2:36 pm
Forum: PHP coding => General
Topic: Automatically Calculate based on input
Replies: 2
Views: 361

Re: Automatically Calculate based on input

There will need to be an "event" to fill the textbox after the user has finished entering the amount, which woiuld involve an additional step in the proceedure. Would a javascript function not do the job ? <script type="text/javascript"> function show_amount() { var entered_amount = document.getElem...
by kyle04
Thu Sep 20, 2012 2:03 pm
Forum: PHP coding => General
Topic: Case sensitive/redirect
Replies: 0
Views: 330

Re: Case sensitive/redirect

Any typo will result in your default 404 (page not found) file being displayed. You could write a custom 404 file with a redirect and set the path via htaccess (yes you need this....). ErrorDocument 404 /notfound.html using $_SERVER['REQUEST_URI'] maybe to get the url typed. But this could result in...
by kyle04
Thu Sep 20, 2012 1:24 pm
Forum: PHP coding => General
Topic: Write a link in a text file
Replies: 0
Views: 247

Re: Write a link in a text file

You can try escaping the quotes :

fwrite($f, "<img src=\"http://www.bbb.ca/logo/dir/image.jpg\" align=\"top\" width=150>");

AndyP
by kyle04
Thu Sep 20, 2012 5:01 am
Forum: PHP coding => General
Topic: Counter problem
Replies: 0
Views: 226

Re: Counter problem

$i=3;
while($i<=500) {
echo "to teliko apotelesma einai ".$i;
$i=$i+3;
}
by kyle04
Wed Sep 19, 2012 1:43 pm
Forum: PHP coding => General
Topic: Array question
Replies: 1
Views: 314

Re: Array question

What exactly are you trying to achieve here (with respect) ? You are trying to reference the session $cart_xx variable (array) - as in cart_01, cart_02 etc ? foreach($_SESSION as $name => $value) { if ($value>0) { if (substr($name, 0 , 5) =='cart_') { $id = str_replace("cart_","",$name); $id_array[$...