Jump to content

adam291086

Members
  • Posts

    1,312
  • Joined

  • Last visited

    Never

Everything posted by adam291086

  1. Here is the function function get_template($domain,$account) { require_once('DbConnector.php'); $loginConnector = new DbConnector(); $getTemplate = $loginConnector->query("SELECT * FROM Site_Info WHERE Domain = '$domain' AND account_number='$account'"); $this->templatedata = $loginConnector->fetchArray($getTemplate); $temp = $this->templatedata['Id']; $getTemplate = $loginConnector->query("SELECT * FROM Template_Details WHERE Id = '$temp'"); $this->templatedata = $loginConnector->fetchArray($getTemplate); $image = $this->templatedata['example_location']; return $image; } the variable $image does contain the correct data. Now i am trying to echo out the returned variable like require_once ('../../code/cms.php'); $domain = $_SESSION['domain']; $account = $_SESSION['account_number']; $add = new cms(); $add ->get_template($domain,$account); $image = $add; echo $image; But instead of the image location i get Object written on the page. The function is within a class which is initated correctly.
  2. try this echo "<form action=\"/index.php?section=test\" method=\"get\"><input type=\"text\" name=\"test\" /><input type=\"submit\" /></form>";
  3. I dont see where you are doing a database connection and running the variable $query. I think you need to go here www.w3schools.com/php and look into php and mysql
  4. post the code you are using to post the link
  5. so you have it pinging on address and you just want a loop? Post the code you have so far
  6. You will need to use the month within your search. I.e select everything where day = 17 and month = september. If you just use the day then every instance of 17 will display the event
  7. thats basically saying there is no information from the $_POST['searchtext'];
  8. try <?php //Collect Post Vars extract($_POST); //Number of people change to Integer Value $numberofpeople = $_POST['os']; if ( $numberofpeople == "one" ) { $numberofpeople = 1; } if ( $numberofpeople == "two" ) { $numberofpeople = 2; } if ( $numberofpeople == "three" ) { $numberofpeople = 3; } if ( $numberofpeople == "four" ) { $numberofpeople = 4; } // Weekend or Weekday $daychoice = $_POST['daychoice']; if ( $daychoice == "Week Day" ) { $daychoice = 160; } if ( $daychoice == "Weekend" ) { $daychoice = 190; } //For Postage & Packaging if ( $numberofpeople >= "1") { $postage = 1; } //Calculate Total $reducedrate = $_POST['reduced_rate']; $newrate = 8.00 * $reducedrate; $total = $daychoice * $numberofpeople + $newrate + $postage; $total = number_format($total,2); //Set Description $description = "Keeper For A Day"; echo "<b>You Submitted As The Sender : </b>"; echo $postage; echo "<br><br>"; echo "Name : "; echo $sendertitle; echo " "; echo $senderforename; echo " "; echo $sendersurname; echo "<br><br>"; echo "Address : "; echo $senderaddress; echo " "; echo $senderaddress1; echo " "; echo $sendertown; echo " "; echo $sendercounty; echo "<br><br>"; echo "Telephone : "; echo $sendertelephone; echo "<br><br>"; echo "E-Mail Address : $senderemail"; echo "<br><br>"; echo "This gift is for : $numberofpeople person(s)"; echo "<br><br>"; echo "This also includes $reducedrate people entering the park at a reduced rate"; echo "<br><br><br>"; echo "<b>Total Cost for this purchase : </b>"; echo "£"; echo $total; ?> <?php // check if the form has been submitted if($_POST['submit']) { $sql = "INSERT INTO $db_table(experiencename,sendertitle,senderforename,sendersurname,senderaddress,senderaddress1,sendertown,sendercounty,sendertelephone,senderemail,numberofpeople,numberforreducedrate,total) //VALUES ('$description','$sendertitle','$senderforename','$sendersurname','$senderaddress','$senderaddress1','$sendertown','$sendercounty','$sendertelephone','$senderemail','$os','$reducedrate','$total')"; ($result = mysql_query($sql ,$conn) or die(mysql_error())); echo 'success'; } else { ?> <!-- The first line of code creates a form, which has the POST method and its action is to send the form to us. You do not need to set-up a special connection to us before using it - your Internet connection is all you need to communicate with us.--> <form action="https://select.worldpay.com/wcc/purchase/results.php" method=post> <!-- This next line contains a mandatory parameter. Put your Installation ID inside the quotes after value= --> <input type=hidden name="instId" value="" /> <!-- Another mandatory parameter. Put your own reference identifier for the item purchased inside the quotes after value= --> <input type=hidden name="cartId" value="Keeper for a day"> <!-- Another mandatory parameter. Put the total cost of the item inside the quotes after value= --> <input type=hidden name="amount" value="<?php echo $total ; ?>"> <!-- Another mandatory parameter. Put the code for the purchase currency inside the quotes after value= --> <input type=hidden name="currency" value="GBP"> <!-- This creates the button. When it is selected in the browser, the form submits the purchase details to us. --> </p> <p align="left" class="style13"> </form> <input type=submit value="Confirm and Purchase" name="submit"> <?php } ?>
  9. try this <?php //Collect Post Vars extract($_POST); //Number of people change to Integer Value $numberofpeople = $_POST['os']; if ( $numberofpeople == "one" ) { $numberofpeople = 1; } if ( $numberofpeople == "two" ) { $numberofpeople = 2; } if ( $numberofpeople == "three" ) { $numberofpeople = 3; } if ( $numberofpeople == "four" ) { $numberofpeople = 4; } // Weekend or Weekday $daychoice = $_POST['daychoice']; if ( $daychoice == "Week Day" ) { $daychoice = 160; } if ( $daychoice == "Weekend" ) { $daychoice = 190; } //For Postage & Packaging if ( $numberofpeople >= "1") { $postage = 1; } //Calculate Total $reducedrate = $_POST['reduced_rate']; $newrate = 8.00 * $reducedrate; $total = $daychoice * $numberofpeople + $newrate + $postage; $total = number_format($total,2); //Set Description $description = "Keeper For A Day"; echo "<b>You Submitted As The Sender : </b>"; echo $postage; echo "<br><br>"; echo "Name : "; echo $sendertitle; echo " "; echo $senderforename; echo " "; echo $sendersurname; echo "<br><br>"; echo "Address : "; echo $senderaddress; echo " "; echo $senderaddress1; echo " "; echo $sendertown; echo " "; echo $sendercounty; echo "<br><br>"; echo "Telephone : "; echo $sendertelephone; echo "<br><br>"; echo "E-Mail Address : $senderemail"; echo "<br><br>"; echo "This gift is for : $numberofpeople person(s)"; echo "<br><br>"; echo "This also includes $reducedrate people entering the park at a reduced rate"; echo "<br><br><br>"; echo "<b>Total Cost for this purchase : </b>"; echo "£"; echo $total; ?> <?php // check if the form has been submitted if($_POST['submit']) { $sql = "INSERT INTO $db_table(experiencename,sendertitle,senderforename,sendersurname,senderaddress,senderaddress1,sendertown,sendercounty,sendertelephone,senderemail,numberofpeople,numberforreducedrate,total) //VALUES ('$description','$sendertitle','$senderforename','$sendersurname','$senderaddress','$senderaddress1','$sendertown','$sendercounty','$sendertelephone','$senderemail','$os','$reducedrate','$total')"; ($result = mysql_query($sql ,$conn) or die(mysql_error())); } ?> <!-- The first line of code creates a form, which has the POST method and its action is to send the form to us. You do not need to set-up a special connection to us before using it - your Internet connection is all you need to communicate with us.--> <form action="https://select.worldpay.com/wcc/purchase/results.php" method=POST> <!-- This next line contains a mandatory parameter. Put your Installation ID inside the quotes after value= --> <input type=hidden name="instId" value="" /> <!-- Another mandatory parameter. Put your own reference identifier for the item purchased inside the quotes after value= --> <input type=hidden name="cartId" value="Keeper for a day"> <!-- Another mandatory parameter. Put the total cost of the item inside the quotes after value= --> <input type=hidden name="amount" value="<?php echo $total ; ?>"> <!-- Another mandatory parameter. Put the code for the purchase currency inside the quotes after value= --> <input type=hidden name="currency" value="GBP"> <!-- This creates the button. When it is selected in the browser, the form submits the purchase details to us. --> </p> <p align="left" class="style13"> </form> <input type=submit value="Confirm and Purchase" name="submit">
  10. The code didn't like the inlcude, so i chaged the location of the file and now it all works fine Thanks
  11. yeah i have changed the name within the script i include ftp_details
  12. i have just done this to the function i am calling upon <?php error_reporting(E_ALL); function account() { // ftp variables $settings['ftpServer'] = 'la'; $settings['ftpUsername'] = 'sadfs'; $settings['ftpPassword'] = 'Cdsfdsffsdfsdfsdf'; return $settings; } $setting = account(); print_r($setting); ?> and when i run the script the array prints out. But when include i get undefined.
  13. i have a function that stores all my ftp username and passwords like <?php function getSettings() { // ftp variables $settings['ftpServer'] = 'la'; $settings['ftpUsername'] = 'la'; $settings['ftpPassword'] = 'dream on'; return $settings; } ?> i want to be able to get these details within another script i have tried include('http://www.rubberduckiee.co.uk/code/ftp_details.php'); $settings = getSettings(); $ftpServer = $settings['ftpServer']; $ftpUser = $settings['ftpUsername']; $ftpPass = $settings['ftpPassword']; $c = @ftp_connect($ftpServer); $l = @ftp_login($c, $ftpUser, $ftpPass); if(!$c) die("A connection to $ftpServer couldn't be established"); else if(!$l) die("Your login credentials were rejected"); else return $c; but all i get is the error message saying undefined function getsettings() on line 18
  14. You need to state what the form is supposed to send data to. You haven't specified the exact file. Need to be specific i.e <form action="https://select.worldpay.com/wcc/purchase/results.php" method=POST> Then is the file you send the variable to have this <?php // check if the form has been submitted if($_POST['submit']) { $sql = "INSERT INTO $db_table(experiencename,sendertitle,senderforename,sendersurname,senderaddress,senderaddress1,sendertown,sendercounty,sendertelephone,senderemail,numberofpeople,numberforreducedrate,total) VALUES ('$description','$sendertitle','$senderforename','$sendersurname','$senderaddress','$senderaddress1','$sendertown','$sendercounty','$sendertelephone','$senderemail','$os','$reducedrate','$total')"; ($result = mysql_query($sql ,$conn) or die(mysql_error())); } ?>
  15. also instaed of if(isset($_POST['submit'])) put if($_POST['submit'])
  16. Do you have a else statement after the If statement saying display the form instead of the post values?
  17. i have this php function function edit($id) { require_once('DbConnector.php'); $loginConnector = new DbConnector(); $getnote = $loginConnector->query("Select * FROM Notepad WHERE Id ='$id'"); while ($this->notedata = $loginConnector->fetchArray($getnote)) { $text = $this->notedata['text']; $id = $this->notedata['Id']; echo $text; } } now it gets the information from my database. But instead of echoing out the information i want to return the values of $text to be used else where within the iniation script. This is how i call upon the function $edit = new note(); $id = $_GET['id']; $edit->edit($id);
  18. post all the code for the menu stuff the line dezkit gave you should work
  19. edit sorry sorry just read your code but this line is point less $serial = $_POST['serial']; put error_reporting(E_ALL); at the top of the page and see what you get
  20. i have this function function get_note($account, $domain) { require_once('DbConnector.php'); $loginConnector = new DbConnector(); $getnote = $loginConnector->query("SELECT * FROM Notepad WHERE user_account_number = '$account' AND user_domain = '$domain'"); while ($this->notedata = $loginConnector->fetchArray($getnote)) { $title = $this->notedata['title']; $text = $this->notedata['text']; $date = $this->notedata['date_due']; return $title; return $text; return $date; } } this function is within a class which is initated like <?php error_reporting(E_ALL); require_once ('../../code/note.php'); $account = '123'; $domain = 'www.adamplowman.co.uk'; $add = new note(); $add->get_note($account, $domain) ?> i want to get the return values $text, $title and $date into the page that the function is intated and echo them out within certain places within some html code.
  21. what errors are you getting? add error_reporting(E_ALL); to the top of the page and that will throw out any errors.
  22. Ok i am using this free rte and i have the following code <?php function freeRTE_Preload($content) { // Strip newline characters. $content = str_replace(chr(10), " ", $content); $content = str_replace(chr(13), " ", $content); // Replace single quotes. $content = str_replace(chr(145), chr(39), $content); $content = str_replace(chr(146), chr(39), $content); // Return the result. return $content; } ?> <form method="get" action=""> <!-- Include the Free Rich Text Editor Runtime --> <script src="../js/richtext.js" type="text/javascript" language="javascript"></script> <!-- Include the Free Rich Text Editor Variables Page --> <script src="../js/config.js" type="text/javascript" language="javascript"></script> <!-- Initialise the editor --> <?php if(isset($_GET['freeRTE_content'])) { $content = $_GET['freeRTE_content']; echo $content; } else { // Send the preloaded content to the function. $content = freeRTE_Preload("<i>This is some <b><br>preloaded</b> content</i>") ?> <script> initRTE('<?= $content ?>'); </script> <input type="submit" name="submit"> </form> <?php } ?> When i click submit the rte content appears in the URL like so but the RTE is displayed and not the content and i dont know why
  23. I found this function ages ago through google function full_copy($source, $target,$new ) { if (is_dir($source ) ) { @mkdir($target ); $d = dir($source ); while (FALSE !== ($entry = $d->read() ) ) { if ($entry == '.' || $entry == '..' ) { continue; } $Entry = $source . '/' . $entry; if (is_dir($Entry ) ) { full_copy($Entry, $target . '/' . $entry ); continue; } copy($Entry, $target . '/' . $entry ); } $d->close(); } else { copy($source, $target ); } } Heres the problem if i have the following folder structure Folder Adam which contains Folder john file adam.php file index.php Folder john contains file index.php When i go to call on the function all the files and folders within Adam are copied across but not into a folder called Adam there is just the folder called john with its files and the other two files. I know i need to mkdir($source) at the start of the function but i am stuck with how to get everything to go into that folder.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.