Jump to content

sseeley

Members
  • Posts

    85
  • Joined

  • Last visited

Posts posted by sseeley

  1. I am hoping that someone can help me. I have installed PEAR onto my Godaddy account, but I am not getting any luck when I am trying to get working. 

     

    I have a really simply file to begin testing.

    <?php
    
    include ('/PEAR/Mail.php');
    
    ?>
    

    When I run the file I get the following errors.

     

    Warning: include(/PEAR/Mail.php) [function.include]: failed to open stream: No such file or directory in /home/content/97/5783497/html/emailTest.php on line 2

    Warning: include() [function.include]: Failed opening '/PEAR/Mail.php' for inclusion (include_path='.:/usr/local/php5/lib/php:./PEAR') in /home/content/97/5783497/html/emailTest.php on line 2

     

    PEAR is installed into /PEAR/

     

    My PHP5.ini file has the following.

    cgi.fix_pathinfo = 1
    include_path = .:/usr/local/php5/lib/php:./PEAR
    SMTP = relay-hosting.secureserver.net
    smtp_port = 25
    

    Can any one suggest any help I would be really grateful.

     

    Regards

     

    Stuart

  2. I hope someone can help with a small query I have. I have a text file with a number of values within. The values are held on the line below a criterion I can search for. With PHP I can search for the text and display the line number, for example 254. I now cannot see how I can lookin a text file and say echo or print line 255? Can anyone help with this at all? Much appreciate any comments from anyone.

     

    Thanks

     

    Stuart

  3. Please can you help, I have a really easy query but cannot get past this error message.

     

     

    SELECT cadetId, lastName, firstName FROM
    (
    SELECT tblcadets.pkCadetId AS cadetId, tblcadets.lastName AS lastName, tblcadets.firstName AS firstName
    FROM tblcadets AS tblcadets
    )

     

     

    thanks for any help you can give me.

  4. Hi I hope someone can help me. I am trying to post a form on the selection of a check box.  I am using the following code, but I get JavaScript errors in IE and Chrome.

     

    echo "<form action='page2.php' method='POST' name='myform'>";
    				echo "<input type='checkbox' name='this_Box' value='test' onclick='submitform()'>";
    				echo "</form>";
    				?>
    				<script type="text/javascript">
    				function submitform()
    				{
    					document.forms["myform"].submit();
    				}
    				</script>
    				<?php	

     

    Many thanks in advance

     

    Stuart

  5. Hello, can anyone help me with this Javascript? When I click cancel it still submits the form?

     

    function confirmSubmit()

    {

    var r=confirm("Please confirm you have updated the divisors correctly");

    if (r==true)

    {

    submitOK = "true";

    }

    else

    {

    submitOK = "false";

    }

    if (submitOK == "false")

    {

    return false;

    }

    }

  6. I need to insert a barcode onto a printed page.  The page is built with HTML and uses tables etc.  Can anyone suggest some PHP tools that can help me create a barcode and insert this into my page?

     

    Many thanks in advance.

     

    Stuart

  7. Hi I am hoping somone can help me?  I am trying to generate a simple barcode to use on a website which will print out a label.  I have found barcodephp.com and have installed this.  When I use their test facility below it works fine and generates a barcode for A123.

     

    <?php
    		require('class/BCGFont.php');
    		require('class/BCGColor.php');
    		require('class/BCGDrawing.php');
    		require('class/BCGcode39.barcode.php');
    
    		$font = new BCGFont('./class/font/Arial.ttf', 18);
    		$color_black = new BCGColor(0, 0, 0);
    		$color_white = new BCGColor(255, 255, 255);
    
    		$code = new BCGcode39();
    		$code->setScale(2);
    		$code->setThickness(30);
    		$code->setForegroundColor($color_black);
    		$code->setBackgroundColor($color_white);
    		$code->setFont($font);
    		$code->setChecksum(false);
    		$code->parse('A123');
    
    		// Drawing Part
    		$drawing = new BCGDrawing('', $color_white);
    		$drawing->setBarcode($code);
    		$drawing->draw();
    
    		header('Content-Type: image/png');
    
    		$drawing->finish(BCGDrawing::IMG_FORMAT_PNG);
    
    ?>
    

     

    As soon as I insert this same code into my code, or just try and put the barcode into a table (below) I get an error as shown.  Can anyone point me in the right direction?

     

    echo "<table border = '1'>";
    echo "<tr>";
    echo "<td>";
    require('class/BCGFont.php');
    require('class/BCGColor.php');
    require('class/BCGDrawing.php');
    require('class/BCGcode39.barcode.php');
    
    $font = new BCGFont('./class/font/Arial.ttf', 18);
    $color_black = new BCGColor(0, 0, 0);
    $color_white = new BCGColor(255, 255, 255);
    
    $code = new BCGcode39();
    $code->setScale(2);
    $code->setThickness(30);
    $code->setForegroundColor($color_black);
    $code->setBackgroundColor($color_white);
    $code->setFont($font);
    $code->setChecksum(false);
    $code->parse('A123');
    
    // Drawing Part
    $drawing = new BCGDrawing('', $color_white);
    $drawing->setBarcode($code);
    $drawing->draw();
    
    header('Content-Type: image/png');
    
    $drawing->finish(BCGDrawing::IMG_FORMAT_PNG);
    echo "</td>";
    echo "</tr>";
    echo "</table>";

     

     

    <table border = '1'>‰PNG

     

    IHDRœSådù{LtEXtCopyrightGenerated with Barcode Generator for PHP http://www.barcodephp.comYp¸JIDATxœíA(t_ÀÏ{MchM’4iÒ42Yiú‡,,$I–”,$IÒ°øB’…b!ÉÊ‚YL’&YJRJš˜$é%M’Æ,¦§ù/Nßëeæ½oø†ïÍéüVæÜsï¼ó~Þ½÷]@2™„ß‚ DðguŽV$óÖl}—Ö_»Î¯¦ÉdÌï¸3"0ä`©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©a©Ôÿ_Œ¡?©a©a©a©É©}}}‚ ‚prr’a—‰‰ A...Ò¶>??OLLTWWçççÖÕÕ---½¿¿HÛÚÚjjj***ÊËË«©©™™™y{{û«J~€d.Çm6^ðÀÀ@&]B¡Éd€óóóÔÖÛÛ[§Ó‰VUUy<Q µµ5‘H(i˜ãr¹¼^¯ÅbÁü‡‡‡¬Õö

    ä†Ô

    ¼ã`³Ùb±˜~~0,((@i¥¶´´@IIÉññ1FÎÎÎÊÊÊàׯ_ÙÜÜ«Õº¿¿‘ûûûúúzèîîÎ^qÙ'7¤¢ÎµµµÚÚZX__×ÊŒÇã~¿;-©çççØ´¶¶¦Ž4}>ÌÍÍ©sÂá0˜L¦×××,—}r@j4ʼnôöövjj

    |>_ÚLI’***Àl6¯®®jI]YYÁ¦ûû{u<‹a\’¤d2999ÙÖÖvss£ÎI$˜syy™Õ*³IH]XX€ÚÚÚd2‰DðžF"‘ÔÌããcT‡“¿OÊR¥J’———?Ä_^^°Ë‘j    ÿmaßFHõx<0;;‹qMÍ”$iggGù¨³¦¦%âš­Þ+©9<<¬¬¬¿ßÿÉ"~£K=;;ûðôÌÍÍáʧuë>+Õëõ@ooojSGGNì&“ÉàF“Æ—:::

    õõõJD’$Üý¾Ÿ’Š«µÕjÅõ¸¨#

     

     

    ÊžÙ˜Zª,Ëøš±¸¸¨Žã¾´µµU¿{æR€(Š¢(¦ýE‘eY’¤D"‡ÛÛÛqMÅeÛ˜Zj(Q£Ñ¨:¾¼¼Œñ´O•B†R÷ööÌf3ÌÏÏÿñ’dYnll€®®®LJø'ZjOO袤%©{{{xN499™áUá~Jy5 Æ•úúúŠ§B¥¥¥ŽðÔÐápèŒðG©»»»ht||<µ5¦];OOOñUøEýÆ•º¾¾‹åéé)µu{{…B!­ô¥*³îØØXjëÕÕÎð©Ç¼øÕN§ó3Õü(Æ•ÚÜܬ³tɲ\^^Z#èH=::Âi`ppP«»ÃáP¿+à™åÐÐPfuü*UyoÙÝÝÕÊñûý8

    ~8íSÐ’úøøˆ›jŸÏ'˲Öø¸³X,Á`#±XÿnS\\|ww÷ù²~ƒJžžÆÕTç¦___£x­]«–ÔÁÁAlr¹\ÿ¥C9èèïïÇL§Óéõz­V+ØíöƒƒƒlUúTªÛ퀑‘ý4üšÛíNÛª%Õn·ëoªÕ]@KK‹Íf3›Í.—kxxØÈÏ(ò?ãö#)‰6¡IEND®B`‚</table>

     

     

    Many thanks

     

    Stuart

  8. I am trying to create a while loop to create multiple function scripts to validate some entries on my PHP page, however I cannot seem to get the loop to work correctly.  Any help would be much appreciated.

     

    <script>
    var i = 0;
    var ii = 64;
    while (i < ii)
    {
    var validate = "validate" + i";
    function validate + ()
    {
    		var teamName = document.getElementById("teamName").value;
    		alert(teamName);
    }
    i++;
    }
    </script>

     

     

    Stuart

  9. I am trying to pass a PHP variable after the variable has loaded in PHP but nothing is coming through in the alert I have created to test.  If anyone can help I would be grateful.

     

    $drawIdR2 = mysql_result($getEntriesRd2,$v,"tblteamevents.fkDrawId");
    $teamNameR2 = mysql_result($getEntriesRd2,$v,"tblcompleteddraw.teamName");
    echo "<tr>";
    echo "<td align=\"left\" valign = 'top' width = '100' height = '20' style=\"font-family:arial; font-weight:normal; font-stretch:wider; font-size:14px; color:Black;\">";
    if($i > $numberBys)
    {
    ?>
    <head>
    <script language="JavaScript">
    <!--
    	  function myFunction() {
    			var alert1 = "<?php echo $teamNameR2; ?>";
    			alert("123");
    	  }
    
    			//-->
    			</script>
    	</head>
    	<?php
    	$drawIdR1 = mysql_result($getEntriesRd1,$xi,"tblteamevents.fkDrawId");
    	echo "<a href = 'javascript:myFunction()' style=\"A:link;color:Purple\">";
    	//echo "<a href = 'updateElimination.php?eventId=$eventId&ageGroup=$ageGroupId&round=1&drawId=$drawIdR1' style=\"A:link;color:Purple\">";
    	echo $teamNameR1 = mysql_result($getEntriesRd1,$xi,"tblcompleteddraw.teamName");
    	echo "</a>";
    $xi++;

     

    Thanks for any help that anyone can help.

  10. I have a number of text boxes which are given their IDs dynamically as the page loads.  This enables me to have 5 text boxes which I can then post to a database.  An example of the name would be

     

    $name = "name" . $incrementNo;

     

    Name would would then be Name 1, 2, 3, 4, 5 etc...I am trying to validate these with some javascript code and I am trying to use var name1 = document.getElementById("<?php echo $name; ?>").value; however the PHP page will not pass back the $name?

     

    Any idea how I can get this working?

     

    Thanks in advance.

     

    Stuart

  11. THis is the code at line 37...

     

    if (!defined('PHPEXCEL_ROOT')) {

    /**

    * @ignore

    */

    define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../');

    require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');

    PHPExcel_Autoloader::Register();

    PHPExcel_Shared_ZipStreamWrapper::register();

    // check mbstring.func_overload

    if (ini_get('mbstring.func_overload') & 2) {

    throw new Exception('Multibyte function overloading in PHP must be disabled for string functions (2).');

    }

    }

     

  12. I am getting this error when trying to create a spreadsheet, could anyone help me?

     

    Fatal error: Class 'PHPExcel_Shared_ZipStreamWrapper' not found in /home/mypcguy2/public_html/accountstest/PHPExcel/IOFactory.php on line 37

     

     

    Many thanks

  13. I am getting a little further, it would seem this small peice of code is not allowed to write to a temporary directory, can anyone see where the problem might be?

     

    function _initialize()
    {
    	// Open tmp file for storing Worksheet data
    	$fileName = tempnam($this->_tmp_dir, 'XLSHEET');
    	$fh = fopen($fileName, 'w+');
    	if ($fh) {
    		// Store filehandle
    		$this->_filehandle = $fh;
    		$this->_tempFilesCreated[] = $fileName;
    	} else {
    		// If tmpfile() fails store data in memory
    		$this->_using_tmpfile = false;
    	}
    }

     

    This is the error message?

     

    Warning: tempnam() [function.tempnam]: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/mypcguy2:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/mypcguy2/public_html/accounts/PHPExcel/Writer/Excel5/Worksheet.php on line 299

  14. I hope someone can point me in the right direction.  I am getting the following error message on my server and my Excel file will not create.  It is working fine on my local machine, just not when I upload to my server.

     

    Warning: tempnam() [function.tempnam]: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/mypcguy2:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/mypcguy2/public_html/accounts/PHPExcel/Writer/Excel5/Worksheet.php on line 299

     

    Many thanks in advance for any help.

     

    Stuart

  15. Hi I am trying to insert a page break.  If I only use one page break using the code below it fails.

     

    echo "<hr/>";
    echo "</p>";
    echo "<p style=\"page-break-before: always\">";
    

     

    However if I enter another duplicate line as below it works fine, but adds in another page break.

    echo "<hr/>";
    echo "</p>";
    echo "<p style=\"page-break-before: always\">";
    echo "<hr/>";
    echo "</p>";
    echo "<p style=\"page-break-before: always\">";

     

    Can anyone help?

     

    Many thanks in advance.

     

     

  16. Hi I would like to begin to develop a website in PHP for an iPhone.

     

    I am hoping that someone may be able to help me with a couple of questions.

     

    1. Can I detect the browser and that its the specific Safari iPhone browser?

    2. Can I limit the webpage I develop in PHP to only be the screen size of the iPhone?

     

    Many thanks in advance to anyone who can give me some advice.

     

    Regards

     

    Stuart

  17. There is a problem with storing hundreths of a second within MYSQL.  Does anyone have a idea of how I can store 1 hours, 27 minutes, 15 seconds, and 85 hundreths of a second?

     

    I am trying to store athletics times.

     

    Many thanks in advance.

     

    Regards

     

    Stuart

×
×
  • 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.