Jump to content

rocky48

Members
  • Posts

    199
  • Joined

  • Last visited

About rocky48

  • Birthday 03/03/1948

Contact Methods

  • Website URL
    www.1066cards4u.co.uk

Profile Information

  • Gender
    Male
  • Location
    Hastings, UK
  • Interests
    Programming, Radio Control Model Aircraft
  • Age
    71

rocky48's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

4

Community Answers

  1. I think it was the parent bit that was stopping it! However there are still problems! Here is the error: Now I have cleared the original problem, It still errors! Now it is finding fault with the font scripts. Here is the error: Fatal error: Uncaught Exception: FPDF error: Incorrect font definition file name: /frscript.php in /homepages/30/d593365489/htdocs/fpdf.php:271 Stack trace: #0 /homepages/30/d593365489/htdocs/fpdf.php(1142): FPDF->Error('Incorrect font ...') #1 /homepages/30/d593365489/htdocs/fpdf.php(459): FPDF->_loadfont('/frscript.php') #2 /homepages/30/d593365489/htdocs/Prnpdf.php(110): FPDF->AddFont('french script m...', '', '/frscript.php') #3 {main} thrown in /homepages/30/d593365489/htdocs/fpdf.php on line 271 What is also wierd even if I change the font it still reports the error with the French Script font? Had a quick look at the font file, but can't see anything wrong. I'm guessing there is a change in the frscript.php, but I am not knowledgable to spot it! Before the upgrade to 7.2 it was working OK.
  2. Tried as suggested but get the same error! Fatal error: Uncaught Error: Call to undefined method FPDF::FPDF() in /homepages/30/d593365489/htdocs/Prnpdf.php:78 Stack trace: #0 /homepages/30/d593365489/htdocs/Prnpdf.php(108): PDF->__construct('L', 'mm', 'A4') #1 {main} thrown in /homepages/30/d593365489/htdocs/Prnpdf.php on line 78 Also tried amending this line: $pdf = new PDF($ort,'mm','A4'); to: $pdf = new __construct($ort,'mm','A4');, but that did not work and gave this error: Fatal error: Uncaught Error: Class '__construct' not found in /homepages/30/d593365489/htdocs/Prnpdf.php:108 Stack trace: #0 {main} thrown in /homepages/30/d593365489/htdocs/Prnpdf.php on line 108. Where do I go rom here? 😂
  3. I have used this program for many years without problems. My ISP urged me to upgrade PHP to 7.2 and it was working OK. Just went to use it and I get an error when parsing my FPDF file. Here is the error: Connected (added this to check if connected) Fatal error: Uncaught Error: Call to undefined method PDF::FPDF() in /homepages/30/d593365489/htdocs/Prnpdf.php:78 Stack trace: #0 /homepages/30/d593365489/htdocs/Prnpdf.php(108): PDF->PDF('L', 'mm', 'A4') #1 {main} thrown in /homepages/30/d593365489/htdocs/Prnpdf.php on line 78 I have not altered the file in any way, so why is this happening? Is it to do with PHP upgrade?😖 Here is the file: <?php include("connect_Verses4Cards.php"); $conn=get_db_conn_verse(); session_start(); $display_block =""; $color=""; $r =""; $g =""; $b =""; $image =""; //Get the Card Variables $Get_Size_sql = "SELECT * FROM `CSize` WHERE `Size` ='".$_POST["CSize"]."'"; $Get_Size_res = mysqli_query($conn, $Get_Size_sql) or die(mysqli_error($conn)); if (mysqli_num_rows($Get_Size_res) < 1) { //this Card does not exist $display_block = "You have selected an invalid Card size. Please try again."; } else { //get the print variables while ($Size_info = mysqli_fetch_array($Get_Size_res)) { $BoxX = stripslashes($Size_info['BoxX']); $Cellw = stripslashes($Size_info['Cellw']); $Cellh = stripslashes($Size_info['Cellh']); $SizeI = stripslashes($Size_info['Size']); $SID = stripslashes($Size_info['SID']); $floatx = stripslashes($Size_info['floatx']); $floaty = stripslashes($Size_info['floaty']); $floatw = stripslashes($Size_info['floatw']); $floath = stripslashes($Size_info['floath']); $ort = stripslashes($Size_info['ort']); } //create the display string $display_block = "$ort"; } //verify the Event exists //$the_id = mysqli_real_escape_string($mysqli, $_SESSION[VID]); $Get_Verse_sql = "SELECT id, Event, Sub_Type, Verse FROM verses WHERE id='".$_SESSION['Test']."'"; $Get_Verse_res = mysqli_query($conn, $Get_Verse_sql) or die(mysqli_error($conn)); if (mysqli_num_rows($Get_Verse_res) < 1) { //this Event does not exist $display_block = "You have selected an invalid Event. Please try again."; } else { //get the Event ID while ($Verse_info = mysqli_fetch_array($Get_Verse_res)) { $Verse = stripslashes($Verse_info['Verse']); } //create the display string $display_block = "$Verse"; //free results mysqli_free_result($Get_Verse_res); mysqli_free_result($Get_Size_res); //close connection to MySQL } mysqli_close($conn); require('fpdf.php'); class PDF extends FPDF { var $B; var $I; var $U; var $HREF; function PDF($orientation='P', $unit='mm', $size='A4') { // Call parent constructor $this->FPDF($orientation,$unit,$size); // Initialization $this->B = 0; $this->I = 0; $this->U = 0; $this->HREF = ''; } function SetStyle($tag, $enable) { // Modify style and select corresponding font $this->$tag += ($enable ? 1 : -1); $style = ''; foreach(array('B', 'I', 'U') as $s) { if($this->$s>0) $style .= $s; } $this->SetFont('',$style); } } $color = $_POST['color']; $r = substr($color,0,3); $g = substr($color,3,3); $b = substr($color,6,3); $image=$_POST['image']; $pdf = new PDF($ort,'mm','A4'); $pdf->AddPage(); $pdf->AddFont('French Script MT','','/frscript.php'); $pdf->AddFont('Batavia','','Batavia_.php'); $pdf->AddFont('Algerian','','Alger.php'); $pdf->AddFont('Bladerunner','','BLADRMF_.php'); $pdf->AddFont('Brush Script','','BRUSHSCI.php'); $pdf->AddFont('Helterskelter','','Helte___.php'); $pdf->AddFont('Justice','','Justice_.php'); $pdf->AddFont('Magneto','','MAGNETOB.php'); $pdf->AddFont('Old English','','OldEngl.php'); $pdf->AddFont('Sneakerhead Outline','','Sneabo__.php'); $pdf->AddFont('Trendy','','Trendy__.php'); $pdf->AddFont('Vladimir Script','','VLADIMIR.php'); $pdf->SetLeftMargin('float0'); $pdf->SetTextColor($r,$g,$b); $pdf->SetFont($_POST['fontface'],'',$_POST['font']); $pdf->SetXY($BoxX, $_POST['Top']); $pdf->Image($image,$floatx,$floaty,$floatw,$floath,'',''); $pdf->MultiCell($Cellw,$Cellh,$display_block,'' ,'C'); //$pdf->SetDisplayMode('fullpage',''); $pdf->SetFont(''); $pdf->Output('verse.pdf','D'); //end: ?>
  4. I am designing a form where the users input information to be stored on a database. All of the other inputs apart from the email post OK, but the email does not! The error is: Notice: Undefined index: email in /home/hp3-linc4-nfs2-y/555/1099555/user/htdocs/includes/renew1.php on line 19 Consequently the mysqli query does not succeed. Here is the section of code in the html file: <h1>Online Renewal Form</h1> <form action="includes/renew1.php" method="post"> <fieldset> <p><label for= "firstname"><b>Enter Firstname:</b></label> <input type="text" name="firstname" id="firstname" value="firstname" size="20" maxlength="20"/></p> <p><label for= "surname"> <b>Enter Surname: </b></label> <input type="text" name="surname" id="surname" value="surname" size="20" maxlength="40"/></p> <p><label for= "bmfa_no"> <b>Enter BMFA No:</b></label> <input type="text" name="bmfa_no" id="bmfa_no" value="BMFA_No" size="30" maxlength="80" /> </p> <p><label for= "road"> <b>Enter Road:</b></label> <input type="text" name="road" id="road" value="road" size="30" maxlength="80"/> </p> <p><label for="town"> <b>Enter Town:</b> </label> <input type="text" name="town" id="town" value="town" size="30" maxlength="80"/> </p> <p><label for="county"> <b>Enter County:</b></label> <input type="text" name="county" id="county" value="county" size="30" maxlength="80" /> </p> <p><label for= "pcode"> <b>Enter Post Code:</b></label> <input type="text" name="pcode" id="pcode" value="pcode" size="30" maxlength="80" /> </p> <p><label for="phone"> <b>Enter Phone No:</b></label> <input type="tel" name="phone" id="phone" value="phone" size="30" maxlength="80" /> </p> <p><label for="mobile"> <b>Enter Mobile No:</b></label> <input type="tel" name="mobile" id="mobile" value="mobile" size="30" maxlength="80" /> </p> <p><label for="email"> <b>Enter Email:</b></label> <input id="email" type="text"></p> <p><label for="date"><b>Enter Date of Birth:</b></label> <input id="date" type="date"> </p> </fieldset> <fieldset> <p><label><b>Do you wish that the club obtains your BMFA membership & Insurance: </b></label> (click on box to see the list) <SELECT name= "club_mem"> <option value="No">NO</option> <option value="Yes">YES</option> </SELECT><br><br> </fieldset> <fieldset> <p><label><b>Country Member: </b></label> (click on box to see the list) <SELECT name= "country_mem"> <option value="No">NO</option> <option value="Yes">YES</option> </SELECT><br><br> </fieldset> <fieldset> <p><label><b>Do you require training: </b></label> (click on box to see the list) <SELECT name= "train"> <option value="No">NO</option> <option value="Yes">YES</option> </SELECT><br><br> </fieldset> <fieldset><legend><b>The Amount to Pay</b></legend> <p><label><b>Membership Fees: </b></label> (click on box to see the list) <SELECT name= "subs_amount"> <option value="0">0</option> <option value="10.00">£10.00</option> <option value="13.00">£13.00</option> <option value="15.00">£15.00</option> <option value="17.00">£17.00</option> <option value="24.00">£24.00</option> <option value="27.00">£27.00</option> <option value="34.00">£34.00</option> <option value="44.00">£44.00</option> </SELECT><br><br> <b>Description of Fees</b><br><br> Social or Country members £10<br> Family Junior member £13<br> Junior Country member £17<br> Family Partner member £24<br> Junior Club member (Includes BMFA fees) £27<br> Family Senior member &£34<br> Senior Club member (Includes BMFA fees) £44<br> Family members must complete the renewal form if they want the club to sign them up for BMFA family membership.<br> If the family member has Country membership of BMFA they must enrol as a country member (£10). </p> </fieldset> <fieldset><legend><b>Please select the method of payment</b></legend> <p><label><b>Payment Method: </b></label> (click on box to see the list) <select name="pay_meth"> <option value="Cheque">Cheque</option> <option value="Cash">Cash</option> <option value="BACS">BACS</option> </select> </fieldset> <br /> <div align="left"><input type="submit" name="submit" value="Submit" /></div> <input type="hidden" name="submitted" value="TRUE" /> </form> The code in the PHP file is as follows: $trimmed = array_map('trim', $_POST); $Fname = mysqli_real_escape_string($dbc, $_POST['firstname']); $Sname = mysqli_real_escape_string($dbc, $_POST['surname']); $Road = mysqli_real_escape_string($dbc, $_POST['road']); $Town = mysqli_real_escape_string($dbc, $_POST['town']); $County = mysqli_real_escape_string($dbc, $_POST['county']); $Pcode = mysqli_real_escape_string($dbc, $_POST['pcode']); $Phone = mysqli_real_escape_string($dbc, $_POST['phone']); $Mobile = mysqli_real_escape_string($dbc, $_POST['mobile']); $Email = mysqli_real_escape_string($dbc, $_POST['email']); $DOB = mysqli_real_escape_string($dbc, $_POST['dob']); $BMFA = mysqli_real_escape_string($dbc, $_POST['bmfa_no']); $C_mem = mysqli_real_escape_string($dbc, $_POST['country_mem']); $Amount = mysqli_real_escape_string($dbc, $_POST['subs_amount']); $meth = mysqli_real_escape_string($dbc, $_POST['pay_meth']); $club = mysqli_real_escape_string($dbc, $_POST['club_mem']); $training = mysqli_real_escape_string($dbc, $_POST['train']); I thought that the problem was in the HTML file, but I am unable to see where it is incorrect. Please help?
  5. What do you mean by a prepared query? I am not putting user input directly into the query, otherwise I would have put the ($_POST['Value']) into the query! Am I not understanding why that no rows are produced with msqli_num_rows()? I am still somewhat 'green', probably due to my age!
  6. I know this question has been asked many times before, and I have looked at many of the answers, but i just can't see whats wrong. I have got it to print $r and that equals 1, so should print the message "Your renewal form has been received and added to the database", but it prints the other message? Never the less the INSERT is updating the database, so why is it not printing the correct echo. I've tried FALSE instead of <1. I also had it the other way around (correct message first), but I still get the same result. Please help! Here is the code: <?php require_once ('config.inc.php'); if (isset($_POST['submitted'])) { // Handle the form. // print_r($_POST); require_once('connect_renew.php'); // Trim all the incoming data: $trimmed = array_map('trim', $_POST); $Fname = $_POST['firstname']; $Sname = $_POST['surname']; $Road = $_POST['road']; $Town = $_POST['town']; $County = $_POST['county']; $Pcode = $_POST['pcode']; $Phone = $_POST['phone']; $Mobile = $_POST['mobile']; $Email = $_POST['email']; $DOB = $_POST['dob']; $BMFA = $_POST['bmfa_no']; $C_mem = $_POST['country_mem']; $Amount = $_POST['subs_amount']; $meth = $_POST['pay_meth']; $q= "INSERT INTO `Rform`(`firstname`, `surname`, `road`, `town`, `county`, `pcode`, `phone`, `mobile`, `email`, `dob`, `bmfa_no`, `country_mem`, `subs_amount`, `pay_meth`, date_sub) VALUES ('$Fname', '$Sname', '$Road', '$Town', '$County', '$Pcode', '$Phone', '$Mobile', '$Email', '$DOB', '$BMFA', '$C_mem', '$Amount', '$meth', now())"; $r = mysqli_query ($dbc, $q) or die(mysqli_error($dbc)); if (mysqli_num_rows($r) < 1){ // Available. echo $r; echo '<p>Somethings wrong, You need to re-enter your details</p>'; }else{ echo '<p> Your renewal form has been received and added to the database</p>'; } mysqli_close($dbc); } ?>
×
×
  • 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.