Jump to content

kellyalan

Members
  • Content Count

    29
  • Joined

  • Last visited

Community Reputation

0 Neutral

About kellyalan

  • Rank
    Member
  1. Hello - I've got this code which is supposed to pull the generated .pdf and display it in the browser. It was working but in the past few months, has not. I'm wondering if there's any obvious code error that might be doing this. Any help/guidance appreciated. I've attached a image so you can see what I mean. The other tabs work (view as HTML on screen, download pdf, email to client) <?php $m_header = '<link href="shared/report.css" rel=stylesheet type="text/css">'; $m_body_tag = ' scroll=no'; require_once($DOCUMENT_ROOT."inc/top-2.inc.php"); $i_get_sid = isset($_GET["sid"]) ? (int)$_GET["sid"] : $i_sid; $i_get_pass = isset($_GET["a"]) ? $_GET["a"] : $_SESSION['r_pass']; $i_get_pass = addslashes($i_get_pass); $i_pdf_file_url = 'report.php?sid='.$i_get_sid.'&a='.urlencode($i_get_pass).'&b=/report.pdf'; echo '<table cellpadding=0 cellspacing=0 border=0 width="100%">'; echo '<tr vAlign=top><td height=7><img src="images/1x1.gif" width=1 height=7></td></tr>'; echo '<tr height=28 style="background: url(images/bookm-bg.gif) repeat-x"><td width="100%"><nobr>'; echo '<img src="images/1x1.gif" width=5 height=1><a href="report.php?sid='.$i_get_sid.'&a='.urlencode($i_get_pass).'"><img src="images/bookm-42.gif" width=67 height=28 border=0></a><img src="images/bookm-s1.gif" width=10 height=28 border=0><img src="images/bookm-51.gif" width=65 height=28 border=0> <a href="report.php?sid='.$i_get_sid.'&a='.urlencode($i_get_pass).'&b=/report.pdf"><img src="images/button-downloadpdf.gif" width=80 height=28 border=0></a> <a href="report.php?sid='.$i_get_sid.'&a='.urlencode($i_get_pass).'&b=email"><img src="images/button-emailpdf.gif" width=80 height=28 border=0></a>'; echo '</nobr></td><td><nobr><font style="font-size: 10px;"><a href="javascript:window.close();">Close Window</a> </font></nobr></td></tr></table>'; echo '<p><embed type="application/pdf" src="'.$i_pdf_file_url.'" name="plugin" width=100% height=100% fullscreen=yes style="position: absolute;"></p>'; require_once($DOCUMENT_ROOT."inc/btm-2.inc.php"); ?>
  2. I figured that might be the case.... Any good references for php code writers would be appreciated, we're in Southern California.
  3. Thanks for the information. I have a small understanding of how the PHP works but I think we'll have to have the code evaluated by a php expert and possibly update the whole site.
  4. Hello We have a testing site where users create a profile then take an aptitude test. Was working fine several months ago but we're trying to set up tests now and when the user enters their information and hits submit, we get these errors. (first it was the white screen, then I turned on the errors and received this) Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in ~/inc/connect.inc.php on line 11 Notice: Undefined variable: i_price in ~/profile-2.inc.php on line 97 Fatal error: Call to undefined function session_register() in ~/profile-2.inc.php on line 101 I'm assuming the Fatal Error is what's causing the profile not to be set up(and thus get the white screen). The code in profile-2 is: # Create new record: $now = time(); $password_name = random_password(PASS_LENGTH); $password_hash = bin2hex(mhash(MHASH_MD5, $password_name)); $i_qry2 = db_qry("INSERT INTO reports(createdate,passhash,fname,lname,age,gender,sport,loc,phone,address1,address2,city,state,zip,email,price) VALUES ($now,'$password_hash','$f_firstname','$f_lastname',$f_age,$f_gender,'$f_sport','$f_loc','$f_phone','$f_address1','$f_address2','$f_city','$f_state','$f_zip','$f_email','$i_price')") or die("Error: profile-2, SQL request error #2 ".mysql_error()); $i_sid = mysql_insert_id($sql_link); # Register SID in session: session_register('r_id'); <<<<this is line 101 $_SESSION['r_id'] = $i_sid; session_register('r_pass'); $_SESSION['r_pass'] = ''; session_register('r_ccode'); $_SESSION['r_ccode'] = stripslashes($f_ccode); Does anyone have a suggestion on what might be the problem and how I go about fixing it? Thanks in advance.
  5. Sorry - here we go - some of this has come to light as the day progressed(I wasn't at the testing).... First issue was that we had 2 ipads so 2 people were taking the test at a time. Wordpress, after multiple logins and logouts from the same IP addresses, gave us a "spambot" alert - from the Jetpak plugin - so in the future, we'll use it as private browsing and in the meantime, have deactivated the Jetpak setting. We seem ok on that issue now. Multiple users can log into our site and they can go to the testing center. Second, in the backend - all PHP coded / not wordpress - we had our first 2 athletes simultaneously take the test - it worked, we got a PDF output with the athlete's test results. The next two athletes tried - one test worked, one test didn't. We can't figure out why one took and one didn't. Maybe user, error maybe not but everything we've gone over today indicated that this person took the test correctly and submitted correctly. The application doesn't crash, it simply seems to have only worked(registered all of the answers to the test and then output a pdf and an HTML version) 3/4 of the time. Ultimately, I'd like to locate someone who, since the code is from 2004, can look it over and give us an indication if we're out of date and if there might be anything we can do to modernize the process. Maybe PHP hasn't changed significantly in the 12 years since our test's inception but better to be safe than sorry. The site is http://manofsteelesports.com/home/ I've attached an small image of the output that the test provides us(as admins). We can show it in HTML format for the user, we can display it as a PDF, we can download it, or we can email to the user.
  6. Normally we do this test with one athlete at a time. However, recently we had 8 members of a team try to do it at once.
  7. Thanks for the reply. Do you have a suggestion for posting the code and/or hiring someone to take a quick look to see what might be the issue? (fingers crossed that it's a quick fix) There are a lot of php pages that come together to make the questionnaire/test.
  8. Hi We had an online aptitude test written for us back in 2004/2005. A user registers on our site then can take a test that evaluates what type of learner they are. After they complete the test, we can send them a .pdf report. The front end of our site is a wordpress site, the testing center is written in php. Once a user registers, they get a link on our site that sends them out of wordpress to the PHP testing pages. Question: if we have 4-5 users sign up at once ( which isn't a problem in wordpress ), is there a way to allow for those users to take the aptitude test all at once. As of now, the "testing center" part of our site is only allowing 1 user at a time. Is this how PHP works? Is it the hosting server? We are hosted by Network Solutions. The test is around 120 questions long and 3 pages. Thanks in advance.
  9. I used the above code but had to change the variable to $i and it seems to work. Huge thanks! I was worried I'd break the theme and our site would go down if I tried this on my own. Set up in a child theme. <div class="occult" > <!-- TEST this is where the specialities boxes link is <a <?php echo colors('a');?> href="<?php echo $slice[$i]['link']; ?>" class="link" ></a> --> <!-- This is the added in code to link specialities to web pages, NOT to classes - remove to set theme back to original --> <?php echo '<a ' . colors('a'); if($i ==0) { echo ' href="https://www.absolutept.com/tendinopathy/" class="link"></a>'; } elseif($i==1) { echo ' href="https://www.absolutept.com/back-pain/" class="link"></a>'; } elseif($i==2) { echo ' href="https://www.absolutept.com/senior-fall-prevention-program/" class="link"></a>'; } else { echo ' href="https://www.absolutept.com/post-surgical-rehabilitation/" class="link"></a>'; } ?> </div>
  10. thanks for the replies cyber - I'll try out your code today - appreciate the guidance
  11. Hello - I hope I explain this clearly... I have some php code that presently displays 4 boxes in a row with images. When you click on a box/image, you go to a web post. The code goes to the bottom, sets the link, then loops back for the next image and repeats the process. What I'm trying to do is break this code apart so that that I can make each image go to a different link - basically set it up as html - image with link to a page. ( 4 of these) However, I don't want to break the code or the page that it displays ( our home page ) Here's the code snippet: <div id="new-classes" class="carousel slide"> <!-- Wrapper for slides ufff--> <div class="carousel-inner"> <?php $pieces=array_chunk($gallery,4); $j=0; foreach ($pieces as $slice) { echo '<div class="item '; if($j==0){echo 'active';} echo '">'; foreach ($slice as $i => $conte) { ?> <div class="col-sm-6 col-md-3" > <div class="new-class" > <img src="<?php echo $slice[$i]['image']; ?>" alt="//" /> <div class="class-title" > <div class="occult" > TEST this is where the specialities boxes link is <a <?php echo colors('a');?> href="<?php echo $slice[$i]['link']; ?>" class="link" ></a> I duplicated the above line and put in a specific link but it makes all the images go to the same page <a <?php echo colors('a');?> href="https://www.absolutept.com/tendinopathy/" class="link" ></a> --> </div> <h3 <?php echo colors('h3');?>><?php echo $slice[$i]['title']; ?></h3> <p <?php echo colors('p');?> class="occult" ><?php echo wp_trim_words(insert_br($slice[$i]['desc']),10,'...'); ?></p> </div> </div> </div> <?php } //end slice echo '</div>'; $j++; } // end pieces ?> </div> our homepage is absolutept.com -- these images are the "specialties" section 3/4 of the way down In the theme( wordpress) - there's an option to enter specialties ( custom post type ) which we did but we don't want these links to go to those special posts, we want them to go to the pages that the user can find in the main menu I know this is breaking the set up of the theme but if it's doable, we'd like to try First - any idea if it's doable and if so, thoughts on how? =) Thanks in advance.
×
×
  • 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.